diff --git a/google/analytics/admin/v1alpha/BUILD.bazel b/google/analytics/admin/v1alpha/BUILD.bazel index 7d065170..b50becc7 100644 --- a/google/analytics/admin/v1alpha/BUILD.bazel +++ b/google/analytics/admin/v1alpha/BUILD.bazel @@ -153,24 +153,62 @@ go_gapic_assembly_pkg( ############################################################################## # Python ############################################################################## -# This library is using Python microgenerator. -# DO NOT OVERRIDE this Python section with autogenerated rules. load( "@com_google_googleapis_imports//:imports.bzl", - py_gapic_assembly_pkg = "py_gapic_assembly_pkg2", - py_gapic_library = "py_gapic_library2", + "moved_proto_library", + "py_gapic_assembly_pkg", + "py_gapic_library", + "py_grpc_library", + "py_proto_library", +) + +moved_proto_library( + name = "admin_moved_proto", + srcs = [":admin_proto"], + deps = [ + "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:field_behavior_proto", + "//google/api:resource_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:field_mask_proto", + "@com_google_protobuf//:timestamp_proto", + "@com_google_protobuf//:wrappers_proto", + ], +) + +py_proto_library( + name = "admin_py_proto", + plugin = "@protoc_docs_plugin//:docs_plugin", + deps = [":admin_moved_proto"], +) + +py_grpc_library( + name = "admin_py_grpc", + srcs = [":admin_moved_proto"], + deps = [":admin_py_proto"], ) py_gapic_library( name = "admin_py_gapic", - srcs = [":admin_proto"], + src = ":admin_proto_with_info", + gapic_yaml = "analyticsadmin_gapic.yaml", grpc_service_config = "admin_grpc_service_config.json", + package = "google.analytics.admin.v1alpha", + service_yaml = "analyticsadmin_v1alpha.yaml", + deps = [ + ":admin_py_grpc", + ":admin_py_proto", + ], ) +# Open Source Packages py_gapic_assembly_pkg( name = "google-analytics-admin-v1alpha-py", deps = [ ":admin_py_gapic", + ":admin_py_grpc", + ":admin_py_proto", ], ) @@ -316,8 +354,8 @@ csharp_grpc_library( csharp_gapic_library( name = "admin_csharp_gapic", srcs = [":admin_proto_with_info"], - grpc_service_config = "admin_grpc_service_config.json", common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json", + grpc_service_config = "admin_grpc_service_config.json", deps = [ ":admin_csharp_grpc", ":admin_csharp_proto", diff --git a/google/analytics/admin/v1alpha/analytics_admin.proto b/google/analytics/admin/v1alpha/analytics_admin.proto index 60d503a9..566a8fec 100644 --- a/google/analytics/admin/v1alpha/analytics_admin.proto +++ b/google/analytics/admin/v1alpha/analytics_admin.proto @@ -94,6 +94,13 @@ service AnalyticsAdminService { }; } + // Returns summaries of all accounts accessible by the caller. + rpc ListAccountSummaries(ListAccountSummariesRequest) returns (ListAccountSummariesResponse) { + option (google.api.http) = { + get: "/v1alpha/accountSummaries" + }; + } + // Lookup for a single "App+Web" Property. // // Throws "Target not found" if no such property found, if property is not @@ -1342,3 +1349,28 @@ message GetDataSharingSettingsRequest { } ]; } + +// Request message for ListAccountSummaries RPC. +message ListAccountSummariesRequest { + // The maximum number of AccountSummary resources to return. The service may + // return fewer than this value, even if there are additional pages. + // If unspecified, at most 50 resources will be returned. + // The maximum value is 200; (higher values will be coerced to the maximum) + int32 page_size = 1; + + // A page token, received from a previous `ListAccountSummaries` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListAccountSummaries` + // must match the call that provided the page token. + string page_token = 2; +} + +// Response message for ListAccountSummaries RPC. +message ListAccountSummariesResponse { + // Account summaries of all accounts the caller has access to. + repeated AccountSummary account_summaries = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/google/analytics/admin/v1alpha/analyticsadmin_v1alpha.yaml b/google/analytics/admin/v1alpha/analyticsadmin_v1alpha.yaml index ecd6c163..40563f2e 100644 --- a/google/analytics/admin/v1alpha/analyticsadmin_v1alpha.yaml +++ b/google/analytics/admin/v1alpha/analyticsadmin_v1alpha.yaml @@ -1,7 +1,7 @@ type: google.api.Service config_version: 3 name: analyticsadmin.googleapis.com -title: Analytics Admin API +title: Google Analytics Admin API apis: - name: google.analytics.admin.v1alpha.AnalyticsAdminService @@ -76,6 +76,10 @@ authentication: oauth: canonical_scopes: |- https://www.googleapis.com/auth/analytics.readonly + - selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccountSummaries + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/analytics.readonly - selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccounts oauth: canonical_scopes: |- diff --git a/google/analytics/admin/v1alpha/resources.proto b/google/analytics/admin/v1alpha/resources.proto index 79bc304c..1c8d91ba 100644 --- a/google/analytics/admin/v1alpha/resources.proto +++ b/google/analytics/admin/v1alpha/resources.proto @@ -569,3 +569,43 @@ enum MaximumUserAccess { // the Firebase link. EDITOR_INCLUDING_LINK_MANAGEMENT = 4; } + +// A virtual resource representing an overview of an account and +// all its child App+Web properties. +message AccountSummary { + option (google.api.resource) = { + type: "analyticsadmin.googleapis.com/AccountSummary" + pattern: "accountSummaries/{account_summary}" + }; + + // Resource name for this account summary. + // Format: accountSummaries/{account_id} + // Example: "accountSummaries/1000" + string name = 1; + + // Resource name of account referred to by this account summary + // Format: accounts/{account_id} + // Example: "accounts/1000" + string account = 2 [(google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Account" + }]; + + // Display name for the account referred to in this account summary. + string display_name = 3; + + // List of summaries for child accounts of this account. + repeated PropertySummary property_summaries = 4; +} + +// A virtual resource representing metadata for an App+Web property. +message PropertySummary { + // Resource name of property referred to by this property summary + // Format: properties/{property_id} + // Example: "properties/1000" + string property = 1 [(google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Property" + }]; + + // Display name for the property referred to in this account summary. + string display_name = 2; +}