access_report.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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. syntax = "proto3";
  15. package google.analytics.admin.v1alpha;
  16. option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "AccessReportProto";
  19. option java_package = "com.google.analytics.admin.v1alpha";
  20. // Dimensions are attributes of your data. For example, the dimension
  21. // `userEmail` indicates the email of the user that accessed reporting data.
  22. // Dimension values in report responses are strings.
  23. message AccessDimension {
  24. // The API name of the dimension. See [Data Access
  25. // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema)
  26. // for the list of dimensions supported in this API.
  27. //
  28. // Dimensions are referenced by name in `dimensionFilter` and `orderBys`.
  29. string dimension_name = 1;
  30. }
  31. // The quantitative measurements of a report. For example, the metric
  32. // `accessCount` is the total number of data access records.
  33. message AccessMetric {
  34. // The API name of the metric. See [Data Access
  35. // Schema](https://developers.google.com/analytics/devguides/config/admin/v1/access-api-schema)
  36. // for the list of metrics supported in this API.
  37. //
  38. // Metrics are referenced by name in `metricFilter` & `orderBys`.
  39. string metric_name = 1;
  40. }
  41. // A contiguous range of days: startDate, startDate + 1, ..., endDate.
  42. message AccessDateRange {
  43. // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot
  44. // be after `endDate`. The format `NdaysAgo`, `yesterday`, or `today` is also
  45. // accepted, and in that case, the date is inferred based on the current time
  46. // in the request's time zone.
  47. string start_date = 1;
  48. // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot
  49. // be before `startDate`. The format `NdaysAgo`, `yesterday`, or `today` is
  50. // also accepted, and in that case, the date is inferred based on the current
  51. // time in the request's time zone.
  52. string end_date = 2;
  53. }
  54. // Expresses dimension or metric filters. The fields in the same expression need
  55. // to be either all dimensions or all metrics.
  56. message AccessFilterExpression {
  57. // Specify one type of filter expression for `FilterExpression`.
  58. oneof one_expression {
  59. // Each of the FilterExpressions in the and_group has an AND relationship.
  60. AccessFilterExpressionList and_group = 1;
  61. // Each of the FilterExpressions in the or_group has an OR relationship.
  62. AccessFilterExpressionList or_group = 2;
  63. // The FilterExpression is NOT of not_expression.
  64. AccessFilterExpression not_expression = 3;
  65. // A primitive filter. In the same FilterExpression, all of the filter's
  66. // field names need to be either all dimensions or all metrics.
  67. AccessFilter access_filter = 4;
  68. }
  69. }
  70. // A list of filter expressions.
  71. message AccessFilterExpressionList {
  72. // A list of filter expressions.
  73. repeated AccessFilterExpression expressions = 1;
  74. }
  75. // An expression to filter dimension or metric values.
  76. message AccessFilter {
  77. // Specify one type of filter for `Filter`.
  78. oneof one_filter {
  79. // Strings related filter.
  80. AccessStringFilter string_filter = 2;
  81. // A filter for in list values.
  82. AccessInListFilter in_list_filter = 3;
  83. // A filter for numeric or date values.
  84. AccessNumericFilter numeric_filter = 4;
  85. // A filter for two values.
  86. AccessBetweenFilter between_filter = 5;
  87. }
  88. // The dimension name or metric name.
  89. string field_name = 1;
  90. }
  91. // The filter for strings.
  92. message AccessStringFilter {
  93. // The match type of a string filter.
  94. enum MatchType {
  95. // Unspecified
  96. MATCH_TYPE_UNSPECIFIED = 0;
  97. // Exact match of the string value.
  98. EXACT = 1;
  99. // Begins with the string value.
  100. BEGINS_WITH = 2;
  101. // Ends with the string value.
  102. ENDS_WITH = 3;
  103. // Contains the string value.
  104. CONTAINS = 4;
  105. // Full match for the regular expression with the string value.
  106. FULL_REGEXP = 5;
  107. // Partial match for the regular expression with the string value.
  108. PARTIAL_REGEXP = 6;
  109. }
  110. // The match type for this filter.
  111. MatchType match_type = 1;
  112. // The string value used for the matching.
  113. string value = 2;
  114. // If true, the string value is case sensitive.
  115. bool case_sensitive = 3;
  116. }
  117. // The result needs to be in a list of string values.
  118. message AccessInListFilter {
  119. // The list of string values. Must be non-empty.
  120. repeated string values = 1;
  121. // If true, the string value is case sensitive.
  122. bool case_sensitive = 2;
  123. }
  124. // Filters for numeric or date values.
  125. message AccessNumericFilter {
  126. // The operation applied to a numeric filter.
  127. enum Operation {
  128. // Unspecified.
  129. OPERATION_UNSPECIFIED = 0;
  130. // Equal
  131. EQUAL = 1;
  132. // Less than
  133. LESS_THAN = 2;
  134. // Less than or equal
  135. LESS_THAN_OR_EQUAL = 3;
  136. // Greater than
  137. GREATER_THAN = 4;
  138. // Greater than or equal
  139. GREATER_THAN_OR_EQUAL = 5;
  140. }
  141. // The operation type for this filter.
  142. Operation operation = 1;
  143. // A numeric value or a date value.
  144. NumericValue value = 2;
  145. }
  146. // To express that the result needs to be between two numbers (inclusive).
  147. message AccessBetweenFilter {
  148. // Begins with this number.
  149. NumericValue from_value = 1;
  150. // Ends with this number.
  151. NumericValue to_value = 2;
  152. }
  153. // To represent a number.
  154. message NumericValue {
  155. // One of a numeric value
  156. oneof one_value {
  157. // Integer value
  158. int64 int64_value = 1;
  159. // Double value
  160. double double_value = 2;
  161. }
  162. }
  163. // Order bys define how rows will be sorted in the response. For example,
  164. // ordering rows by descending access count is one ordering, and ordering rows
  165. // by the country string is a different ordering.
  166. message AccessOrderBy {
  167. // Sorts by metric values.
  168. message MetricOrderBy {
  169. // A metric name in the request to order by.
  170. string metric_name = 1;
  171. }
  172. // Sorts by dimension values.
  173. message DimensionOrderBy {
  174. // Rule to order the string dimension values by.
  175. enum OrderType {
  176. // Unspecified.
  177. ORDER_TYPE_UNSPECIFIED = 0;
  178. // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" <
  179. // "b" < "z".
  180. ALPHANUMERIC = 1;
  181. // Case insensitive alphanumeric sort by lower case Unicode code point.
  182. // For example, "2" < "A" < "b" < "X" < "z".
  183. CASE_INSENSITIVE_ALPHANUMERIC = 2;
  184. // Dimension values are converted to numbers before sorting. For example
  185. // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" <
  186. // "25". Non-numeric dimension values all have equal ordering value below
  187. // all numeric values.
  188. NUMERIC = 3;
  189. }
  190. // A dimension name in the request to order by.
  191. string dimension_name = 1;
  192. // Controls the rule for dimension value ordering.
  193. OrderType order_type = 2;
  194. }
  195. // Specify one type of order by for `OrderBy`.
  196. oneof one_order_by {
  197. // Sorts results by a metric's values.
  198. MetricOrderBy metric = 1;
  199. // Sorts results by a dimension's values.
  200. DimensionOrderBy dimension = 2;
  201. }
  202. // If true, sorts by descending order. If false or unspecified, sorts in
  203. // ascending order.
  204. bool desc = 3;
  205. }
  206. // Describes a dimension column in the report. Dimensions requested in a report
  207. // produce column entries within rows and DimensionHeaders. However, dimensions
  208. // used exclusively within filters or expressions do not produce columns in a
  209. // report; correspondingly, those dimensions do not produce headers.
  210. message AccessDimensionHeader {
  211. // The dimension's name; for example 'userEmail'.
  212. string dimension_name = 1;
  213. }
  214. // Describes a metric column in the report. Visible metrics requested in a
  215. // report produce column entries within rows and MetricHeaders. However,
  216. // metrics used exclusively within filters or expressions do not produce columns
  217. // in a report; correspondingly, those metrics do not produce headers.
  218. message AccessMetricHeader {
  219. // The metric's name; for example 'accessCount'.
  220. string metric_name = 1;
  221. }
  222. // Access report data for each row.
  223. message AccessRow {
  224. // List of dimension values. These values are in the same order as specified
  225. // in the request.
  226. repeated AccessDimensionValue dimension_values = 1;
  227. // List of metric values. These values are in the same order as specified
  228. // in the request.
  229. repeated AccessMetricValue metric_values = 2;
  230. }
  231. // The value of a dimension.
  232. message AccessDimensionValue {
  233. // The dimension value. For example, this value may be 'France' for the
  234. // 'country' dimension.
  235. string value = 1;
  236. }
  237. // The value of a metric.
  238. message AccessMetricValue {
  239. // The measurement value. For example, this value may be '13'.
  240. string value = 1;
  241. }
  242. // Current state of all quotas for this Analytics property. If any quota for a
  243. // property is exhausted, all requests to that property will return Resource
  244. // Exhausted errors.
  245. message AccessQuota {
  246. // Properties can use 250,000 tokens per day. Most requests consume fewer than
  247. // 10 tokens.
  248. AccessQuotaStatus tokens_per_day = 1;
  249. // Properties can use 50,000 tokens per hour. An API request consumes a single
  250. // number of tokens, and that number is deducted from both the hourly and
  251. // daily quotas.
  252. AccessQuotaStatus tokens_per_hour = 2;
  253. // Properties can use up to 50 concurrent requests.
  254. AccessQuotaStatus concurrent_requests = 3;
  255. // Properties and cloud project pairs can have up to 50 server errors per
  256. // hour.
  257. AccessQuotaStatus server_errors_per_project_per_hour = 4;
  258. }
  259. // Current state for a particular quota group.
  260. message AccessQuotaStatus {
  261. // Quota consumed by this request.
  262. int32 consumed = 1;
  263. // Quota remaining after this request.
  264. int32 remaining = 2;
  265. }