Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80bf613

Browse files
Google APIscopybara-github
authored andcommitted
feat: add RunAccessReport method to the Admin API v1alpha
PiperOrigin-RevId: 465589484
1 parent 45b3409 commit 80bf613

File tree

4 files changed

+480
-7
lines changed

4 files changed

+480
-7
lines changed

google/analytics/admin/v1alpha/BUILD.bazel

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
2121
proto_library(
2222
name = "admin_proto",
2323
srcs = [
24+
"access_report.proto",
2425
"analytics_admin.proto",
2526
"audience.proto",
2627
"resources.proto",
@@ -74,7 +75,7 @@ java_gapic_library(
7475
srcs = [":admin_proto_with_info"],
7576
gapic_yaml = "analyticsadmin_gapic.yaml",
7677
grpc_service_config = "admin_grpc_service_config.json",
77-
service_yaml = "analyticsadmin.yaml",
78+
service_yaml = "analyticsadmin_v1alpha.yaml",
7879
test_deps = [
7980
":admin_java_grpc",
8081
],
@@ -134,7 +135,7 @@ go_gapic_library(
134135
grpc_service_config = "admin_grpc_service_config.json",
135136
importpath = "google.golang.org/google/analytics/admin/v1alpha;admin",
136137
metadata = True,
137-
service_yaml = "analyticsadmin.yaml",
138+
service_yaml = "analyticsadmin_v1alpha.yaml",
138139
transport = "grpc+rest",
139140
deps = [
140141
":admin_go_proto",
@@ -174,7 +175,7 @@ py_gapic_library(
174175
name = "admin_py_gapic",
175176
srcs = [":admin_proto"],
176177
grpc_service_config = "admin_grpc_service_config.json",
177-
service_yaml = "analyticsadmin.yaml",
178+
service_yaml = "analyticsadmin_v1alpha.yaml",
178179
deps = [
179180
],
180181
)
@@ -223,7 +224,7 @@ php_gapic_library(
223224
name = "admin_php_gapic",
224225
srcs = [":admin_proto_with_info"],
225226
grpc_service_config = "admin_grpc_service_config.json",
226-
service_yaml = "analyticsadmin.yaml",
227+
service_yaml = "analyticsadmin_v1alpha.yaml",
227228
deps = [
228229
":admin_php_grpc",
229230
":admin_php_proto",
@@ -256,7 +257,7 @@ nodejs_gapic_library(
256257
extra_protoc_parameters = ["metadata"],
257258
grpc_service_config = "admin_grpc_service_config.json",
258259
package = "google.analytics.admin.v1alpha",
259-
service_yaml = "analyticsadmin.yaml",
260+
service_yaml = "analyticsadmin_v1alpha.yaml",
260261
deps = [],
261262
)
262263

@@ -302,7 +303,7 @@ ruby_cloud_gapic_library(
302303
grpc_service_config = "admin_grpc_service_config.json",
303304
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.",
304305
ruby_cloud_title = "Google Analytics Admin V1alpha",
305-
service_yaml = "analyticsadmin.yaml",
306+
service_yaml = "analyticsadmin_v1alpha.yaml",
306307
deps = [
307308
":admin_ruby_grpc",
308309
":admin_ruby_proto",
@@ -346,7 +347,7 @@ csharp_gapic_library(
346347
srcs = [":admin_proto_with_info"],
347348
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
348349
grpc_service_config = "admin_grpc_service_config.json",
349-
service_yaml = "analyticsadmin.yaml",
350+
service_yaml = "analyticsadmin_v1alpha.yaml",
350351
deps = [
351352
":admin_csharp_grpc",
352353
":admin_csharp_proto",
Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.analytics.admin.v1alpha;
18+
19+
option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin";
20+
option java_multiple_files = true;
21+
option java_outer_classname = "AccessReportProto";
22+
option java_package = "com.google.analytics.admin.v1alpha";
23+
24+
// Dimensions are attributes of your data. For example, the dimension
25+
// `userEmail` indicates the email of the user that accessed reporting data.
26+
// Dimension values in report responses are strings.
27+
message AccessDimension {
28+
// The API name of the dimension. See [Data Access
29+
// Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema)
30+
// for the list of dimensions supported in this API.
31+
//
32+
// Dimensions are referenced by name in `dimensionFilter` and `orderBys`.
33+
string dimension_name = 1;
34+
}
35+
36+
// The quantitative measurements of a report. For example, the metric
37+
// `accessCount` is the total number of data access records.
38+
message AccessMetric {
39+
// The API name of the metric. See [Data Access
40+
// Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema)
41+
// for the list of metrics supported in this API.
42+
//
43+
// Metrics are referenced by name in `metricFilter` & `orderBys`.
44+
string metric_name = 1;
45+
}
46+
47+
// A contiguous range of days: startDate, startDate + 1, ..., endDate.
48+
message AccessDateRange {
49+
// The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot
50+
// be after `endDate`. The format `NdaysAgo`, `yesterday`, or `today` is also
51+
// accepted, and in that case, the date is inferred based on the current time
52+
// in the request's time zone.
53+
string start_date = 1;
54+
55+
// The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot
56+
// be before `startDate`. The format `NdaysAgo`, `yesterday`, or `today` is
57+
// also accepted, and in that case, the date is inferred based on the current
58+
// time in the request's time zone.
59+
string end_date = 2;
60+
}
61+
62+
// Expresses dimension or metric filters. The fields in the same expression need
63+
// to be either all dimensions or all metrics.
64+
message AccessFilterExpression {
65+
// Specify one type of filter expression for `FilterExpression`.
66+
oneof one_expression {
67+
// Each of the FilterExpressions in the and_group has an AND relationship.
68+
AccessFilterExpressionList and_group = 1;
69+
70+
// Each of the FilterExpressions in the or_group has an OR relationship.
71+
AccessFilterExpressionList or_group = 2;
72+
73+
// The FilterExpression is NOT of not_expression.
74+
AccessFilterExpression not_expression = 3;
75+
76+
// A primitive filter. In the same FilterExpression, all of the filter's
77+
// field names need to be either all dimensions or all metrics.
78+
AccessFilter access_filter = 4;
79+
}
80+
}
81+
82+
// A list of filter expressions.
83+
message AccessFilterExpressionList {
84+
// A list of filter expressions.
85+
repeated AccessFilterExpression expressions = 1;
86+
}
87+
88+
// An expression to filter dimension or metric values.
89+
message AccessFilter {
90+
// Specify one type of filter for `Filter`.
91+
oneof one_filter {
92+
// Strings related filter.
93+
AccessStringFilter string_filter = 2;
94+
95+
// A filter for in list values.
96+
AccessInListFilter in_list_filter = 3;
97+
98+
// A filter for numeric or date values.
99+
AccessNumericFilter numeric_filter = 4;
100+
101+
// A filter for two values.
102+
AccessBetweenFilter between_filter = 5;
103+
}
104+
105+
// The dimension name or metric name.
106+
string field_name = 1;
107+
}
108+
109+
// The filter for strings.
110+
message AccessStringFilter {
111+
// The match type of a string filter.
112+
enum MatchType {
113+
// Unspecified
114+
MATCH_TYPE_UNSPECIFIED = 0;
115+
116+
// Exact match of the string value.
117+
EXACT = 1;
118+
119+
// Begins with the string value.
120+
BEGINS_WITH = 2;
121+
122+
// Ends with the string value.
123+
ENDS_WITH = 3;
124+
125+
// Contains the string value.
126+
CONTAINS = 4;
127+
128+
// Full match for the regular expression with the string value.
129+
FULL_REGEXP = 5;
130+
131+
// Partial match for the regular expression with the string value.
132+
PARTIAL_REGEXP = 6;
133+
}
134+
135+
// The match type for this filter.
136+
MatchType match_type = 1;
137+
138+
// The string value used for the matching.
139+
string value = 2;
140+
141+
// If true, the string value is case sensitive.
142+
bool case_sensitive = 3;
143+
}
144+
145+
// The result needs to be in a list of string values.
146+
message AccessInListFilter {
147+
// The list of string values. Must be non-empty.
148+
repeated string values = 1;
149+
150+
// If true, the string value is case sensitive.
151+
bool case_sensitive = 2;
152+
}
153+
154+
// Filters for numeric or date values.
155+
message AccessNumericFilter {
156+
// The operation applied to a numeric filter.
157+
enum Operation {
158+
// Unspecified.
159+
OPERATION_UNSPECIFIED = 0;
160+
161+
// Equal
162+
EQUAL = 1;
163+
164+
// Less than
165+
LESS_THAN = 2;
166+
167+
// Less than or equal
168+
LESS_THAN_OR_EQUAL = 3;
169+
170+
// Greater than
171+
GREATER_THAN = 4;
172+
173+
// Greater than or equal
174+
GREATER_THAN_OR_EQUAL = 5;
175+
}
176+
177+
// The operation type for this filter.
178+
Operation operation = 1;
179+
180+
// A numeric value or a date value.
181+
NumericValue value = 2;
182+
}
183+
184+
// To express that the result needs to be between two numbers (inclusive).
185+
message AccessBetweenFilter {
186+
// Begins with this number.
187+
NumericValue from_value = 1;
188+
189+
// Ends with this number.
190+
NumericValue to_value = 2;
191+
}
192+
193+
// To represent a number.
194+
message NumericValue {
195+
// One of a numeric value
196+
oneof one_value {
197+
// Integer value
198+
int64 int64_value = 1;
199+
200+
// Double value
201+
double double_value = 2;
202+
}
203+
}
204+
205+
// Order bys define how rows will be sorted in the response. For example,
206+
// ordering rows by descending access count is one ordering, and ordering rows
207+
// by the country string is a different ordering.
208+
message AccessOrderBy {
209+
// Sorts by metric values.
210+
message MetricOrderBy {
211+
// A metric name in the request to order by.
212+
string metric_name = 1;
213+
}
214+
215+
// Sorts by dimension values.
216+
message DimensionOrderBy {
217+
// Rule to order the string dimension values by.
218+
enum OrderType {
219+
// Unspecified.
220+
ORDER_TYPE_UNSPECIFIED = 0;
221+
222+
// Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" <
223+
// "b" < "z".
224+
ALPHANUMERIC = 1;
225+
226+
// Case insensitive alphanumeric sort by lower case Unicode code point.
227+
// For example, "2" < "A" < "b" < "X" < "z".
228+
CASE_INSENSITIVE_ALPHANUMERIC = 2;
229+
230+
// Dimension values are converted to numbers before sorting. For example
231+
// in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" <
232+
// "25". Non-numeric dimension values all have equal ordering value below
233+
// all numeric values.
234+
NUMERIC = 3;
235+
}
236+
237+
// A dimension name in the request to order by.
238+
string dimension_name = 1;
239+
240+
// Controls the rule for dimension value ordering.
241+
OrderType order_type = 2;
242+
}
243+
244+
// Specify one type of order by for `OrderBy`.
245+
oneof one_order_by {
246+
// Sorts results by a metric's values.
247+
MetricOrderBy metric = 1;
248+
249+
// Sorts results by a dimension's values.
250+
DimensionOrderBy dimension = 2;
251+
}
252+
253+
// If true, sorts by descending order. If false or unspecified, sorts in
254+
// ascending order.
255+
bool desc = 3;
256+
}
257+
258+
// Describes a dimension column in the report. Dimensions requested in a report
259+
// produce column entries within rows and DimensionHeaders. However, dimensions
260+
// used exclusively within filters or expressions do not produce columns in a
261+
// report; correspondingly, those dimensions do not produce headers.
262+
message AccessDimensionHeader {
263+
// The dimension's name; for example 'userEmail'.
264+
string dimension_name = 1;
265+
}
266+
267+
// Describes a metric column in the report. Visible metrics requested in a
268+
// report produce column entries within rows and MetricHeaders. However,
269+
// metrics used exclusively within filters or expressions do not produce columns
270+
// in a report; correspondingly, those metrics do not produce headers.
271+
message AccessMetricHeader {
272+
// The metric's name; for example 'accessCount'.
273+
string metric_name = 1;
274+
}
275+
276+
// Access report data for each row.
277+
message AccessRow {
278+
// List of dimension values. These values are in the same order as specified
279+
// in the request.
280+
repeated AccessDimensionValue dimension_values = 1;
281+
282+
// List of metric values. These values are in the same order as specified
283+
// in the request.
284+
repeated AccessMetricValue metric_values = 2;
285+
}
286+
287+
// The value of a dimension.
288+
message AccessDimensionValue {
289+
// The dimension value. For example, this value may be 'France' for the
290+
// 'country' dimension.
291+
string value = 1;
292+
}
293+
294+
// The value of a metric.
295+
message AccessMetricValue {
296+
// The measurement value. For example, this value may be '13'.
297+
string value = 1;
298+
}
299+
300+
// Current state of all quotas for this Analytics property. If any quota for a
301+
// property is exhausted, all requests to that property will return Resource
302+
// Exhausted errors.
303+
message AccessQuota {
304+
// Properties can use 250,000 tokens per day. Most requests consume fewer than
305+
// 10 tokens.
306+
AccessQuotaStatus tokens_per_day = 1;
307+
308+
// Properties can use 50,000 tokens per hour. An API request consumes a single
309+
// number of tokens, and that number is deducted from both the hourly and
310+
// daily quotas.
311+
AccessQuotaStatus tokens_per_hour = 2;
312+
313+
// Properties can use up to 50 concurrent requests.
314+
AccessQuotaStatus concurrent_requests = 3;
315+
316+
// Properties and cloud project pairs can have up to 50 server errors per
317+
// hour.
318+
AccessQuotaStatus server_errors_per_project_per_hour = 4;
319+
}
320+
321+
// Current state for a particular quota group.
322+
message AccessQuotaStatus {
323+
// Quota consumed by this request.
324+
int32 consumed = 1;
325+
326+
// Quota remaining after this request.
327+
int32 remaining = 2;
328+
}

0 commit comments

Comments
 (0)