Skip to content

Commit 59b73bd

Browse files
Google APIscopybara-github
authored andcommitted
feat: add subject_to_thresholding field to ResponseMetadata type
feat: add `tokens_per_project_per_hour` field to `PropertyQuota` type PiperOrigin-RevId: 479394249
1 parent c73994e commit 59b73bd

4 files changed

Lines changed: 104 additions & 34 deletions

File tree

google/analytics/data/v1beta/BUILD.bazel

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ java_grpc_library(
6666
java_gapic_library(
6767
name = "data_java_gapic",
6868
srcs = [":data_proto_with_info"],
69+
gapic_yaml = None,
6970
grpc_service_config = "analytics_data_grpc_service_config.json",
71+
rest_numeric_enums = False,
72+
service_yaml = "analyticsdata_v1beta.yaml",
7073
test_deps = [
7174
":data_java_grpc",
7275
],
7376
transport = "grpc+rest",
7477
deps = [
7578
":data_java_proto",
79+
"//google/api:api_java_proto",
7680
],
7781
)
7882

@@ -88,6 +92,7 @@ java_gapic_test(
8892
# Open Source Packages
8993
java_gapic_assembly_gradle_pkg(
9094
name = "google-analytics-data-v1beta-java",
95+
include_samples = True,
9196
transport = "grpc+rest",
9297
deps = [
9398
":data_java_gapic",
@@ -124,6 +129,7 @@ go_gapic_library(
124129
grpc_service_config = "analytics_data_grpc_service_config.json",
125130
importpath = "google.golang.org/google/analytics/data/v1beta;data",
126131
metadata = True,
132+
rest_numeric_enums = False,
127133
service_yaml = "analyticsdata_v1beta.yaml",
128134
transport = "grpc+rest",
129135
deps = [
@@ -163,7 +169,11 @@ py_gapic_library(
163169
name = "data_py_gapic",
164170
srcs = [":data_proto"],
165171
grpc_service_config = "analytics_data_grpc_service_config.json",
172+
rest_numeric_enums = False,
173+
service_yaml = "analyticsdata_v1beta.yaml",
166174
transport = "grpc+rest",
175+
deps = [
176+
],
167177
)
168178

169179
py_test(
@@ -210,6 +220,8 @@ php_gapic_library(
210220
name = "data_php_gapic",
211221
srcs = [":data_proto_with_info"],
212222
grpc_service_config = "analytics_data_grpc_service_config.json",
223+
rest_numeric_enums = False,
224+
service_yaml = "analyticsdata_v1beta.yaml",
213225
deps = [
214226
":data_php_grpc",
215227
":data_php_proto",
@@ -242,6 +254,7 @@ nodejs_gapic_library(
242254
extra_protoc_parameters = ["metadata"],
243255
grpc_service_config = "analytics_data_grpc_service_config.json",
244256
package = "google.analytics.data.v1beta",
257+
rest_numeric_enums = False,
245258
service_yaml = "analyticsdata_v1beta.yaml",
246259
deps = [],
247260
)
@@ -280,16 +293,18 @@ ruby_cloud_gapic_library(
280293
name = "data_ruby_gapic",
281294
srcs = [":data_proto_with_info"],
282295
extra_protoc_parameters = [
283-
"ruby-cloud-gem-name=google-analytics-data-v1beta",
284-
"ruby-cloud-env-prefix=ANALYTICS_DATA",
285-
"ruby-cloud-product-url=https://developers.google.com/analytics/devguides/reporting/data/v1",
286296
"ruby-cloud-api-id=analyticsdata.googleapis.com",
287297
"ruby-cloud-api-shortname=analyticsdata",
298+
"ruby-cloud-env-prefix=ANALYTICS_DATA",
299+
"ruby-cloud-gem-name=google-analytics-data-v1beta",
300+
"ruby-cloud-product-url=https://developers.google.com/analytics/devguides/reporting/data/v1",
288301
"ruby-cloud-service-override=BetaAnalyticsData=AnalyticsData",
289302
],
290303
grpc_service_config = "analytics_data_grpc_service_config.json",
304+
rest_numeric_enums = False,
291305
ruby_cloud_description = "The Google Analytics Data API provides programmatic methods to access report data in Google Analytics 4 (GA4) properties. Google Analytics 4 helps you understand how people use your web, iOS, or Android app.",
292306
ruby_cloud_title = "Google Analytics Data V1beta",
307+
service_yaml = "analyticsdata_v1beta.yaml",
293308
deps = [
294309
":data_ruby_grpc",
295310
":data_ruby_proto",
@@ -333,6 +348,7 @@ csharp_gapic_library(
333348
srcs = [":data_proto_with_info"],
334349
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
335350
grpc_service_config = "analytics_data_grpc_service_config.json",
351+
rest_numeric_enums = False,
336352
service_yaml = "analyticsdata_v1beta.yaml",
337353
deps = [
338354
":data_csharp_grpc",
@@ -353,4 +369,20 @@ csharp_gapic_assembly_pkg(
353369
##############################################################################
354370
# C++
355371
##############################################################################
356-
# Put your C++ rules here
372+
load(
373+
"@com_google_googleapis_imports//:imports.bzl",
374+
"cc_grpc_library",
375+
"cc_proto_library",
376+
)
377+
378+
cc_proto_library(
379+
name = "data_cc_proto",
380+
deps = [":data_proto"],
381+
)
382+
383+
cc_grpc_library(
384+
name = "data_cc_grpc",
385+
srcs = [":data_proto"],
386+
grpc_only = True,
387+
deps = [":data_cc_proto"],
388+
)

google/analytics/data/v1beta/analytics_data_api.proto

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -41,6 +41,10 @@ service BetaAnalyticsData {
4141
// measurements of user activity on your property, such as active users or
4242
// event count. Dimensions break down metrics across some common criteria,
4343
// such as country or event name.
44+
//
45+
// For a guide to constructing requests & understanding responses, see
46+
// [Creating a
47+
// Report](https://developers.google.com/analytics/devguides/reporting/data/v1/basics).
4448
rpc RunReport(RunReportRequest) returns (RunReportResponse) {
4549
option (google.api.http) = {
4650
post: "/v1beta/{property=properties/*}:runReport"
@@ -95,9 +99,15 @@ service BetaAnalyticsData {
9599
option (google.api.method_signature) = "name";
96100
}
97101

98-
// The Google Analytics Realtime API returns a customized report of realtime
99-
// event data for your property. These reports show events and usage from the
100-
// last 30 minutes.
102+
// Returns a customized report of realtime event data for your property.
103+
// Events appear in realtime reports seconds after they have been sent to
104+
// the Google Analytics. Realtime reports show events and usage data for the
105+
// periods of time ranging from the present moment to 30 minutes ago (up to
106+
// 60 minutes for Google Analytics 360 properties).
107+
//
108+
// For a guide to constructing realtime requests & understanding responses,
109+
// see [Creating a Realtime
110+
// Report](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-basics).
101111
rpc RunRealtimeReport(RunRealtimeReportRequest) returns (RunRealtimeReportResponse) {
102112
option (google.api.http) = {
103113
post: "/v1beta/{property=properties/*}:runRealtimeReport"
@@ -219,8 +229,8 @@ message RunReportRequest {
219229
// for examples. Metrics cannot be used in this filter.
220230
FilterExpression dimension_filter = 5;
221231

222-
// The filter clause of metrics. Applied at post aggregation phase, similar to
223-
// SQL having-clause. Dimensions cannot be used in this filter.
232+
// The filter clause of metrics. Applied after aggregating the report's rows,
233+
// similar to SQL having-clause. Dimensions cannot be used in this filter.
224234
FilterExpression metric_filter = 6;
225235

226236
// The row count of the start row. The first row is counted as row 0.
@@ -542,13 +552,11 @@ message RunRealtimeReportRequest {
542552
// The metrics requested and displayed.
543553
repeated Metric metrics = 3;
544554

545-
// The filter clause of dimensions. Dimensions must be requested to be used in
546-
// this filter. Metrics cannot be used in this filter.
555+
// The filter clause of dimensions. Metrics cannot be used in this filter.
547556
FilterExpression dimension_filter = 4;
548557

549558
// The filter clause of metrics. Applied at post aggregation phase, similar to
550-
// SQL having-clause. Metrics must be requested to be used in this filter.
551-
// Dimensions cannot be used in this filter.
559+
// SQL having-clause. Dimensions cannot be used in this filter.
552560
FilterExpression metric_filter = 5;
553561

554562
// The number of rows to return. If unspecified, 10,000 rows are returned. The

google/analytics/data/v1beta/analytics_data_grpc_service_config.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"methodConfig": [
33
{
4-
"name": [{"service": "google.analytics.data.v1beta.BetaAnalyticsData"}],
4+
"name": [{ "service": "google.analytics.data.v1beta.BetaAnalyticsData" }],
55
"timeout": "60s",
66
"retryPolicy": {
77
"maxAttempts": 5,
@@ -32,6 +32,14 @@
3232
{
3333
"service": "google.analytics.data.v1beta.BetaAnalyticsData",
3434
"method": "RunRealtimeReport"
35+
},
36+
{
37+
"service": "google.analytics.data.v1beta.BetaAnalyticsData",
38+
"method": "GetMetadata"
39+
},
40+
{
41+
"service": "google.analytics.data.v1beta.BetaAnalyticsData",
42+
"method": "CheckCompatibility"
3543
}
3644
],
3745
"timeout": "60s"

google/analytics/data/v1beta/data.proto

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -52,8 +52,8 @@ message MinuteRange {
5252
//
5353
// If unspecified, `startMinutesAgo` is defaulted to 29. Standard Analytics
5454
// properties can request up to the last 30 minutes of event data
55-
// (`startMinutesAgo <= 29`), and Google Analytics 360 properties can request
56-
// up to the last 60 minutes of event data (`startMinutesAgo <= 59`).
55+
// (`startMinutesAgo <= 29`), and 360 Analytics properties can request up to
56+
// the last 60 minutes of event data (`startMinutesAgo <= 59`).
5757
optional int32 start_minutes_ago = 1;
5858

5959
// The inclusive end minute for the query as a number of minutes before now.
@@ -63,8 +63,8 @@ message MinuteRange {
6363
//
6464
// If unspecified, `endMinutesAgo` is defaulted to 0. Standard Analytics
6565
// properties can request any minute in the last 30 minutes of event data
66-
// (`endMinutesAgo <= 29`), and Google Analytics 360 properties can request
67-
// any minute in the last 60 minutes of event data (`endMinutesAgo <= 59`).
66+
// (`endMinutesAgo <= 29`), and 360 Analytics properties can request any
67+
// minute in the last 60 minutes of event data (`endMinutesAgo <= 59`).
6868
optional int32 end_minutes_ago = 2;
6969

7070
// Assigns a name to this minute range. The dimension `dateRange` is valued to
@@ -76,7 +76,7 @@ message MinuteRange {
7676

7777
// Dimensions are attributes of your data. For example, the dimension city
7878
// indicates the city from which an event originates. Dimension values in report
79-
// responses are strings; for example, city could be "Paris" or "New York".
79+
// responses are strings; for example, the city could be "Paris" or "New York".
8080
// Requests are allowed up to 9 dimensions.
8181
message Dimension {
8282
// The name of the dimension. See the [API
@@ -168,9 +168,8 @@ message Metric {
168168
bool invisible = 3;
169169
}
170170

171-
// To express dimension or metric filters.
172-
// The fields in the same FilterExpression need to be either all dimensions or
173-
// all metrics.
171+
// To express dimension or metric filters. The fields in the same
172+
// FilterExpression need to be either all dimensions or all metrics.
174173
message FilterExpression {
175174
// Specify one type of filter expression for `FilterExpression`.
176175
oneof expr {
@@ -183,9 +182,8 @@ message FilterExpression {
183182
// The FilterExpression is NOT of not_expression.
184183
FilterExpression not_expression = 3;
185184

186-
// A primitive filter.
187-
// All fields in filter in same FilterExpression needs to be either all
188-
// dimensions or metrics.
185+
// A primitive filter. In the same FilterExpression, all of the filter's
186+
// field names need to be either all dimensions or all metrics.
189187
Filter filter = 4;
190188
}
191189
}
@@ -217,10 +215,10 @@ message Filter {
217215
// Contains the string value.
218216
CONTAINS = 4;
219217

220-
// Full regular expression match with the string value.
218+
// Full match for the regular expression with the string value.
221219
FULL_REGEXP = 5;
222220

223-
// Partial regular expression match with the string value.
221+
// Partial match for the regular expression with the string value.
224222
PARTIAL_REGEXP = 6;
225223
}
226224

@@ -283,8 +281,12 @@ message Filter {
283281
NumericValue to_value = 2;
284282
}
285283

286-
// The dimension name or metric name. Must be a name defined in dimensions
287-
// or metrics.
284+
// The dimension name or metric name.
285+
//
286+
// In most methods, dimensions & metrics can be used for the first time in
287+
// this field. However in a RunPivotReportRequest, this field must be
288+
// additionally specified by name in the RunPivotReportRequest's dimensions or
289+
// metrics.
288290
string field_name = 1;
289291

290292
// Specify one type of filter for `Filter`.
@@ -303,7 +305,9 @@ message Filter {
303305
}
304306
}
305307

306-
// The sort options.
308+
// Order bys define how rows will be sorted in the response. For example,
309+
// ordering rows by descending event count is one ordering, and ordering rows by
310+
// the event name string is a different ordering.
307311
message OrderBy {
308312
// Sorts by metric values.
309313
message MetricOrderBy {
@@ -604,6 +608,16 @@ message ResponseMetaData {
604608

605609
// If empty reason is specified, the report is empty for this reason.
606610
optional string empty_reason = 7;
611+
612+
// If `subjectToThresholding` is true, this report is subject to thresholding
613+
// and only returns data that meets the minimum aggregation thresholds. It is
614+
// possible for a request to be subject to thresholding thresholding and no
615+
// data is absent from the report, and this happens when all data is above the
616+
// thresholds. To learn more, see [Data
617+
// thresholds](https://support.google.com/analytics/answer/9383630) and [About
618+
// Demographics and
619+
// Interests](https://support.google.com/analytics/answer/2799357).
620+
optional bool subject_to_thresholding = 8;
607621
}
608622

609623
// Describes a dimension column in the report. Dimensions requested in a report
@@ -732,8 +746,8 @@ message PropertyQuota {
732746

733747
// Standard Analytics Properties can use up to 5,000 tokens per hour;
734748
// Analytics 360 Properties can use 50,000 tokens per hour. An API request
735-
// consumes a single number of tokens, and that number is deducted from both
736-
// the hourly and daily quotas.
749+
// consumes a single number of tokens, and that number is deducted from all of
750+
// the hourly, daily, and per project hourly quotas.
737751
QuotaStatus tokens_per_hour = 2;
738752

739753
// Standard Analytics Properties can send up to 10 concurrent requests;
@@ -750,6 +764,14 @@ message PropertyQuota {
750764
// is individually counted for this quota if the request contains potentially
751765
// thresholded dimensions.
752766
QuotaStatus potentially_thresholded_requests_per_hour = 5;
767+
768+
// Analytics Properties can use up to 25% of their tokens per project per
769+
// hour. This amounts to standard Analytics Properties can use up to 1,250
770+
// tokens per project per hour, and Analytics 360 Properties can use 12,500
771+
// tokens per project per hour. An API request consumes a single number of
772+
// tokens, and that number is deducted from all of the hourly, daily, and per
773+
// project hourly quotas.
774+
QuotaStatus tokens_per_project_per_hour = 6;
753775
}
754776

755777
// Current state for a particular quota group.

0 commit comments

Comments
 (0)