Skip to content

Commit 2f00b9a

Browse files
Google APIscopybara-github
authored andcommitted
feat: add GetAudience, 'ListAudience', 'CreateAudience', 'UpdateAudience', 'ArchiveAudience' methods to the Admin API v1alpha
feat: add `GetAttributionSettings`, `UpdateAttributionSettings` methods to the Admin API v1alpha PiperOrigin-RevId: 465469599
1 parent 801d330 commit 2f00b9a

5 files changed

Lines changed: 964 additions & 10 deletions

File tree

google/analytics/admin/v1alpha/BUILD.bazel

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -22,13 +22,15 @@ proto_library(
2222
name = "admin_proto",
2323
srcs = [
2424
"analytics_admin.proto",
25+
"audience.proto",
2526
"resources.proto",
2627
],
2728
deps = [
2829
"//google/api:annotations_proto",
2930
"//google/api:client_proto",
3031
"//google/api:field_behavior_proto",
3132
"//google/api:resource_proto",
33+
"@com_google_protobuf//:duration_proto",
3234
"@com_google_protobuf//:empty_proto",
3335
"@com_google_protobuf//:field_mask_proto",
3436
"@com_google_protobuf//:timestamp_proto",
@@ -70,13 +72,16 @@ java_grpc_library(
7072
java_gapic_library(
7173
name = "admin_java_gapic",
7274
srcs = [":admin_proto_with_info"],
75+
gapic_yaml = "analyticsadmin_gapic.yaml",
7376
grpc_service_config = "admin_grpc_service_config.json",
77+
service_yaml = "analyticsadmin.yaml",
7478
test_deps = [
7579
":admin_java_grpc",
7680
],
7781
transport = "grpc+rest",
7882
deps = [
7983
":admin_java_proto",
84+
"//google/api:api_java_proto",
8085
],
8186
)
8287

@@ -92,6 +97,7 @@ java_gapic_test(
9297
# Open Source Packages
9398
java_gapic_assembly_gradle_pkg(
9499
name = "google-analytics-admin-v1alpha-java",
100+
include_samples = True,
95101
transport = "grpc+rest",
96102
deps = [
97103
":admin_java_gapic",
@@ -127,10 +133,12 @@ go_gapic_library(
127133
srcs = [":admin_proto_with_info"],
128134
grpc_service_config = "admin_grpc_service_config.json",
129135
importpath = "google.golang.org/google/analytics/admin/v1alpha;admin",
130-
service_yaml = "analyticsadmin_v1alpha.yaml",
136+
metadata = True,
137+
service_yaml = "analyticsadmin.yaml",
131138
transport = "grpc+rest",
132139
deps = [
133140
":admin_go_proto",
141+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
134142
],
135143
)
136144

@@ -146,6 +154,7 @@ go_gapic_assembly_pkg(
146154
name = "gapi-analytics-admin-v1alpha-go",
147155
deps = [
148156
":admin_go_gapic",
157+
":admin_go_gapic_srcjar-metadata.srcjar",
149158
":admin_go_gapic_srcjar-test.srcjar",
150159
":admin_go_proto",
151160
],
@@ -165,6 +174,9 @@ py_gapic_library(
165174
name = "admin_py_gapic",
166175
srcs = [":admin_proto"],
167176
grpc_service_config = "admin_grpc_service_config.json",
177+
service_yaml = "analyticsadmin.yaml",
178+
deps = [
179+
],
168180
)
169181

170182
py_test(
@@ -211,6 +223,7 @@ php_gapic_library(
211223
name = "admin_php_gapic",
212224
srcs = [":admin_proto_with_info"],
213225
grpc_service_config = "admin_grpc_service_config.json",
226+
service_yaml = "analyticsadmin.yaml",
214227
deps = [
215228
":admin_php_grpc",
216229
":admin_php_proto",
@@ -243,7 +256,7 @@ nodejs_gapic_library(
243256
extra_protoc_parameters = ["metadata"],
244257
grpc_service_config = "admin_grpc_service_config.json",
245258
package = "google.analytics.admin.v1alpha",
246-
service_yaml = "analyticsadmin_v1alpha.yaml",
259+
service_yaml = "analyticsadmin.yaml",
247260
deps = [],
248261
)
249262

@@ -281,14 +294,15 @@ ruby_cloud_gapic_library(
281294
name = "admin_ruby_gapic",
282295
srcs = [":admin_proto_with_info"],
283296
extra_protoc_parameters = [
284-
"ruby-cloud-gem-name=google-analytics-admin-v1alpha",
285-
"ruby-cloud-env-prefix=ANALYTICS_ADMIN",
286297
"ruby-cloud-api-id=analyticsadmin.googleapis.com",
287298
"ruby-cloud-api-shortname=analyticsadmin",
299+
"ruby-cloud-env-prefix=ANALYTICS_ADMIN",
300+
"ruby-cloud-gem-name=google-analytics-admin-v1alpha",
288301
],
289302
grpc_service_config = "admin_grpc_service_config.json",
290303
ruby_cloud_description = "The Analytics Admin API allows for programmatic access to the Google Analytics App+Web configuration data. You can use the Google Analytics Admin API to manage accounts and App+Web properties.",
291304
ruby_cloud_title = "Google Analytics Admin V1alpha",
305+
service_yaml = "analyticsadmin.yaml",
292306
deps = [
293307
":admin_ruby_grpc",
294308
":admin_ruby_proto",
@@ -332,7 +346,7 @@ csharp_gapic_library(
332346
srcs = [":admin_proto_with_info"],
333347
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
334348
grpc_service_config = "admin_grpc_service_config.json",
335-
service_yaml = "analyticsadmin_v1alpha.yaml",
349+
service_yaml = "analyticsadmin.yaml",
336350
deps = [
337351
":admin_csharp_grpc",
338352
":admin_csharp_proto",
@@ -352,4 +366,20 @@ csharp_gapic_assembly_pkg(
352366
##############################################################################
353367
# C++
354368
##############################################################################
355-
# Put your C++ rules here
369+
load(
370+
"@com_google_googleapis_imports//:imports.bzl",
371+
"cc_grpc_library",
372+
"cc_proto_library",
373+
)
374+
375+
cc_proto_library(
376+
name = "admin_cc_proto",
377+
deps = [":admin_proto"],
378+
)
379+
380+
cc_grpc_library(
381+
name = "admin_cc_grpc",
382+
srcs = [":admin_proto"],
383+
grpc_only = True,
384+
deps = [":admin_cc_proto"],
385+
)

google/analytics/admin/v1alpha/analytics_admin.proto

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.analytics.admin.v1alpha;
1818

19+
import "google/analytics/admin/v1alpha/audience.proto";
1920
import "google/analytics/admin/v1alpha/resources.proto";
2021
import "google/api/annotations.proto";
2122
import "google/api/client.proto";
@@ -729,6 +730,67 @@ service AnalyticsAdminService {
729730
};
730731
option (google.api.method_signature) = "name";
731732
}
733+
734+
// Lookup for a single Audience.
735+
// Audiences created before 2020 may not be supported.
736+
rpc GetAudience(GetAudienceRequest) returns (Audience) {
737+
option (google.api.http) = {
738+
get: "/v1alpha/{name=properties/*/audiences/*}"
739+
};
740+
option (google.api.method_signature) = "name";
741+
}
742+
743+
// Lists Audiences on a property.
744+
// Audiences created before 2020 may not be supported.
745+
rpc ListAudiences(ListAudiencesRequest) returns (ListAudiencesResponse) {
746+
option (google.api.http) = {
747+
get: "/v1alpha/{parent=properties/*}/audiences"
748+
};
749+
option (google.api.method_signature) = "parent";
750+
}
751+
752+
// Creates an Audience.
753+
rpc CreateAudience(CreateAudienceRequest) returns (Audience) {
754+
option (google.api.http) = {
755+
post: "/v1alpha/{parent=properties/*}/audiences"
756+
body: "audience"
757+
};
758+
option (google.api.method_signature) = "parent,audience";
759+
}
760+
761+
// Updates an Audience on a property.
762+
rpc UpdateAudience(UpdateAudienceRequest) returns (Audience) {
763+
option (google.api.http) = {
764+
patch: "/v1alpha/{audience.name=properties/*/audiences/*}"
765+
body: "audience"
766+
};
767+
option (google.api.method_signature) = "audience,update_mask";
768+
}
769+
770+
// Archives an Audience on a property.
771+
rpc ArchiveAudience(ArchiveAudienceRequest) returns (google.protobuf.Empty) {
772+
option (google.api.http) = {
773+
post: "/v1alpha/{name=properties/*/audiences/*}:archive"
774+
body: "*"
775+
};
776+
}
777+
778+
// Lookup for a AttributionSettings singleton.
779+
rpc GetAttributionSettings(GetAttributionSettingsRequest) returns (AttributionSettings) {
780+
option (google.api.http) = {
781+
get: "/v1alpha/{name=properties/*/attributionSettings}"
782+
};
783+
option (google.api.method_signature) = "name";
784+
}
785+
786+
// Updates attribution settings on a property.
787+
rpc UpdateAttributionSettings(UpdateAttributionSettingsRequest) returns (AttributionSettings) {
788+
option (google.api.http) = {
789+
patch: "/v1alpha/{attribution_settings.name=properties/*/attributionSettings}"
790+
body: "attribution_settings"
791+
};
792+
option (google.api.method_signature) = "attribution_settings,update_mask";
793+
}
732794
}
733795

734796
// Request message for GetAccount RPC.
@@ -2039,3 +2101,109 @@ message GetDataStreamRequest {
20392101
}
20402102
];
20412103
}
2104+
2105+
// Request message for GetAudience RPC.
2106+
message GetAudienceRequest {
2107+
// Required. The name of the Audience to get.
2108+
// Example format: properties/1234/audiences/5678
2109+
string name = 1 [
2110+
(google.api.field_behavior) = REQUIRED,
2111+
(google.api.resource_reference) = {
2112+
type: "analyticsadmin.googleapis.com/Audience"
2113+
}
2114+
];
2115+
}
2116+
2117+
// Request message for ListAudiences RPC.
2118+
message ListAudiencesRequest {
2119+
// Required. Example format: properties/1234
2120+
string parent = 1 [
2121+
(google.api.field_behavior) = REQUIRED,
2122+
(google.api.resource_reference) = {
2123+
child_type: "analyticsadmin.googleapis.com/Audience"
2124+
}
2125+
];
2126+
2127+
// The maximum number of resources to return.
2128+
// If unspecified, at most 50 resources will be returned.
2129+
// The maximum value is 200 (higher values will be coerced to the maximum).
2130+
int32 page_size = 2;
2131+
2132+
// A page token, received from a previous `ListAudiences` call. Provide this
2133+
// to retrieve the subsequent page.
2134+
//
2135+
// When paginating, all other parameters provided to `ListAudiences` must
2136+
// match the call that provided the page token.
2137+
string page_token = 3;
2138+
}
2139+
2140+
// Response message for ListAudiences RPC.
2141+
message ListAudiencesResponse {
2142+
// List of Audiences.
2143+
repeated Audience audiences = 1;
2144+
2145+
// A token, which can be sent as `page_token` to retrieve the next page.
2146+
// If this field is omitted, there are no subsequent pages.
2147+
string next_page_token = 2;
2148+
}
2149+
2150+
// Request message for CreateAudience RPC.
2151+
message CreateAudienceRequest {
2152+
// Required. Example format: properties/1234
2153+
string parent = 1 [
2154+
(google.api.field_behavior) = REQUIRED,
2155+
(google.api.resource_reference) = {
2156+
child_type: "analyticsadmin.googleapis.com/Audience"
2157+
}
2158+
];
2159+
2160+
// Required. The audience to create.
2161+
Audience audience = 2 [(google.api.field_behavior) = REQUIRED];
2162+
}
2163+
2164+
// Request message for UpdateAudience RPC.
2165+
message UpdateAudienceRequest {
2166+
// Required. The audience to update.
2167+
// The audience's `name` field is used to identify the audience to be updated.
2168+
Audience audience = 1 [(google.api.field_behavior) = REQUIRED];
2169+
2170+
// Required. The list of fields to be updated. Field names must be in snake case
2171+
// (e.g., "field_to_update"). Omitted fields will not be updated. To replace
2172+
// the entire entity, use one path with the string "*" to match all fields.
2173+
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
2174+
}
2175+
2176+
// Request message for ArchiveAudience RPC.
2177+
message ArchiveAudienceRequest {
2178+
// Required. Example format: properties/1234/audiences/5678
2179+
string name = 1 [
2180+
(google.api.field_behavior) = REQUIRED,
2181+
(google.api.resource_reference) = {
2182+
child_type: "analyticsadmin.googleapis.com/Audience"
2183+
}
2184+
];
2185+
}
2186+
2187+
// Request message for GetAttributionSettings RPC.
2188+
message GetAttributionSettingsRequest {
2189+
// Required. The name of the attribution settings to retrieve.
2190+
// Format: properties/{property}/attributionSettings
2191+
string name = 1 [
2192+
(google.api.field_behavior) = REQUIRED,
2193+
(google.api.resource_reference) = {
2194+
type: "analyticsadmin.googleapis.com/AttributionSettings"
2195+
}
2196+
];
2197+
}
2198+
2199+
// Request message for UpdateAttributionSettings RPC
2200+
message UpdateAttributionSettingsRequest {
2201+
// Required. The attribution settings to update.
2202+
// The `name` field is used to identify the settings to be updated.
2203+
AttributionSettings attribution_settings = 1 [(google.api.field_behavior) = REQUIRED];
2204+
2205+
// Required. The list of fields to be updated. Field names must be in snake case
2206+
// (e.g., "field_to_update"). Omitted fields will not be updated. To replace
2207+
// the entire entity, use one path with the string "*" to match all fields.
2208+
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
2209+
}

0 commit comments

Comments
 (0)