google-api-client 0.9.28 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -4
  3. data/CHANGELOG.md +10 -0
  4. data/api_names.yaml +36512 -36326
  5. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  6. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +41 -41
  7. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +13 -13
  8. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +110 -110
  9. data/generated/google/apis/adsense_v1_4.rb +1 -1
  10. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  11. data/generated/google/apis/analyticsreporting_v4.rb +3 -3
  12. data/generated/google/apis/analyticsreporting_v4/classes.rb +845 -845
  13. data/generated/google/apis/analyticsreporting_v4/representations.rb +184 -184
  14. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  15. data/generated/google/apis/androidenterprise_v1/classes.rb +5 -5
  16. data/generated/google/apis/androidenterprise_v1/service.rb +3 -1
  17. data/generated/google/apis/appstate_v1.rb +1 -1
  18. data/generated/google/apis/calendar_v3.rb +1 -1
  19. data/generated/google/apis/classroom_v1.rb +22 -25
  20. data/generated/google/apis/classroom_v1/classes.rb +998 -907
  21. data/generated/google/apis/classroom_v1/representations.rb +240 -240
  22. data/generated/google/apis/classroom_v1/service.rb +1269 -1061
  23. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  24. data/generated/google/apis/cloudbuild_v1/classes.rb +322 -322
  25. data/generated/google/apis/cloudbuild_v1/representations.rb +88 -88
  26. data/generated/google/apis/cloudbuild_v1/service.rb +57 -57
  27. data/generated/google/apis/clouddebugger_v2.rb +4 -4
  28. data/generated/google/apis/clouddebugger_v2/classes.rb +311 -311
  29. data/generated/google/apis/clouddebugger_v2/representations.rb +92 -92
  30. data/generated/google/apis/clouddebugger_v2/service.rb +41 -41
  31. data/generated/google/apis/cloudkms_v1beta1.rb +1 -1
  32. data/generated/google/apis/cloudkms_v1beta1/classes.rb +611 -611
  33. data/generated/google/apis/cloudkms_v1beta1/representations.rb +124 -124
  34. data/generated/google/apis/cloudkms_v1beta1/service.rb +254 -248
  35. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  36. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +116 -116
  37. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +28 -28
  38. data/generated/google/apis/cloudresourcemanager_v1/service.rb +257 -257
  39. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +4 -4
  40. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +394 -394
  41. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +79 -79
  42. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +269 -269
  43. data/generated/google/apis/cloudtrace_v1.rb +8 -8
  44. data/generated/google/apis/cloudtrace_v1/classes.rb +90 -84
  45. data/generated/google/apis/cloudtrace_v1/representations.rb +22 -22
  46. data/generated/google/apis/cloudtrace_v1/service.rb +40 -35
  47. data/generated/google/apis/compute_beta.rb +1 -1
  48. data/generated/google/apis/compute_beta/classes.rb +406 -31
  49. data/generated/google/apis/compute_beta/representations.rb +154 -0
  50. data/generated/google/apis/compute_beta/service.rb +262 -9
  51. data/generated/google/apis/compute_v1.rb +1 -1
  52. data/generated/google/apis/compute_v1/classes.rb +17 -20
  53. data/generated/google/apis/content_v2.rb +1 -1
  54. data/generated/google/apis/dataflow_v1b3.rb +1 -1
  55. data/generated/google/apis/dataflow_v1b3/classes.rb +3226 -2847
  56. data/generated/google/apis/dataflow_v1b3/representations.rb +825 -677
  57. data/generated/google/apis/dataflow_v1b3/service.rb +175 -175
  58. data/generated/google/apis/dataproc_v1.rb +2 -2
  59. data/generated/google/apis/dataproc_v1/classes.rb +1213 -1136
  60. data/generated/google/apis/dataproc_v1/representations.rb +262 -244
  61. data/generated/google/apis/dataproc_v1/service.rb +298 -243
  62. data/generated/google/apis/datastore_v1.rb +4 -4
  63. data/generated/google/apis/datastore_v1/classes.rb +728 -728
  64. data/generated/google/apis/datastore_v1/representations.rb +167 -167
  65. data/generated/google/apis/datastore_v1/service.rb +68 -68
  66. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  67. data/generated/google/apis/drive_v2.rb +1 -1
  68. data/generated/google/apis/drive_v3.rb +1 -1
  69. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  70. data/generated/google/apis/games_management_v1management.rb +1 -1
  71. data/generated/google/apis/games_v1.rb +1 -1
  72. data/generated/google/apis/genomics_v1.rb +7 -7
  73. data/generated/google/apis/genomics_v1/classes.rb +932 -932
  74. data/generated/google/apis/genomics_v1/representations.rb +205 -205
  75. data/generated/google/apis/genomics_v1/service.rb +1228 -1228
  76. data/generated/google/apis/gmail_v1.rb +1 -1
  77. data/generated/google/apis/iam_v1/classes.rb +440 -440
  78. data/generated/google/apis/iam_v1/representations.rb +94 -94
  79. data/generated/google/apis/iam_v1/service.rb +60 -60
  80. data/generated/google/apis/identitytoolkit_v3.rb +1 -1
  81. data/generated/google/apis/identitytoolkit_v3/classes.rb +21 -1
  82. data/generated/google/apis/identitytoolkit_v3/representations.rb +3 -0
  83. data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
  84. data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
  85. data/generated/google/apis/kgsearch_v1/service.rb +21 -21
  86. data/generated/google/apis/language_v1beta1.rb +1 -1
  87. data/generated/google/apis/language_v1beta1/classes.rb +232 -232
  88. data/generated/google/apis/language_v1beta1/representations.rb +75 -75
  89. data/generated/google/apis/logging_v2beta1.rb +1 -1
  90. data/generated/google/apis/logging_v2beta1/classes.rb +345 -337
  91. data/generated/google/apis/logging_v2beta1/representations.rb +55 -55
  92. data/generated/google/apis/logging_v2beta1/service.rb +331 -306
  93. data/generated/google/apis/monitoring_v3.rb +1 -1
  94. data/generated/google/apis/monitoring_v3/classes.rb +253 -253
  95. data/generated/google/apis/monitoring_v3/representations.rb +58 -58
  96. data/generated/google/apis/monitoring_v3/service.rb +135 -135
  97. data/generated/google/apis/people_v1.rb +15 -16
  98. data/generated/google/apis/people_v1/classes.rb +985 -855
  99. data/generated/google/apis/people_v1/representations.rb +227 -220
  100. data/generated/google/apis/people_v1/service.rb +58 -52
  101. data/generated/google/apis/plus_domains_v1.rb +1 -1
  102. data/generated/google/apis/plus_v1.rb +1 -1
  103. data/generated/google/apis/pubsub_v1.rb +1 -1
  104. data/generated/google/apis/pubsub_v1/classes.rb +257 -257
  105. data/generated/google/apis/pubsub_v1/representations.rb +83 -83
  106. data/generated/google/apis/pubsub_v1/service.rb +390 -390
  107. data/generated/google/apis/script_v1.rb +17 -17
  108. data/generated/google/apis/script_v1/classes.rb +149 -141
  109. data/generated/google/apis/script_v1/representations.rb +26 -27
  110. data/generated/google/apis/script_v1/service.rb +9 -8
  111. data/generated/google/apis/sheets_v4.rb +1 -1
  112. data/generated/google/apis/sheets_v4/classes.rb +4223 -4188
  113. data/generated/google/apis/sheets_v4/representations.rb +850 -834
  114. data/generated/google/apis/sheets_v4/service.rb +192 -192
  115. data/generated/google/apis/slides_v1.rb +1 -1
  116. data/generated/google/apis/slides_v1/classes.rb +927 -800
  117. data/generated/google/apis/slides_v1/representations.rb +253 -211
  118. data/generated/google/apis/speech_v1beta1.rb +1 -1
  119. data/generated/google/apis/speech_v1beta1/classes.rb +94 -107
  120. data/generated/google/apis/speech_v1beta1/representations.rb +24 -36
  121. data/generated/google/apis/speech_v1beta1/service.rb +51 -54
  122. data/generated/google/apis/storage_v1.rb +1 -1
  123. data/generated/google/apis/vision_v1.rb +1 -1
  124. data/generated/google/apis/vision_v1/classes.rb +888 -885
  125. data/generated/google/apis/vision_v1/representations.rb +139 -139
  126. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  127. data/generated/google/apis/youtube_analytics_v1/service.rb +5 -1
  128. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  129. data/generated/google/apis/youtubereporting_v1.rb +1 -1
  130. data/generated/google/apis/youtubereporting_v1/classes.rb +80 -80
  131. data/generated/google/apis/youtubereporting_v1/representations.rb +23 -23
  132. data/generated/google/apis/youtubereporting_v1/service.rb +51 -51
  133. data/google-api-client.gemspec +2 -2
  134. data/lib/google/apis/core/api_command.rb +1 -1
  135. data/lib/google/apis/core/json_representation.rb +2 -2
  136. data/lib/google/apis/version.rb +1 -1
  137. data/samples/cli/lib/samples/you_tube.rb +4 -1
  138. metadata +36 -30
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://developers.google.com/adsense/management/
26
26
  module AdsenseV1_4
27
27
  VERSION = 'V1_4'
28
- REVISION = '20170201'
28
+ REVISION = '20170202'
29
29
 
30
30
  # View and manage your AdSense data
31
31
  AUTH_ADSENSE = 'https://www.googleapis.com/auth/adsense'
@@ -26,7 +26,7 @@ module Google
26
26
  # @see https://developers.google.com/adsense/host/
27
27
  module AdsensehostV4_1
28
28
  VERSION = 'V4_1'
29
- REVISION = '20170201'
29
+ REVISION = '20170202'
30
30
 
31
31
  # View and manage your AdSense host data and associated accounts
32
32
  AUTH_ADSENSEHOST = 'https://www.googleapis.com/auth/adsensehost'
@@ -27,11 +27,11 @@ module Google
27
27
  VERSION = 'V4'
28
28
  REVISION = '20161129'
29
29
 
30
- # View your Google Analytics data
31
- AUTH_ANALYTICS_READONLY = 'https://www.googleapis.com/auth/analytics.readonly'
32
-
33
30
  # View and manage your Google Analytics data
34
31
  AUTH_ANALYTICS = 'https://www.googleapis.com/auth/analytics'
32
+
33
+ # View your Google Analytics data
34
+ AUTH_ANALYTICS_READONLY = 'https://www.googleapis.com/auth/analytics.readonly'
35
35
  end
36
36
  end
37
37
  end
@@ -22,19 +22,40 @@ module Google
22
22
  module Apis
23
23
  module AnalyticsreportingV4
24
24
 
25
- # The headers for each of the pivot sections defined in the request.
26
- class PivotHeader
25
+ # Dimension filter specifies the filtering options on a dimension.
26
+ class DimensionFilter
27
27
  include Google::Apis::Core::Hashable
28
28
 
29
- # The total number of groups for this pivot.
30
- # Corresponds to the JSON property `totalPivotGroupsCount`
31
- # @return [Fixnum]
32
- attr_accessor :total_pivot_groups_count
29
+ # Should the match be case sensitive? Default is false.
30
+ # Corresponds to the JSON property `caseSensitive`
31
+ # @return [Boolean]
32
+ attr_accessor :case_sensitive
33
+ alias_method :case_sensitive?, :case_sensitive
33
34
 
34
- # A single pivot section header.
35
- # Corresponds to the JSON property `pivotHeaderEntries`
36
- # @return [Array<Google::Apis::AnalyticsreportingV4::PivotHeaderEntry>]
37
- attr_accessor :pivot_header_entries
35
+ # The dimension to filter on. A DimensionFilter must contain a dimension.
36
+ # Corresponds to the JSON property `dimensionName`
37
+ # @return [String]
38
+ attr_accessor :dimension_name
39
+
40
+ # How to match the dimension to the expression. The default is REGEXP.
41
+ # Corresponds to the JSON property `operator`
42
+ # @return [String]
43
+ attr_accessor :operator
44
+
45
+ # Logical `NOT` operator. If this boolean is set to true, then the matching
46
+ # dimension values will be excluded in the report. The default is false.
47
+ # Corresponds to the JSON property `not`
48
+ # @return [Boolean]
49
+ attr_accessor :not
50
+ alias_method :not?, :not
51
+
52
+ # Strings or regular expression to match against. Only the first value of
53
+ # the list is used for comparison unless the operator is `IN_LIST`.
54
+ # If `IN_LIST` operator, then the entire list is used to filter the
55
+ # dimensions as explained in the description of the `IN_LIST` operator.
56
+ # Corresponds to the JSON property `expressions`
57
+ # @return [Array<String>]
58
+ attr_accessor :expressions
38
59
 
39
60
  def initialize(**args)
40
61
  update!(**args)
@@ -42,43 +63,30 @@ module Google
42
63
 
43
64
  # Update properties of this object
44
65
  def update!(**args)
45
- @total_pivot_groups_count = args[:total_pivot_groups_count] if args.key?(:total_pivot_groups_count)
46
- @pivot_header_entries = args[:pivot_header_entries] if args.key?(:pivot_header_entries)
66
+ @case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)
67
+ @dimension_name = args[:dimension_name] if args.key?(:dimension_name)
68
+ @operator = args[:operator] if args.key?(:operator)
69
+ @not = args[:not] if args.key?(:not)
70
+ @expressions = args[:expressions] if args.key?(:expressions)
47
71
  end
48
72
  end
49
73
 
50
- # [Metrics](https://support.google.com/analytics/answer/1033861)
51
- # are the quantitative measurements. For example, the metric `ga:users`
52
- # indicates the total number of users for the requested time period.
53
- class Metric
74
+ # The segment definition, if the report needs to be segmented.
75
+ # A Segment is a subset of the Analytics data. For example, of the entire
76
+ # set of users, one Segment might be users from a particular country or city.
77
+ class Segment
54
78
  include Google::Apis::Core::Hashable
55
79
 
56
- # An alias for the metric expression is an alternate name for the
57
- # expression. The alias can be used for filtering and sorting. This field
58
- # is optional and is useful if the expression is not a single metric but
59
- # a complex expression which cannot be used in filtering and sorting.
60
- # The alias is also used in the response column header.
61
- # Corresponds to the JSON property `alias`
62
- # @return [String]
63
- attr_accessor :alias
64
-
65
- # Specifies how the metric expression should be formatted, for example
66
- # `INTEGER`.
67
- # Corresponds to the JSON property `formattingType`
68
- # @return [String]
69
- attr_accessor :formatting_type
80
+ # Dynamic segment definition for defining the segment within the request.
81
+ # A segment can select users, sessions or both.
82
+ # Corresponds to the JSON property `dynamicSegment`
83
+ # @return [Google::Apis::AnalyticsreportingV4::DynamicSegment]
84
+ attr_accessor :dynamic_segment
70
85
 
71
- # A metric expression in the request. An expression is constructed from one
72
- # or more metrics and numbers. Accepted operators include: Plus (+), Minus
73
- # (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis,
74
- # Positive cardinal numbers (0-9), can include decimals and is limited to
75
- # 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the
76
- # metric expression is just a single metric name like `ga:users`.
77
- # Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics
78
- # will result in unexpected results.
79
- # Corresponds to the JSON property `expression`
86
+ # The segment ID of a built-in or custom segment, for example `gaid::-3`.
87
+ # Corresponds to the JSON property `segmentId`
80
88
  # @return [String]
81
- attr_accessor :expression
89
+ attr_accessor :segment_id
82
90
 
83
91
  def initialize(**args)
84
92
  update!(**args)
@@ -86,25 +94,32 @@ module Google
86
94
 
87
95
  # Update properties of this object
88
96
  def update!(**args)
89
- @alias = args[:alias] if args.key?(:alias)
90
- @formatting_type = args[:formatting_type] if args.key?(:formatting_type)
91
- @expression = args[:expression] if args.key?(:expression)
97
+ @dynamic_segment = args[:dynamic_segment] if args.key?(:dynamic_segment)
98
+ @segment_id = args[:segment_id] if args.key?(:segment_id)
92
99
  end
93
100
  end
94
101
 
95
- # Column headers.
96
- class ColumnHeader
102
+ # Specifies the sorting options.
103
+ class OrderBy
97
104
  include Google::Apis::Core::Hashable
98
105
 
99
- # The dimension names in the response.
100
- # Corresponds to the JSON property `dimensions`
101
- # @return [Array<String>]
102
- attr_accessor :dimensions
106
+ # The field which to sort by. The default sort order is ascending. Example:
107
+ # `ga:browser`.
108
+ # Note, that you can only specify one field for sort here. For example,
109
+ # `ga:browser, ga:city` is not valid.
110
+ # Corresponds to the JSON property `fieldName`
111
+ # @return [String]
112
+ attr_accessor :field_name
103
113
 
104
- # The headers for the metrics.
105
- # Corresponds to the JSON property `metricHeader`
106
- # @return [Google::Apis::AnalyticsreportingV4::MetricHeader]
107
- attr_accessor :metric_header
114
+ # The order type. The default orderType is `VALUE`.
115
+ # Corresponds to the JSON property `orderType`
116
+ # @return [String]
117
+ attr_accessor :order_type
118
+
119
+ # The sorting order for the field.
120
+ # Corresponds to the JSON property `sortOrder`
121
+ # @return [String]
122
+ attr_accessor :sort_order
108
123
 
109
124
  def initialize(**args)
110
125
  update!(**args)
@@ -112,32 +127,46 @@ module Google
112
127
 
113
128
  # Update properties of this object
114
129
  def update!(**args)
115
- @dimensions = args[:dimensions] if args.key?(:dimensions)
116
- @metric_header = args[:metric_header] if args.key?(:metric_header)
130
+ @field_name = args[:field_name] if args.key?(:field_name)
131
+ @order_type = args[:order_type] if args.key?(:order_type)
132
+ @sort_order = args[:sort_order] if args.key?(:sort_order)
117
133
  end
118
134
  end
119
135
 
120
- # Dynamic segment definition for defining the segment within the request.
121
- # A segment can select users, sessions or both.
122
- class DynamicSegment
136
+ # Dimension filter specifies the filtering options on a dimension.
137
+ class SegmentDimensionFilter
123
138
  include Google::Apis::Core::Hashable
124
139
 
125
- # SegmentDefinition defines the segment to be a set of SegmentFilters which
126
- # are combined together with a logical `AND` operation.
127
- # Corresponds to the JSON property `sessionSegment`
128
- # @return [Google::Apis::AnalyticsreportingV4::SegmentDefinition]
129
- attr_accessor :session_segment
140
+ # Maximum comparison values for `BETWEEN` match type.
141
+ # Corresponds to the JSON property `maxComparisonValue`
142
+ # @return [String]
143
+ attr_accessor :max_comparison_value
130
144
 
131
- # The name of the dynamic segment.
132
- # Corresponds to the JSON property `name`
145
+ # Name of the dimension for which the filter is being applied.
146
+ # Corresponds to the JSON property `dimensionName`
133
147
  # @return [String]
134
- attr_accessor :name
148
+ attr_accessor :dimension_name
135
149
 
136
- # SegmentDefinition defines the segment to be a set of SegmentFilters which
137
- # are combined together with a logical `AND` operation.
138
- # Corresponds to the JSON property `userSegment`
139
- # @return [Google::Apis::AnalyticsreportingV4::SegmentDefinition]
140
- attr_accessor :user_segment
150
+ # The operator to use to match the dimension with the expressions.
151
+ # Corresponds to the JSON property `operator`
152
+ # @return [String]
153
+ attr_accessor :operator
154
+
155
+ # The list of expressions, only the first element is used for all operators
156
+ # Corresponds to the JSON property `expressions`
157
+ # @return [Array<String>]
158
+ attr_accessor :expressions
159
+
160
+ # Should the match be case sensitive, ignored for `IN_LIST` operator.
161
+ # Corresponds to the JSON property `caseSensitive`
162
+ # @return [Boolean]
163
+ attr_accessor :case_sensitive
164
+ alias_method :case_sensitive?, :case_sensitive
165
+
166
+ # Minimum comparison values for `BETWEEN` match type.
167
+ # Corresponds to the JSON property `minComparisonValue`
168
+ # @return [String]
169
+ attr_accessor :min_comparison_value
141
170
 
142
171
  def initialize(**args)
143
172
  update!(**args)
@@ -145,25 +174,30 @@ module Google
145
174
 
146
175
  # Update properties of this object
147
176
  def update!(**args)
148
- @session_segment = args[:session_segment] if args.key?(:session_segment)
149
- @name = args[:name] if args.key?(:name)
150
- @user_segment = args[:user_segment] if args.key?(:user_segment)
177
+ @max_comparison_value = args[:max_comparison_value] if args.key?(:max_comparison_value)
178
+ @dimension_name = args[:dimension_name] if args.key?(:dimension_name)
179
+ @operator = args[:operator] if args.key?(:operator)
180
+ @expressions = args[:expressions] if args.key?(:expressions)
181
+ @case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)
182
+ @min_comparison_value = args[:min_comparison_value] if args.key?(:min_comparison_value)
151
183
  end
152
184
  end
153
185
 
154
- # The headers for the metrics.
155
- class MetricHeader
186
+ # A segment sequence definition.
187
+ class SegmentSequenceStep
156
188
  include Google::Apis::Core::Hashable
157
189
 
158
- # Headers for the metrics in the response.
159
- # Corresponds to the JSON property `metricHeaderEntries`
160
- # @return [Array<Google::Apis::AnalyticsreportingV4::MetricHeaderEntry>]
161
- attr_accessor :metric_header_entries
190
+ # A sequence is specified with a list of Or grouped filters which are
191
+ # combined with `AND` operator.
192
+ # Corresponds to the JSON property `orFiltersForSegment`
193
+ # @return [Array<Google::Apis::AnalyticsreportingV4::OrFiltersForSegment>]
194
+ attr_accessor :or_filters_for_segment
162
195
 
163
- # Headers for the pivots in the response.
164
- # Corresponds to the JSON property `pivotHeaders`
165
- # @return [Array<Google::Apis::AnalyticsreportingV4::PivotHeader>]
166
- attr_accessor :pivot_headers
196
+ # Specifies if the step immediately precedes or can be any time before the
197
+ # next step.
198
+ # Corresponds to the JSON property `matchType`
199
+ # @return [String]
200
+ attr_accessor :match_type
167
201
 
168
202
  def initialize(**args)
169
203
  update!(**args)
@@ -171,29 +205,43 @@ module Google
171
205
 
172
206
  # Update properties of this object
173
207
  def update!(**args)
174
- @metric_header_entries = args[:metric_header_entries] if args.key?(:metric_header_entries)
175
- @pivot_headers = args[:pivot_headers] if args.key?(:pivot_headers)
208
+ @or_filters_for_segment = args[:or_filters_for_segment] if args.key?(:or_filters_for_segment)
209
+ @match_type = args[:match_type] if args.key?(:match_type)
176
210
  end
177
211
  end
178
212
 
179
- # The data response corresponding to the request.
180
- class Report
213
+ # [Metrics](https://support.google.com/analytics/answer/1033861)
214
+ # are the quantitative measurements. For example, the metric `ga:users`
215
+ # indicates the total number of users for the requested time period.
216
+ class Metric
181
217
  include Google::Apis::Core::Hashable
182
218
 
183
- # Column headers.
184
- # Corresponds to the JSON property `columnHeader`
185
- # @return [Google::Apis::AnalyticsreportingV4::ColumnHeader]
186
- attr_accessor :column_header
219
+ # Specifies how the metric expression should be formatted, for example
220
+ # `INTEGER`.
221
+ # Corresponds to the JSON property `formattingType`
222
+ # @return [String]
223
+ attr_accessor :formatting_type
187
224
 
188
- # The data part of the report.
189
- # Corresponds to the JSON property `data`
190
- # @return [Google::Apis::AnalyticsreportingV4::ReportData]
191
- attr_accessor :data
225
+ # An alias for the metric expression is an alternate name for the
226
+ # expression. The alias can be used for filtering and sorting. This field
227
+ # is optional and is useful if the expression is not a single metric but
228
+ # a complex expression which cannot be used in filtering and sorting.
229
+ # The alias is also used in the response column header.
230
+ # Corresponds to the JSON property `alias`
231
+ # @return [String]
232
+ attr_accessor :alias
192
233
 
193
- # Page token to retrieve the next page of results in the list.
194
- # Corresponds to the JSON property `nextPageToken`
234
+ # A metric expression in the request. An expression is constructed from one
235
+ # or more metrics and numbers. Accepted operators include: Plus (+), Minus
236
+ # (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis,
237
+ # Positive cardinal numbers (0-9), can include decimals and is limited to
238
+ # 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the
239
+ # metric expression is just a single metric name like `ga:users`.
240
+ # Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics
241
+ # will result in unexpected results.
242
+ # Corresponds to the JSON property `expression`
195
243
  # @return [String]
196
- attr_accessor :next_page_token
244
+ attr_accessor :expression
197
245
 
198
246
  def initialize(**args)
199
247
  update!(**args)
@@ -201,32 +249,20 @@ module Google
201
249
 
202
250
  # Update properties of this object
203
251
  def update!(**args)
204
- @column_header = args[:column_header] if args.key?(:column_header)
205
- @data = args[:data] if args.key?(:data)
206
- @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
252
+ @formatting_type = args[:formatting_type] if args.key?(:formatting_type)
253
+ @alias = args[:alias] if args.key?(:alias)
254
+ @expression = args[:expression] if args.key?(:expression)
207
255
  end
208
256
  end
209
257
 
210
- # Filter Clause to be used in a segment definition, can be wither a metric or
211
- # a dimension filter.
212
- class SegmentFilterClause
213
- include Google::Apis::Core::Hashable
214
-
215
- # Dimension filter specifies the filtering options on a dimension.
216
- # Corresponds to the JSON property `dimensionFilter`
217
- # @return [Google::Apis::AnalyticsreportingV4::SegmentDimensionFilter]
218
- attr_accessor :dimension_filter
219
-
220
- # Metric filter to be used in a segment filter clause.
221
- # Corresponds to the JSON property `metricFilter`
222
- # @return [Google::Apis::AnalyticsreportingV4::SegmentMetricFilter]
223
- attr_accessor :metric_filter
258
+ # The metric values in the pivot region.
259
+ class PivotValueRegion
260
+ include Google::Apis::Core::Hashable
224
261
 
225
- # Matches the complement (`!`) of the filter.
226
- # Corresponds to the JSON property `not`
227
- # @return [Boolean]
228
- attr_accessor :not
229
- alias_method :not?, :not
262
+ # The values of the metrics in each of the pivot regions.
263
+ # Corresponds to the JSON property `values`
264
+ # @return [Array<String>]
265
+ attr_accessor :values
230
266
 
231
267
  def initialize(**args)
232
268
  update!(**args)
@@ -234,46 +270,54 @@ module Google
234
270
 
235
271
  # Update properties of this object
236
272
  def update!(**args)
237
- @dimension_filter = args[:dimension_filter] if args.key?(:dimension_filter)
238
- @metric_filter = args[:metric_filter] if args.key?(:metric_filter)
239
- @not = args[:not] if args.key?(:not)
273
+ @values = args[:values] if args.key?(:values)
240
274
  end
241
275
  end
242
276
 
243
- # Dimension filter specifies the filtering options on a dimension.
244
- class DimensionFilter
277
+ # The data response corresponding to the request.
278
+ class Report
245
279
  include Google::Apis::Core::Hashable
246
280
 
247
- # The dimension to filter on. A DimensionFilter must contain a dimension.
248
- # Corresponds to the JSON property `dimensionName`
249
- # @return [String]
250
- attr_accessor :dimension_name
281
+ # The data part of the report.
282
+ # Corresponds to the JSON property `data`
283
+ # @return [Google::Apis::AnalyticsreportingV4::ReportData]
284
+ attr_accessor :data
251
285
 
252
- # How to match the dimension to the expression. The default is REGEXP.
253
- # Corresponds to the JSON property `operator`
286
+ # Page token to retrieve the next page of results in the list.
287
+ # Corresponds to the JSON property `nextPageToken`
254
288
  # @return [String]
255
- attr_accessor :operator
289
+ attr_accessor :next_page_token
256
290
 
257
- # Should the match be case sensitive? Default is false.
258
- # Corresponds to the JSON property `caseSensitive`
259
- # @return [Boolean]
260
- attr_accessor :case_sensitive
261
- alias_method :case_sensitive?, :case_sensitive
291
+ # Column headers.
292
+ # Corresponds to the JSON property `columnHeader`
293
+ # @return [Google::Apis::AnalyticsreportingV4::ColumnHeader]
294
+ attr_accessor :column_header
262
295
 
263
- # Strings or regular expression to match against. Only the first value of
264
- # the list is used for comparison unless the operator is `IN_LIST`.
265
- # If `IN_LIST` operator, then the entire list is used to filter the
266
- # dimensions as explained in the description of the `IN_LIST` operator.
267
- # Corresponds to the JSON property `expressions`
268
- # @return [Array<String>]
269
- attr_accessor :expressions
296
+ def initialize(**args)
297
+ update!(**args)
298
+ end
270
299
 
271
- # Logical `NOT` operator. If this boolean is set to true, then the matching
272
- # dimension values will be excluded in the report. The default is false.
273
- # Corresponds to the JSON property `not`
274
- # @return [Boolean]
275
- attr_accessor :not
276
- alias_method :not?, :not
300
+ # Update properties of this object
301
+ def update!(**args)
302
+ @data = args[:data] if args.key?(:data)
303
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
304
+ @column_header = args[:column_header] if args.key?(:column_header)
305
+ end
306
+ end
307
+
308
+ # The headers for each of the pivot sections defined in the request.
309
+ class PivotHeader
310
+ include Google::Apis::Core::Hashable
311
+
312
+ # A single pivot section header.
313
+ # Corresponds to the JSON property `pivotHeaderEntries`
314
+ # @return [Array<Google::Apis::AnalyticsreportingV4::PivotHeaderEntry>]
315
+ attr_accessor :pivot_header_entries
316
+
317
+ # The total number of groups for this pivot.
318
+ # Corresponds to the JSON property `totalPivotGroupsCount`
319
+ # @return [Fixnum]
320
+ attr_accessor :total_pivot_groups_count
277
321
 
278
322
  def initialize(**args)
279
323
  update!(**args)
@@ -281,48 +325,68 @@ module Google
281
325
 
282
326
  # Update properties of this object
283
327
  def update!(**args)
284
- @dimension_name = args[:dimension_name] if args.key?(:dimension_name)
285
- @operator = args[:operator] if args.key?(:operator)
286
- @case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)
287
- @expressions = args[:expressions] if args.key?(:expressions)
288
- @not = args[:not] if args.key?(:not)
328
+ @pivot_header_entries = args[:pivot_header_entries] if args.key?(:pivot_header_entries)
329
+ @total_pivot_groups_count = args[:total_pivot_groups_count] if args.key?(:total_pivot_groups_count)
289
330
  end
290
331
  end
291
332
 
292
- # Dimension filter specifies the filtering options on a dimension.
293
- class SegmentDimensionFilter
333
+ # A contiguous set of days: startDate, startDate + 1 day, ..., endDate.
334
+ # The start and end dates are specified in
335
+ # [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`.
336
+ class DateRange
294
337
  include Google::Apis::Core::Hashable
295
338
 
296
- # Maximum comparison values for `BETWEEN` match type.
297
- # Corresponds to the JSON property `maxComparisonValue`
339
+ # The end date for the query in the format `YYYY-MM-DD`.
340
+ # Corresponds to the JSON property `endDate`
298
341
  # @return [String]
299
- attr_accessor :max_comparison_value
342
+ attr_accessor :end_date
300
343
 
301
- # Name of the dimension for which the filter is being applied.
302
- # Corresponds to the JSON property `dimensionName`
344
+ # The start date for the query in the format `YYYY-MM-DD`.
345
+ # Corresponds to the JSON property `startDate`
303
346
  # @return [String]
304
- attr_accessor :dimension_name
347
+ attr_accessor :start_date
305
348
 
306
- # Should the match be case sensitive, ignored for `IN_LIST` operator.
307
- # Corresponds to the JSON property `caseSensitive`
308
- # @return [Boolean]
309
- attr_accessor :case_sensitive
310
- alias_method :case_sensitive?, :case_sensitive
349
+ def initialize(**args)
350
+ update!(**args)
351
+ end
311
352
 
312
- # The operator to use to match the dimension with the expressions.
313
- # Corresponds to the JSON property `operator`
353
+ # Update properties of this object
354
+ def update!(**args)
355
+ @end_date = args[:end_date] if args.key?(:end_date)
356
+ @start_date = args[:start_date] if args.key?(:start_date)
357
+ end
358
+ end
359
+
360
+ # MetricFilter specifies the filter on a metric.
361
+ class MetricFilter
362
+ include Google::Apis::Core::Hashable
363
+
364
+ # The metric that will be filtered on. A metricFilter must contain a metric
365
+ # name. A metric name can be an alias earlier defined as a metric or it can
366
+ # also be a metric expression.
367
+ # Corresponds to the JSON property `metricName`
314
368
  # @return [String]
315
- attr_accessor :operator
369
+ attr_accessor :metric_name
316
370
 
317
- # The list of expressions, only the first element is used for all operators
318
- # Corresponds to the JSON property `expressions`
319
- # @return [Array<String>]
320
- attr_accessor :expressions
371
+ # The value to compare against.
372
+ # Corresponds to the JSON property `comparisonValue`
373
+ # @return [String]
374
+ attr_accessor :comparison_value
321
375
 
322
- # Minimum comparison values for `BETWEEN` match type.
323
- # Corresponds to the JSON property `minComparisonValue`
376
+ # Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the
377
+ # comparisonValue, the default is `EQUAL`. If the operator is
378
+ # `IS_MISSING`, checks if the metric is missing and would ignore the
379
+ # comparisonValue.
380
+ # Corresponds to the JSON property `operator`
324
381
  # @return [String]
325
- attr_accessor :min_comparison_value
382
+ attr_accessor :operator
383
+
384
+ # Logical `NOT` operator. If this boolean is set to true, then the matching
385
+ # metric values will be excluded in the report. The default is false.
386
+ # Corresponds to the JSON property `not`
387
+ # @return [Boolean]
388
+ attr_accessor :not
389
+ alias_method :not?, :not
326
390
 
327
391
  def initialize(**args)
328
392
  update!(**args)
@@ -330,12 +394,10 @@ module Google
330
394
 
331
395
  # Update properties of this object
332
396
  def update!(**args)
333
- @max_comparison_value = args[:max_comparison_value] if args.key?(:max_comparison_value)
334
- @dimension_name = args[:dimension_name] if args.key?(:dimension_name)
335
- @case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)
397
+ @metric_name = args[:metric_name] if args.key?(:metric_name)
398
+ @comparison_value = args[:comparison_value] if args.key?(:comparison_value)
336
399
  @operator = args[:operator] if args.key?(:operator)
337
- @expressions = args[:expressions] if args.key?(:expressions)
338
- @min_comparison_value = args[:min_comparison_value] if args.key?(:min_comparison_value)
400
+ @not = args[:not] if args.key?(:not)
339
401
  end
340
402
  end
341
403
 
@@ -343,65 +405,12 @@ module Google
343
405
  class ReportRequest
344
406
  include Google::Apis::Core::Hashable
345
407
 
346
- # Defines a cohort group.
347
- # For example:
348
- # "cohortGroup": `
349
- # "cohorts": [`
350
- # "name": "cohort 1",
351
- # "type": "FIRST_VISIT_DATE",
352
- # "dateRange": ` "startDate": "2015-08-01", "endDate": "2015-08-01" `
353
- # `,`
354
- # "name": "cohort 2"
355
- # "type": "FIRST_VISIT_DATE"
356
- # "dateRange": ` "startDate": "2015-07-01", "endDate": "2015-07-01" `
357
- # `]
358
- # `
359
- # Corresponds to the JSON property `cohortGroup`
360
- # @return [Google::Apis::AnalyticsreportingV4::CohortGroup]
361
- attr_accessor :cohort_group
362
-
363
408
  # The dimensions requested.
364
409
  # Requests can have a total of 7 dimensions.
365
410
  # Corresponds to the JSON property `dimensions`
366
411
  # @return [Array<Google::Apis::AnalyticsreportingV4::Dimension>]
367
412
  attr_accessor :dimensions
368
413
 
369
- # The metric filter clauses. They are logically combined with the `AND`
370
- # operator. Metric filters look at only the first date range and not the
371
- # comparing date range. Note that filtering on metrics occurs after the
372
- # metrics are aggregated.
373
- # Corresponds to the JSON property `metricFilterClauses`
374
- # @return [Array<Google::Apis::AnalyticsreportingV4::MetricFilterClause>]
375
- attr_accessor :metric_filter_clauses
376
-
377
- # If set to true, hides the total of all metrics for all the matching rows,
378
- # for every date range. The default false and will return the totals.
379
- # Corresponds to the JSON property `hideTotals`
380
- # @return [Boolean]
381
- attr_accessor :hide_totals
382
- alias_method :hide_totals?, :hide_totals
383
-
384
- # If set to false, the response does not include rows if all the retrieved
385
- # metrics are equal to zero. The default is false which will exclude these
386
- # rows.
387
- # Corresponds to the JSON property `includeEmptyRows`
388
- # @return [Boolean]
389
- attr_accessor :include_empty_rows
390
- alias_method :include_empty_rows?, :include_empty_rows
391
-
392
- # The dimension filter clauses for filtering Dimension Values. They are
393
- # logically combined with the `AND` operator. Note that filtering occurs
394
- # before any dimensions are aggregated, so that the returned metrics
395
- # represent the total for only the relevant dimensions.
396
- # Corresponds to the JSON property `dimensionFilterClauses`
397
- # @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>]
398
- attr_accessor :dimension_filter_clauses
399
-
400
- # The pivot definitions. Requests can have a maximum of 2 pivots.
401
- # Corresponds to the JSON property `pivots`
402
- # @return [Array<Google::Apis::AnalyticsreportingV4::Pivot>]
403
- attr_accessor :pivots
404
-
405
414
  # Date ranges in the request. The request can have a maximum of 2 date
406
415
  # ranges. The response will contain a set of metric values for each
407
416
  # combination of the dimensions for each date range in the request. So, if
@@ -417,32 +426,34 @@ module Google
417
426
  # @return [Array<Google::Apis::AnalyticsreportingV4::DateRange>]
418
427
  attr_accessor :date_ranges
419
428
 
420
- # Segment the data returned for the request. A segment definition helps look
421
- # at a subset of the segment request. A request can contain up to four
422
- # segments. Every [ReportRequest](#ReportRequest) within a
423
- # `batchGet` method must contain the same `segments` definition. Requests
424
- # with segments must have the `ga:segment` dimension.
425
- # Corresponds to the JSON property `segments`
426
- # @return [Array<Google::Apis::AnalyticsreportingV4::Segment>]
427
- attr_accessor :segments
428
-
429
- # The desired report
430
- # [sample](https://support.google.com/analytics/answer/2637192) size.
431
- # If the the `samplingLevel` field is unspecified the `DEFAULT` sampling
432
- # level is used. Every [ReportRequest](#ReportRequest) within a
433
- # `batchGet` method must contain the same `samplingLevel` definition. See
434
- # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
435
- # for details.
436
- # Corresponds to the JSON property `samplingLevel`
429
+ # A continuation token to get the next page of the results. Adding this to
430
+ # the request will return the rows after the pageToken. The pageToken should
431
+ # be the value returned in the nextPageToken parameter in the response to
432
+ # the GetReports request.
433
+ # Corresponds to the JSON property `pageToken`
437
434
  # @return [String]
438
- attr_accessor :sampling_level
435
+ attr_accessor :page_token
439
436
 
440
- # The metrics requested.
441
- # Requests must specify at least one metric. Requests can have a
442
- # total of 10 metrics.
443
- # Corresponds to the JSON property `metrics`
444
- # @return [Array<Google::Apis::AnalyticsreportingV4::Metric>]
445
- attr_accessor :metrics
437
+ # The pivot definitions. Requests can have a maximum of 2 pivots.
438
+ # Corresponds to the JSON property `pivots`
439
+ # @return [Array<Google::Apis::AnalyticsreportingV4::Pivot>]
440
+ attr_accessor :pivots
441
+
442
+ # If set to false, the response does not include rows if all the retrieved
443
+ # metrics are equal to zero. The default is false which will exclude these
444
+ # rows.
445
+ # Corresponds to the JSON property `includeEmptyRows`
446
+ # @return [Boolean]
447
+ attr_accessor :include_empty_rows
448
+ alias_method :include_empty_rows?, :include_empty_rows
449
+
450
+ # The metric filter clauses. They are logically combined with the `AND`
451
+ # operator. Metric filters look at only the first date range and not the
452
+ # comparing date range. Note that filtering on metrics occurs after the
453
+ # metrics are aggregated.
454
+ # Corresponds to the JSON property `metricFilterClauses`
455
+ # @return [Array<Google::Apis::AnalyticsreportingV4::MetricFilterClause>]
456
+ attr_accessor :metric_filter_clauses
446
457
 
447
458
  # Page size is for paging and specifies the maximum number of returned rows.
448
459
  # Page size should be >= 0. A query returns the default of 1,000 rows.
@@ -456,12 +467,19 @@ module Google
456
467
  # @return [Fixnum]
457
468
  attr_accessor :page_size
458
469
 
459
- # Sort order on output rows. To compare two rows, the elements of the
460
- # following are applied in order until a difference is found. All date
461
- # ranges in the output get the same row order.
462
- # Corresponds to the JSON property `orderBys`
463
- # @return [Array<Google::Apis::AnalyticsreportingV4::OrderBy>]
464
- attr_accessor :order_bys
470
+ # If set to true, hides the total of all metrics for all the matching rows,
471
+ # for every date range. The default false and will return the totals.
472
+ # Corresponds to the JSON property `hideTotals`
473
+ # @return [Boolean]
474
+ attr_accessor :hide_totals
475
+ alias_method :hide_totals?, :hide_totals
476
+
477
+ # If set to true, hides the minimum and maximum across all matching rows.
478
+ # The default is false and the value ranges are returned.
479
+ # Corresponds to the JSON property `hideValueRanges`
480
+ # @return [Boolean]
481
+ attr_accessor :hide_value_ranges
482
+ alias_method :hide_value_ranges?, :hide_value_ranges
465
483
 
466
484
  # Dimension or metric filters that restrict the data returned for your
467
485
  # request. To use the `filtersExpression`, supply a dimension or metric on
@@ -475,12 +493,22 @@ module Google
475
493
  # @return [String]
476
494
  attr_accessor :filters_expression
477
495
 
478
- # If set to true, hides the minimum and maximum across all matching rows.
479
- # The default is false and the value ranges are returned.
480
- # Corresponds to the JSON property `hideValueRanges`
481
- # @return [Boolean]
482
- attr_accessor :hide_value_ranges
483
- alias_method :hide_value_ranges?, :hide_value_ranges
496
+ # Defines a cohort group.
497
+ # For example:
498
+ # "cohortGroup": `
499
+ # "cohorts": [`
500
+ # "name": "cohort 1",
501
+ # "type": "FIRST_VISIT_DATE",
502
+ # "dateRange": ` "startDate": "2015-08-01", "endDate": "2015-08-01" `
503
+ # `,`
504
+ # "name": "cohort 2"
505
+ # "type": "FIRST_VISIT_DATE"
506
+ # "dateRange": ` "startDate": "2015-07-01", "endDate": "2015-07-01" `
507
+ # `]
508
+ # `
509
+ # Corresponds to the JSON property `cohortGroup`
510
+ # @return [Google::Apis::AnalyticsreportingV4::CohortGroup]
511
+ attr_accessor :cohort_group
484
512
 
485
513
  # The Analytics
486
514
  # [view ID](https://support.google.com/analytics/answer/1009618)
@@ -490,13 +518,47 @@ module Google
490
518
  # @return [String]
491
519
  attr_accessor :view_id
492
520
 
493
- # A continuation token to get the next page of the results. Adding this to
494
- # the request will return the rows after the pageToken. The pageToken should
495
- # be the value returned in the nextPageToken parameter in the response to
496
- # the GetReports request.
497
- # Corresponds to the JSON property `pageToken`
521
+ # The metrics requested.
522
+ # Requests must specify at least one metric. Requests can have a
523
+ # total of 10 metrics.
524
+ # Corresponds to the JSON property `metrics`
525
+ # @return [Array<Google::Apis::AnalyticsreportingV4::Metric>]
526
+ attr_accessor :metrics
527
+
528
+ # The dimension filter clauses for filtering Dimension Values. They are
529
+ # logically combined with the `AND` operator. Note that filtering occurs
530
+ # before any dimensions are aggregated, so that the returned metrics
531
+ # represent the total for only the relevant dimensions.
532
+ # Corresponds to the JSON property `dimensionFilterClauses`
533
+ # @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>]
534
+ attr_accessor :dimension_filter_clauses
535
+
536
+ # Sort order on output rows. To compare two rows, the elements of the
537
+ # following are applied in order until a difference is found. All date
538
+ # ranges in the output get the same row order.
539
+ # Corresponds to the JSON property `orderBys`
540
+ # @return [Array<Google::Apis::AnalyticsreportingV4::OrderBy>]
541
+ attr_accessor :order_bys
542
+
543
+ # Segment the data returned for the request. A segment definition helps look
544
+ # at a subset of the segment request. A request can contain up to four
545
+ # segments. Every [ReportRequest](#ReportRequest) within a
546
+ # `batchGet` method must contain the same `segments` definition. Requests
547
+ # with segments must have the `ga:segment` dimension.
548
+ # Corresponds to the JSON property `segments`
549
+ # @return [Array<Google::Apis::AnalyticsreportingV4::Segment>]
550
+ attr_accessor :segments
551
+
552
+ # The desired report
553
+ # [sample](https://support.google.com/analytics/answer/2637192) size.
554
+ # If the the `samplingLevel` field is unspecified the `DEFAULT` sampling
555
+ # level is used. Every [ReportRequest](#ReportRequest) within a
556
+ # `batchGet` method must contain the same `samplingLevel` definition. See
557
+ # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
558
+ # for details.
559
+ # Corresponds to the JSON property `samplingLevel`
498
560
  # @return [String]
499
- attr_accessor :page_token
561
+ attr_accessor :sampling_level
500
562
 
501
563
  def initialize(**args)
502
564
  update!(**args)
@@ -504,36 +566,66 @@ module Google
504
566
 
505
567
  # Update properties of this object
506
568
  def update!(**args)
507
- @cohort_group = args[:cohort_group] if args.key?(:cohort_group)
508
569
  @dimensions = args[:dimensions] if args.key?(:dimensions)
570
+ @date_ranges = args[:date_ranges] if args.key?(:date_ranges)
571
+ @page_token = args[:page_token] if args.key?(:page_token)
572
+ @pivots = args[:pivots] if args.key?(:pivots)
573
+ @include_empty_rows = args[:include_empty_rows] if args.key?(:include_empty_rows)
509
574
  @metric_filter_clauses = args[:metric_filter_clauses] if args.key?(:metric_filter_clauses)
575
+ @page_size = args[:page_size] if args.key?(:page_size)
510
576
  @hide_totals = args[:hide_totals] if args.key?(:hide_totals)
511
- @include_empty_rows = args[:include_empty_rows] if args.key?(:include_empty_rows)
577
+ @hide_value_ranges = args[:hide_value_ranges] if args.key?(:hide_value_ranges)
578
+ @filters_expression = args[:filters_expression] if args.key?(:filters_expression)
579
+ @cohort_group = args[:cohort_group] if args.key?(:cohort_group)
580
+ @view_id = args[:view_id] if args.key?(:view_id)
581
+ @metrics = args[:metrics] if args.key?(:metrics)
512
582
  @dimension_filter_clauses = args[:dimension_filter_clauses] if args.key?(:dimension_filter_clauses)
513
- @pivots = args[:pivots] if args.key?(:pivots)
514
- @date_ranges = args[:date_ranges] if args.key?(:date_ranges)
583
+ @order_bys = args[:order_bys] if args.key?(:order_bys)
515
584
  @segments = args[:segments] if args.key?(:segments)
516
585
  @sampling_level = args[:sampling_level] if args.key?(:sampling_level)
517
- @metrics = args[:metrics] if args.key?(:metrics)
518
- @page_size = args[:page_size] if args.key?(:page_size)
519
- @order_bys = args[:order_bys] if args.key?(:order_bys)
520
- @filters_expression = args[:filters_expression] if args.key?(:filters_expression)
521
- @hide_value_ranges = args[:hide_value_ranges] if args.key?(:hide_value_ranges)
522
- @view_id = args[:view_id] if args.key?(:view_id)
523
- @page_token = args[:page_token] if args.key?(:page_token)
524
586
  end
525
587
  end
526
588
 
527
- # A Simple segment conditions consist of one or more dimension/metric
528
- # conditions that can be combined.
529
- class SimpleSegment
589
+ # [Dimensions](https://support.google.com/analytics/answer/1033861)
590
+ # are attributes of your data. For example, the dimension `ga:city`
591
+ # indicates the city, for example, "Paris" or "New York", from which
592
+ # a session originates.
593
+ class Dimension
530
594
  include Google::Apis::Core::Hashable
531
595
 
532
- # A list of segment filters groups which are combined with logical `AND`
533
- # operator.
534
- # Corresponds to the JSON property `orFiltersForSegment`
535
- # @return [Array<Google::Apis::AnalyticsreportingV4::OrFiltersForSegment>]
536
- attr_accessor :or_filters_for_segment
596
+ # If non-empty, we place dimension values into buckets after string to
597
+ # int64. Dimension values that are not the string representation of an
598
+ # integral value will be converted to zero. The bucket values have to be in
599
+ # increasing order. Each bucket is closed on the lower end, and open on the
600
+ # upper end. The "first" bucket includes all values less than the first
601
+ # boundary, the "last" bucket includes all values up to infinity. Dimension
602
+ # values that fall in a bucket get transformed to a new dimension value. For
603
+ # example, if one gives a list of "0, 1, 3, 4, 7", then we return the
604
+ # following buckets:
605
+ # - bucket #1: values < 0, dimension value "<0"
606
+ # - bucket #2: values in [0,1), dimension value "0"
607
+ # - bucket #3: values in [1,3), dimension value "1-2"
608
+ # - bucket #4: values in [3,4), dimension value "3"
609
+ # - bucket #5: values in [4,7), dimension value "4-6"
610
+ # - bucket #6: values >= 7, dimension value "7+"
611
+ # NOTE: If you are applying histogram mutation on any dimension, and using
612
+ # that dimension in sort, you will want to use the sort type
613
+ # `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values
614
+ # will be sorted according to dictionary
615
+ # (lexicographic) order. For example the ascending dictionary order is:
616
+ # "<50", "1001+", "121-1000", "50-120"
617
+ # And the ascending `HISTOGRAM_BUCKET` order is:
618
+ # "<50", "50-120", "121-1000", "1001+"
619
+ # The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"`
620
+ # for a histogram-mutated dimension.
621
+ # Corresponds to the JSON property `histogramBuckets`
622
+ # @return [Array<String>]
623
+ attr_accessor :histogram_buckets
624
+
625
+ # Name of the dimension to fetch, for example `ga:browser`.
626
+ # Corresponds to the JSON property `name`
627
+ # @return [String]
628
+ attr_accessor :name
537
629
 
538
630
  def initialize(**args)
539
631
  update!(**args)
@@ -541,20 +633,32 @@ module Google
541
633
 
542
634
  # Update properties of this object
543
635
  def update!(**args)
544
- @or_filters_for_segment = args[:or_filters_for_segment] if args.key?(:or_filters_for_segment)
636
+ @histogram_buckets = args[:histogram_buckets] if args.key?(:histogram_buckets)
637
+ @name = args[:name] if args.key?(:name)
545
638
  end
546
639
  end
547
640
 
548
- # SegmentDefinition defines the segment to be a set of SegmentFilters which
549
- # are combined together with a logical `AND` operation.
550
- class SegmentDefinition
641
+ # Dynamic segment definition for defining the segment within the request.
642
+ # A segment can select users, sessions or both.
643
+ class DynamicSegment
551
644
  include Google::Apis::Core::Hashable
552
645
 
553
- # A segment is defined by a set of segment filters which are combined
554
- # together with a logical `AND` operation.
555
- # Corresponds to the JSON property `segmentFilters`
556
- # @return [Array<Google::Apis::AnalyticsreportingV4::SegmentFilter>]
557
- attr_accessor :segment_filters
646
+ # SegmentDefinition defines the segment to be a set of SegmentFilters which
647
+ # are combined together with a logical `AND` operation.
648
+ # Corresponds to the JSON property `sessionSegment`
649
+ # @return [Google::Apis::AnalyticsreportingV4::SegmentDefinition]
650
+ attr_accessor :session_segment
651
+
652
+ # The name of the dynamic segment.
653
+ # Corresponds to the JSON property `name`
654
+ # @return [String]
655
+ attr_accessor :name
656
+
657
+ # SegmentDefinition defines the segment to be a set of SegmentFilters which
658
+ # are combined together with a logical `AND` operation.
659
+ # Corresponds to the JSON property `userSegment`
660
+ # @return [Google::Apis::AnalyticsreportingV4::SegmentDefinition]
661
+ attr_accessor :user_segment
558
662
 
559
663
  def initialize(**args)
560
664
  update!(**args)
@@ -562,44 +666,22 @@ module Google
562
666
 
563
667
  # Update properties of this object
564
668
  def update!(**args)
565
- @segment_filters = args[:segment_filters] if args.key?(:segment_filters)
669
+ @session_segment = args[:session_segment] if args.key?(:session_segment)
670
+ @name = args[:name] if args.key?(:name)
671
+ @user_segment = args[:user_segment] if args.key?(:user_segment)
566
672
  end
567
673
  end
568
674
 
569
- # Metric filter to be used in a segment filter clause.
570
- class SegmentMetricFilter
675
+ # A Simple segment conditions consist of one or more dimension/metric
676
+ # conditions that can be combined.
677
+ class SimpleSegment
571
678
  include Google::Apis::Core::Hashable
572
679
 
573
- # The metric that will be filtered on. A `metricFilter` must contain a
574
- # metric name.
575
- # Corresponds to the JSON property `metricName`
576
- # @return [String]
577
- attr_accessor :metric_name
578
-
579
- # Specifies is the operation to perform to compare the metric. The default
580
- # is `EQUAL`.
581
- # Corresponds to the JSON property `operator`
582
- # @return [String]
583
- attr_accessor :operator
584
-
585
- # The value to compare against. If the operator is `BETWEEN`, this value is
586
- # treated as minimum comparison value.
587
- # Corresponds to the JSON property `comparisonValue`
588
- # @return [String]
589
- attr_accessor :comparison_value
590
-
591
- # Scope for a metric defines the level at which that metric is defined. The
592
- # specified metric scope must be equal to or greater than its primary scope
593
- # as defined in the data model. The primary scope is defined by if the
594
- # segment is selecting users or sessions.
595
- # Corresponds to the JSON property `scope`
596
- # @return [String]
597
- attr_accessor :scope
598
-
599
- # Max comparison value is only used for `BETWEEN` operator.
600
- # Corresponds to the JSON property `maxComparisonValue`
601
- # @return [String]
602
- attr_accessor :max_comparison_value
680
+ # A list of segment filters groups which are combined with logical `AND`
681
+ # operator.
682
+ # Corresponds to the JSON property `orFiltersForSegment`
683
+ # @return [Array<Google::Apis::AnalyticsreportingV4::OrFiltersForSegment>]
684
+ attr_accessor :or_filters_for_segment
603
685
 
604
686
  def initialize(**args)
605
687
  update!(**args)
@@ -607,88 +689,23 @@ module Google
607
689
 
608
690
  # Update properties of this object
609
691
  def update!(**args)
610
- @metric_name = args[:metric_name] if args.key?(:metric_name)
611
- @operator = args[:operator] if args.key?(:operator)
612
- @comparison_value = args[:comparison_value] if args.key?(:comparison_value)
613
- @scope = args[:scope] if args.key?(:scope)
614
- @max_comparison_value = args[:max_comparison_value] if args.key?(:max_comparison_value)
692
+ @or_filters_for_segment = args[:or_filters_for_segment] if args.key?(:or_filters_for_segment)
615
693
  end
616
694
  end
617
695
 
618
- # The data part of the report.
619
- class ReportData
696
+ # Column headers.
697
+ class ColumnHeader
620
698
  include Google::Apis::Core::Hashable
621
699
 
622
- # Total number of matching rows for this query.
623
- # Corresponds to the JSON property `rowCount`
624
- # @return [Fixnum]
625
- attr_accessor :row_count
626
-
627
- # If the results are
628
- # [sampled](https://support.google.com/analytics/answer/2637192),
629
- # this returns the total number of
630
- # samples present, one entry per date range. If the results are not sampled
631
- # this field will not be defined. See
632
- # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
633
- # for details.
634
- # Corresponds to the JSON property `samplingSpaceSizes`
635
- # @return [Array<String>]
636
- attr_accessor :sampling_space_sizes
637
-
638
- # Minimum and maximum values seen over all matching rows. These are both
639
- # empty when `hideValueRanges` in the request is false, or when
640
- # rowCount is zero.
641
- # Corresponds to the JSON property `maximums`
642
- # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
643
- attr_accessor :maximums
700
+ # The headers for the metrics.
701
+ # Corresponds to the JSON property `metricHeader`
702
+ # @return [Google::Apis::AnalyticsreportingV4::MetricHeader]
703
+ attr_accessor :metric_header
644
704
 
645
- # If the results are
646
- # [sampled](https://support.google.com/analytics/answer/2637192),
647
- # this returns the total number of samples read, one entry per date range.
648
- # If the results are not sampled this field will not be defined. See
649
- # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
650
- # for details.
651
- # Corresponds to the JSON property `samplesReadCounts`
705
+ # The dimension names in the response.
706
+ # Corresponds to the JSON property `dimensions`
652
707
  # @return [Array<String>]
653
- attr_accessor :samples_read_counts
654
-
655
- # Minimum and maximum values seen over all matching rows. These are both
656
- # empty when `hideValueRanges` in the request is false, or when
657
- # rowCount is zero.
658
- # Corresponds to the JSON property `minimums`
659
- # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
660
- attr_accessor :minimums
661
-
662
- # There's one ReportRow for every unique combination of dimensions.
663
- # Corresponds to the JSON property `rows`
664
- # @return [Array<Google::Apis::AnalyticsreportingV4::ReportRow>]
665
- attr_accessor :rows
666
-
667
- # The last time the data in the report was refreshed. All the hits received
668
- # before this timestamp are included in the calculation of the report.
669
- # Corresponds to the JSON property `dataLastRefreshed`
670
- # @return [String]
671
- attr_accessor :data_last_refreshed
672
-
673
- # For each requested date range, for the set of all rows that match
674
- # the query, every requested value format gets a total. The total
675
- # for a value format is computed by first totaling the metrics
676
- # mentioned in the value format and then evaluating the value
677
- # format as a scalar expression. E.g., The "totals" for
678
- # `3 / (ga:sessions + 2)` we compute
679
- # `3 / ((sum of all relevant ga:sessions) + 2)`.
680
- # Totals are computed before pagination.
681
- # Corresponds to the JSON property `totals`
682
- # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
683
- attr_accessor :totals
684
-
685
- # Indicates if response to this request is golden or not. Data is
686
- # golden when the exact same request will not produce any new results if
687
- # asked at a later point in time.
688
- # Corresponds to the JSON property `isDataGolden`
689
- # @return [Boolean]
690
- attr_accessor :is_data_golden
691
- alias_method :is_data_golden?, :is_data_golden
708
+ attr_accessor :dimensions
692
709
 
693
710
  def initialize(**args)
694
711
  update!(**args)
@@ -696,28 +713,31 @@ module Google
696
713
 
697
714
  # Update properties of this object
698
715
  def update!(**args)
699
- @row_count = args[:row_count] if args.key?(:row_count)
700
- @sampling_space_sizes = args[:sampling_space_sizes] if args.key?(:sampling_space_sizes)
701
- @maximums = args[:maximums] if args.key?(:maximums)
702
- @samples_read_counts = args[:samples_read_counts] if args.key?(:samples_read_counts)
703
- @minimums = args[:minimums] if args.key?(:minimums)
704
- @rows = args[:rows] if args.key?(:rows)
705
- @data_last_refreshed = args[:data_last_refreshed] if args.key?(:data_last_refreshed)
706
- @totals = args[:totals] if args.key?(:totals)
707
- @is_data_golden = args[:is_data_golden] if args.key?(:is_data_golden)
716
+ @metric_header = args[:metric_header] if args.key?(:metric_header)
717
+ @dimensions = args[:dimensions] if args.key?(:dimensions)
708
718
  end
709
719
  end
710
720
 
711
- # The batch request containing multiple report request.
712
- class GetReportsRequest
721
+ # Filter Clause to be used in a segment definition, can be wither a metric or
722
+ # a dimension filter.
723
+ class SegmentFilterClause
713
724
  include Google::Apis::Core::Hashable
714
725
 
715
- # Requests, each request will have a separate response.
716
- # There can be a maximum of 5 requests. All requests should have the same
717
- # `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`.
718
- # Corresponds to the JSON property `reportRequests`
719
- # @return [Array<Google::Apis::AnalyticsreportingV4::ReportRequest>]
720
- attr_accessor :report_requests
726
+ # Metric filter to be used in a segment filter clause.
727
+ # Corresponds to the JSON property `metricFilter`
728
+ # @return [Google::Apis::AnalyticsreportingV4::SegmentMetricFilter]
729
+ attr_accessor :metric_filter
730
+
731
+ # Matches the complement (`!`) of the filter.
732
+ # Corresponds to the JSON property `not`
733
+ # @return [Boolean]
734
+ attr_accessor :not
735
+ alias_method :not?, :not
736
+
737
+ # Dimension filter specifies the filtering options on a dimension.
738
+ # Corresponds to the JSON property `dimensionFilter`
739
+ # @return [Google::Apis::AnalyticsreportingV4::SegmentDimensionFilter]
740
+ attr_accessor :dimension_filter
721
741
 
722
742
  def initialize(**args)
723
743
  update!(**args)
@@ -725,31 +745,25 @@ module Google
725
745
 
726
746
  # Update properties of this object
727
747
  def update!(**args)
728
- @report_requests = args[:report_requests] if args.key?(:report_requests)
748
+ @metric_filter = args[:metric_filter] if args.key?(:metric_filter)
749
+ @not = args[:not] if args.key?(:not)
750
+ @dimension_filter = args[:dimension_filter] if args.key?(:dimension_filter)
729
751
  end
730
752
  end
731
753
 
732
- # Specifies the sorting options.
733
- class OrderBy
754
+ # A row in the report.
755
+ class ReportRow
734
756
  include Google::Apis::Core::Hashable
735
757
 
736
- # The sorting order for the field.
737
- # Corresponds to the JSON property `sortOrder`
738
- # @return [String]
739
- attr_accessor :sort_order
740
-
741
- # The order type. The default orderType is `VALUE`.
742
- # Corresponds to the JSON property `orderType`
743
- # @return [String]
744
- attr_accessor :order_type
758
+ # List of metrics for each requested DateRange.
759
+ # Corresponds to the JSON property `metrics`
760
+ # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
761
+ attr_accessor :metrics
745
762
 
746
- # The field which to sort by. The default sort order is ascending. Example:
747
- # `ga:browser`.
748
- # Note, that you can only specify one field for sort here. For example,
749
- # `ga:browser, ga:city` is not valid.
750
- # Corresponds to the JSON property `fieldName`
751
- # @return [String]
752
- attr_accessor :field_name
763
+ # List of requested dimensions.
764
+ # Corresponds to the JSON property `dimensions`
765
+ # @return [Array<String>]
766
+ attr_accessor :dimensions
753
767
 
754
768
  def initialize(**args)
755
769
  update!(**args)
@@ -757,9 +771,8 @@ module Google
757
771
 
758
772
  # Update properties of this object
759
773
  def update!(**args)
760
- @sort_order = args[:sort_order] if args.key?(:sort_order)
761
- @order_type = args[:order_type] if args.key?(:order_type)
762
- @field_name = args[:field_name] if args.key?(:field_name)
774
+ @metrics = args[:metrics] if args.key?(:metrics)
775
+ @dimensions = args[:dimensions] if args.key?(:dimensions)
763
776
  end
764
777
  end
765
778
 
@@ -776,6 +789,12 @@ module Google
776
789
  # @return [String]
777
790
  attr_accessor :type
778
791
 
792
+ # A unique name for the cohort. If not defined name will be auto-generated
793
+ # with values cohort_[1234...].
794
+ # Corresponds to the JSON property `name`
795
+ # @return [String]
796
+ attr_accessor :name
797
+
779
798
  # A contiguous set of days: startDate, startDate + 1 day, ..., endDate.
780
799
  # The start and end dates are specified in
781
800
  # [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`.
@@ -783,12 +802,6 @@ module Google
783
802
  # @return [Google::Apis::AnalyticsreportingV4::DateRange]
784
803
  attr_accessor :date_range
785
804
 
786
- # A unique name for the cohort. If not defined name will be auto-generated
787
- # with values cohort_[1234...].
788
- # Corresponds to the JSON property `name`
789
- # @return [String]
790
- attr_accessor :name
791
-
792
805
  def initialize(**args)
793
806
  update!(**args)
794
807
  end
@@ -796,8 +809,36 @@ module Google
796
809
  # Update properties of this object
797
810
  def update!(**args)
798
811
  @type = args[:type] if args.key?(:type)
799
- @date_range = args[:date_range] if args.key?(:date_range)
800
812
  @name = args[:name] if args.key?(:name)
813
+ @date_range = args[:date_range] if args.key?(:date_range)
814
+ end
815
+ end
816
+
817
+ # Represents a group of metric filters.
818
+ # Set the operator value to specify how the filters are logically combined.
819
+ class MetricFilterClause
820
+ include Google::Apis::Core::Hashable
821
+
822
+ # The operator for combining multiple metric filters. If unspecified, it is
823
+ # treated as an `OR`.
824
+ # Corresponds to the JSON property `operator`
825
+ # @return [String]
826
+ attr_accessor :operator
827
+
828
+ # The repeated set of filters. They are logically combined based on the
829
+ # operator specified.
830
+ # Corresponds to the JSON property `filters`
831
+ # @return [Array<Google::Apis::AnalyticsreportingV4::MetricFilter>]
832
+ attr_accessor :filters
833
+
834
+ def initialize(**args)
835
+ update!(**args)
836
+ end
837
+
838
+ # Update properties of this object
839
+ def update!(**args)
840
+ @operator = args[:operator] if args.key?(:operator)
841
+ @filters = args[:filters] if args.key?(:filters)
801
842
  end
802
843
  end
803
844
 
@@ -821,23 +862,19 @@ module Google
821
862
  end
822
863
  end
823
864
 
824
- # Sequence conditions consist of one or more steps, where each step is defined
825
- # by one or more dimension/metric conditions. Multiple steps can be combined
826
- # with special sequence operators.
827
- class SequenceSegment
865
+ # The headers for the metrics.
866
+ class MetricHeader
828
867
  include Google::Apis::Core::Hashable
829
868
 
830
- # If set, first step condition must match the first hit of the visitor (in
831
- # the date range).
832
- # Corresponds to the JSON property `firstStepShouldMatchFirstHit`
833
- # @return [Boolean]
834
- attr_accessor :first_step_should_match_first_hit
835
- alias_method :first_step_should_match_first_hit?, :first_step_should_match_first_hit
869
+ # Headers for the metrics in the response.
870
+ # Corresponds to the JSON property `metricHeaderEntries`
871
+ # @return [Array<Google::Apis::AnalyticsreportingV4::MetricHeaderEntry>]
872
+ attr_accessor :metric_header_entries
836
873
 
837
- # The list of steps in the sequence.
838
- # Corresponds to the JSON property `segmentSequenceSteps`
839
- # @return [Array<Google::Apis::AnalyticsreportingV4::SegmentSequenceStep>]
840
- attr_accessor :segment_sequence_steps
874
+ # Headers for the pivots in the response.
875
+ # Corresponds to the JSON property `pivotHeaders`
876
+ # @return [Array<Google::Apis::AnalyticsreportingV4::PivotHeader>]
877
+ attr_accessor :pivot_headers
841
878
 
842
879
  def initialize(**args)
843
880
  update!(**args)
@@ -845,53 +882,27 @@ module Google
845
882
 
846
883
  # Update properties of this object
847
884
  def update!(**args)
848
- @first_step_should_match_first_hit = args[:first_step_should_match_first_hit] if args.key?(:first_step_should_match_first_hit)
849
- @segment_sequence_steps = args[:segment_sequence_steps] if args.key?(:segment_sequence_steps)
885
+ @metric_header_entries = args[:metric_header_entries] if args.key?(:metric_header_entries)
886
+ @pivot_headers = args[:pivot_headers] if args.key?(:pivot_headers)
850
887
  end
851
888
  end
852
889
 
853
- # SegmentFilter defines the segment to be either a simple or a sequence
854
- # segment. A simple segment condition contains dimension and metric conditions
855
- # to select the sessions or users. A sequence segment condition can be used to
856
- # select users or sessions based on sequential conditions.
857
- class SegmentFilter
890
+ # A group of dimension filters. Set the operator value to specify how
891
+ # the filters are logically combined.
892
+ class DimensionFilterClause
858
893
  include Google::Apis::Core::Hashable
859
894
 
860
- # Sequence conditions consist of one or more steps, where each step is defined
861
- # by one or more dimension/metric conditions. Multiple steps can be combined
862
- # with special sequence operators.
863
- # Corresponds to the JSON property `sequenceSegment`
864
- # @return [Google::Apis::AnalyticsreportingV4::SequenceSegment]
865
- attr_accessor :sequence_segment
895
+ # The operator for combining multiple dimension filters. If unspecified, it
896
+ # is treated as an `OR`.
897
+ # Corresponds to the JSON property `operator`
898
+ # @return [String]
899
+ attr_accessor :operator
866
900
 
867
- # If true, match the complement of simple or sequence segment.
868
- # For example, to match all visits not from "New York", we can define the
869
- # segment as follows:
870
- # "sessionSegment": `
871
- # "segmentFilters": [`
872
- # "simpleSegment" :`
873
- # "orFiltersForSegment": [`
874
- # "segmentFilterClauses":[`
875
- # "dimensionFilter": `
876
- # "dimensionName": "ga:city",
877
- # "expressions": ["New York"]
878
- # `
879
- # `]
880
- # `]
881
- # `,
882
- # "not": "True"
883
- # `]
884
- # `,
885
- # Corresponds to the JSON property `not`
886
- # @return [Boolean]
887
- attr_accessor :not
888
- alias_method :not?, :not
889
-
890
- # A Simple segment conditions consist of one or more dimension/metric
891
- # conditions that can be combined.
892
- # Corresponds to the JSON property `simpleSegment`
893
- # @return [Google::Apis::AnalyticsreportingV4::SimpleSegment]
894
- attr_accessor :simple_segment
901
+ # The repeated set of filters. They are logically combined based on the
902
+ # operator specified.
903
+ # Corresponds to the JSON property `filters`
904
+ # @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilter>]
905
+ attr_accessor :filters
895
906
 
896
907
  def initialize(**args)
897
908
  update!(**args)
@@ -899,31 +910,20 @@ module Google
899
910
 
900
911
  # Update properties of this object
901
912
  def update!(**args)
902
- @sequence_segment = args[:sequence_segment] if args.key?(:sequence_segment)
903
- @not = args[:not] if args.key?(:not)
904
- @simple_segment = args[:simple_segment] if args.key?(:simple_segment)
913
+ @operator = args[:operator] if args.key?(:operator)
914
+ @filters = args[:filters] if args.key?(:filters)
905
915
  end
906
916
  end
907
917
 
908
- # The headers for the each of the metric column corresponding to the metrics
909
- # requested in the pivots section of the response.
910
- class PivotHeaderEntry
918
+ # The main response class which holds the reports from the Reporting API
919
+ # `batchGet` call.
920
+ class GetReportsResponse
911
921
  include Google::Apis::Core::Hashable
912
922
 
913
- # The name of the dimensions in the pivot response.
914
- # Corresponds to the JSON property `dimensionNames`
915
- # @return [Array<String>]
916
- attr_accessor :dimension_names
917
-
918
- # The values for the dimensions in the pivot.
919
- # Corresponds to the JSON property `dimensionValues`
920
- # @return [Array<String>]
921
- attr_accessor :dimension_values
922
-
923
- # Header for the metrics.
924
- # Corresponds to the JSON property `metric`
925
- # @return [Google::Apis::AnalyticsreportingV4::MetricHeaderEntry]
926
- attr_accessor :metric
923
+ # Responses corresponding to each of the request.
924
+ # Corresponds to the JSON property `reports`
925
+ # @return [Array<Google::Apis::AnalyticsreportingV4::Report>]
926
+ attr_accessor :reports
927
927
 
928
928
  def initialize(**args)
929
929
  update!(**args)
@@ -931,28 +931,27 @@ module Google
931
931
 
932
932
  # Update properties of this object
933
933
  def update!(**args)
934
- @dimension_names = args[:dimension_names] if args.key?(:dimension_names)
935
- @dimension_values = args[:dimension_values] if args.key?(:dimension_values)
936
- @metric = args[:metric] if args.key?(:metric)
934
+ @reports = args[:reports] if args.key?(:reports)
937
935
  end
938
936
  end
939
937
 
940
- # A group of dimension filters. Set the operator value to specify how
941
- # the filters are logically combined.
942
- class DimensionFilterClause
938
+ # Sequence conditions consist of one or more steps, where each step is defined
939
+ # by one or more dimension/metric conditions. Multiple steps can be combined
940
+ # with special sequence operators.
941
+ class SequenceSegment
943
942
  include Google::Apis::Core::Hashable
944
943
 
945
- # The operator for combining multiple dimension filters. If unspecified, it
946
- # is treated as an `OR`.
947
- # Corresponds to the JSON property `operator`
948
- # @return [String]
949
- attr_accessor :operator
944
+ # The list of steps in the sequence.
945
+ # Corresponds to the JSON property `segmentSequenceSteps`
946
+ # @return [Array<Google::Apis::AnalyticsreportingV4::SegmentSequenceStep>]
947
+ attr_accessor :segment_sequence_steps
950
948
 
951
- # The repeated set of filters. They are logically combined based on the
952
- # operator specified.
953
- # Corresponds to the JSON property `filters`
954
- # @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilter>]
955
- attr_accessor :filters
949
+ # If set, first step condition must match the first hit of the visitor (in
950
+ # the date range).
951
+ # Corresponds to the JSON property `firstStepShouldMatchFirstHit`
952
+ # @return [Boolean]
953
+ attr_accessor :first_step_should_match_first_hit
954
+ alias_method :first_step_should_match_first_hit?, :first_step_should_match_first_hit
956
955
 
957
956
  def initialize(**args)
958
957
  update!(**args)
@@ -960,89 +959,45 @@ module Google
960
959
 
961
960
  # Update properties of this object
962
961
  def update!(**args)
963
- @operator = args[:operator] if args.key?(:operator)
964
- @filters = args[:filters] if args.key?(:filters)
962
+ @segment_sequence_steps = args[:segment_sequence_steps] if args.key?(:segment_sequence_steps)
963
+ @first_step_should_match_first_hit = args[:first_step_should_match_first_hit] if args.key?(:first_step_should_match_first_hit)
965
964
  end
966
965
  end
967
966
 
968
- # A segment sequence definition.
969
- class SegmentSequenceStep
967
+ # Metric filter to be used in a segment filter clause.
968
+ class SegmentMetricFilter
970
969
  include Google::Apis::Core::Hashable
971
970
 
972
- # Specifies if the step immediately precedes or can be any time before the
973
- # next step.
974
- # Corresponds to the JSON property `matchType`
971
+ # Max comparison value is only used for `BETWEEN` operator.
972
+ # Corresponds to the JSON property `maxComparisonValue`
975
973
  # @return [String]
976
- attr_accessor :match_type
977
-
978
- # A sequence is specified with a list of Or grouped filters which are
979
- # combined with `AND` operator.
980
- # Corresponds to the JSON property `orFiltersForSegment`
981
- # @return [Array<Google::Apis::AnalyticsreportingV4::OrFiltersForSegment>]
982
- attr_accessor :or_filters_for_segment
983
-
984
- def initialize(**args)
985
- update!(**args)
986
- end
987
-
988
- # Update properties of this object
989
- def update!(**args)
990
- @match_type = args[:match_type] if args.key?(:match_type)
991
- @or_filters_for_segment = args[:or_filters_for_segment] if args.key?(:or_filters_for_segment)
992
- end
993
- end
994
-
995
- # The Pivot describes the pivot section in the request.
996
- # The Pivot helps rearrange the information in the table for certain reports
997
- # by pivoting your data on a second dimension.
998
- class Pivot
999
- include Google::Apis::Core::Hashable
1000
-
1001
- # A list of dimensions to show as pivot columns. A Pivot can have a maximum
1002
- # of 4 dimensions. Pivot dimensions are part of the restriction on the
1003
- # total number of dimensions allowed in the request.
1004
- # Corresponds to the JSON property `dimensions`
1005
- # @return [Array<Google::Apis::AnalyticsreportingV4::Dimension>]
1006
- attr_accessor :dimensions
974
+ attr_accessor :max_comparison_value
1007
975
 
1008
- # The pivot metrics. Pivot metrics are part of the
1009
- # restriction on total number of metrics allowed in the request.
1010
- # Corresponds to the JSON property `metrics`
1011
- # @return [Array<Google::Apis::AnalyticsreportingV4::Metric>]
1012
- attr_accessor :metrics
976
+ # The value to compare against. If the operator is `BETWEEN`, this value is
977
+ # treated as minimum comparison value.
978
+ # Corresponds to the JSON property `comparisonValue`
979
+ # @return [String]
980
+ attr_accessor :comparison_value
1013
981
 
1014
- # Specifies the maximum number of groups to return.
1015
- # The default value is 10, also the maximum value is 1,000.
1016
- # Corresponds to the JSON property `maxGroupCount`
1017
- # @return [Fixnum]
1018
- attr_accessor :max_group_count
982
+ # Specifies is the operation to perform to compare the metric. The default
983
+ # is `EQUAL`.
984
+ # Corresponds to the JSON property `operator`
985
+ # @return [String]
986
+ attr_accessor :operator
1019
987
 
1020
- # DimensionFilterClauses are logically combined with an `AND` operator: only
1021
- # data that is included by all these DimensionFilterClauses contributes to
1022
- # the values in this pivot region. Dimension filters can be used to restrict
1023
- # the columns shown in the pivot region. For example if you have
1024
- # `ga:browser` as the requested dimension in the pivot region, and you
1025
- # specify key filters to restrict `ga:browser` to only "IE" or "Firefox",
1026
- # then only those two browsers would show up as columns.
1027
- # Corresponds to the JSON property `dimensionFilterClauses`
1028
- # @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>]
1029
- attr_accessor :dimension_filter_clauses
988
+ # The metric that will be filtered on. A `metricFilter` must contain a
989
+ # metric name.
990
+ # Corresponds to the JSON property `metricName`
991
+ # @return [String]
992
+ attr_accessor :metric_name
1030
993
 
1031
- # If k metrics were requested, then the response will contain some
1032
- # data-dependent multiple of k columns in the report. E.g., if you pivoted
1033
- # on the dimension `ga:browser` then you'd get k columns for "Firefox", k
1034
- # columns for "IE", k columns for "Chrome", etc. The ordering of the groups
1035
- # of columns is determined by descending order of "total" for the first of
1036
- # the k values. Ties are broken by lexicographic ordering of the first
1037
- # pivot dimension, then lexicographic ordering of the second pivot
1038
- # dimension, and so on. E.g., if the totals for the first value for
1039
- # Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns
1040
- # would be Chrome, Firefox, IE.
1041
- # The following let you choose which of the groups of k columns are
1042
- # included in the response.
1043
- # Corresponds to the JSON property `startGroup`
1044
- # @return [Fixnum]
1045
- attr_accessor :start_group
994
+ # Scope for a metric defines the level at which that metric is defined. The
995
+ # specified metric scope must be equal to or greater than its primary scope
996
+ # as defined in the data model. The primary scope is defined by if the
997
+ # segment is selecting users or sessions.
998
+ # Corresponds to the JSON property `scope`
999
+ # @return [String]
1000
+ attr_accessor :scope
1046
1001
 
1047
1002
  def initialize(**args)
1048
1003
  update!(**args)
@@ -1050,11 +1005,11 @@ module Google
1050
1005
 
1051
1006
  # Update properties of this object
1052
1007
  def update!(**args)
1053
- @dimensions = args[:dimensions] if args.key?(:dimensions)
1054
- @metrics = args[:metrics] if args.key?(:metrics)
1055
- @max_group_count = args[:max_group_count] if args.key?(:max_group_count)
1056
- @dimension_filter_clauses = args[:dimension_filter_clauses] if args.key?(:dimension_filter_clauses)
1057
- @start_group = args[:start_group] if args.key?(:start_group)
1008
+ @max_comparison_value = args[:max_comparison_value] if args.key?(:max_comparison_value)
1009
+ @comparison_value = args[:comparison_value] if args.key?(:comparison_value)
1010
+ @operator = args[:operator] if args.key?(:operator)
1011
+ @metric_name = args[:metric_name] if args.key?(:metric_name)
1012
+ @scope = args[:scope] if args.key?(:scope)
1058
1013
  end
1059
1014
  end
1060
1015
 
@@ -1084,22 +1039,58 @@ module Google
1084
1039
  end
1085
1040
  end
1086
1041
 
1087
- # Represents a group of metric filters.
1088
- # Set the operator value to specify how the filters are logically combined.
1089
- class MetricFilterClause
1042
+ # Defines a cohort group.
1043
+ # For example:
1044
+ # "cohortGroup": `
1045
+ # "cohorts": [`
1046
+ # "name": "cohort 1",
1047
+ # "type": "FIRST_VISIT_DATE",
1048
+ # "dateRange": ` "startDate": "2015-08-01", "endDate": "2015-08-01" `
1049
+ # `,`
1050
+ # "name": "cohort 2"
1051
+ # "type": "FIRST_VISIT_DATE"
1052
+ # "dateRange": ` "startDate": "2015-07-01", "endDate": "2015-07-01" `
1053
+ # `]
1054
+ # `
1055
+ class CohortGroup
1090
1056
  include Google::Apis::Core::Hashable
1091
1057
 
1092
- # The operator for combining multiple metric filters. If unspecified, it is
1093
- # treated as an `OR`.
1094
- # Corresponds to the JSON property `operator`
1095
- # @return [String]
1096
- attr_accessor :operator
1058
+ # The definition for the cohort.
1059
+ # Corresponds to the JSON property `cohorts`
1060
+ # @return [Array<Google::Apis::AnalyticsreportingV4::Cohort>]
1061
+ attr_accessor :cohorts
1097
1062
 
1098
- # The repeated set of filters. They are logically combined based on the
1099
- # operator specified.
1100
- # Corresponds to the JSON property `filters`
1101
- # @return [Array<Google::Apis::AnalyticsreportingV4::MetricFilter>]
1102
- attr_accessor :filters
1063
+ # Enable Life Time Value (LTV). LTV measures lifetime value for users
1064
+ # acquired through different channels.
1065
+ # Please see:
1066
+ # [Cohort Analysis](https://support.google.com/analytics/answer/6074676) and
1067
+ # [Lifetime Value](https://support.google.com/analytics/answer/6182550)
1068
+ # If the value of lifetimeValue is false:
1069
+ # - The metric values are similar to the values in the web interface cohort
1070
+ # report.
1071
+ # - The cohort definition date ranges must be aligned to the calendar week
1072
+ # and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in
1073
+ # the cohort definition should be a Sunday and the `endDate` should be the
1074
+ # following Saturday, and for `ga:cohortNthMonth`, the `startDate`
1075
+ # should be the 1st of the month and `endDate` should be the last day
1076
+ # of the month.
1077
+ # When the lifetimeValue is true:
1078
+ # - The metric values will correspond to the values in the web interface
1079
+ # LifeTime value report.
1080
+ # - The Lifetime Value report shows you how user value (Revenue) and
1081
+ # engagement (Appviews, Goal Completions, Sessions, and Session Duration)
1082
+ # grow during the 90 days after a user is acquired.
1083
+ # - The metrics are calculated as a cumulative average per user per the time
1084
+ # increment.
1085
+ # - The cohort definition date ranges need not be aligned to the calendar
1086
+ # week and month boundaries.
1087
+ # - The `viewId` must be an
1088
+ # [app view ID](https://support.google.com/analytics/answer/2649553#
1089
+ # WebVersusAppViews)
1090
+ # Corresponds to the JSON property `lifetimeValue`
1091
+ # @return [Boolean]
1092
+ attr_accessor :lifetime_value
1093
+ alias_method :lifetime_value?, :lifetime_value
1103
1094
 
1104
1095
  def initialize(**args)
1105
1096
  update!(**args)
@@ -1107,27 +1098,21 @@ module Google
1107
1098
 
1108
1099
  # Update properties of this object
1109
1100
  def update!(**args)
1110
- @operator = args[:operator] if args.key?(:operator)
1111
- @filters = args[:filters] if args.key?(:filters)
1112
- end
1101
+ @cohorts = args[:cohorts] if args.key?(:cohorts)
1102
+ @lifetime_value = args[:lifetime_value] if args.key?(:lifetime_value)
1103
+ end
1113
1104
  end
1114
1105
 
1115
- # The segment definition, if the report needs to be segmented.
1116
- # A Segment is a subset of the Analytics data. For example, of the entire
1117
- # set of users, one Segment might be users from a particular country or city.
1118
- class Segment
1106
+ # The batch request containing multiple report request.
1107
+ class GetReportsRequest
1119
1108
  include Google::Apis::Core::Hashable
1120
1109
 
1121
- # Dynamic segment definition for defining the segment within the request.
1122
- # A segment can select users, sessions or both.
1123
- # Corresponds to the JSON property `dynamicSegment`
1124
- # @return [Google::Apis::AnalyticsreportingV4::DynamicSegment]
1125
- attr_accessor :dynamic_segment
1126
-
1127
- # The segment ID of a built-in or custom segment, for example `gaid::-3`.
1128
- # Corresponds to the JSON property `segmentId`
1129
- # @return [String]
1130
- attr_accessor :segment_id
1110
+ # Requests, each request will have a separate response.
1111
+ # There can be a maximum of 5 requests. All requests should have the same
1112
+ # `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`.
1113
+ # Corresponds to the JSON property `reportRequests`
1114
+ # @return [Array<Google::Apis::AnalyticsreportingV4::ReportRequest>]
1115
+ attr_accessor :report_requests
1131
1116
 
1132
1117
  def initialize(**args)
1133
1118
  update!(**args)
@@ -1135,26 +1120,61 @@ module Google
1135
1120
 
1136
1121
  # Update properties of this object
1137
1122
  def update!(**args)
1138
- @dynamic_segment = args[:dynamic_segment] if args.key?(:dynamic_segment)
1139
- @segment_id = args[:segment_id] if args.key?(:segment_id)
1123
+ @report_requests = args[:report_requests] if args.key?(:report_requests)
1140
1124
  end
1141
1125
  end
1142
1126
 
1143
- # A contiguous set of days: startDate, startDate + 1 day, ..., endDate.
1144
- # The start and end dates are specified in
1145
- # [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`.
1146
- class DateRange
1127
+ # The Pivot describes the pivot section in the request.
1128
+ # The Pivot helps rearrange the information in the table for certain reports
1129
+ # by pivoting your data on a second dimension.
1130
+ class Pivot
1147
1131
  include Google::Apis::Core::Hashable
1148
1132
 
1149
- # The start date for the query in the format `YYYY-MM-DD`.
1150
- # Corresponds to the JSON property `startDate`
1151
- # @return [String]
1152
- attr_accessor :start_date
1133
+ # Specifies the maximum number of groups to return.
1134
+ # The default value is 10, also the maximum value is 1,000.
1135
+ # Corresponds to the JSON property `maxGroupCount`
1136
+ # @return [Fixnum]
1137
+ attr_accessor :max_group_count
1153
1138
 
1154
- # The end date for the query in the format `YYYY-MM-DD`.
1155
- # Corresponds to the JSON property `endDate`
1156
- # @return [String]
1157
- attr_accessor :end_date
1139
+ # If k metrics were requested, then the response will contain some
1140
+ # data-dependent multiple of k columns in the report. E.g., if you pivoted
1141
+ # on the dimension `ga:browser` then you'd get k columns for "Firefox", k
1142
+ # columns for "IE", k columns for "Chrome", etc. The ordering of the groups
1143
+ # of columns is determined by descending order of "total" for the first of
1144
+ # the k values. Ties are broken by lexicographic ordering of the first
1145
+ # pivot dimension, then lexicographic ordering of the second pivot
1146
+ # dimension, and so on. E.g., if the totals for the first value for
1147
+ # Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns
1148
+ # would be Chrome, Firefox, IE.
1149
+ # The following let you choose which of the groups of k columns are
1150
+ # included in the response.
1151
+ # Corresponds to the JSON property `startGroup`
1152
+ # @return [Fixnum]
1153
+ attr_accessor :start_group
1154
+
1155
+ # The pivot metrics. Pivot metrics are part of the
1156
+ # restriction on total number of metrics allowed in the request.
1157
+ # Corresponds to the JSON property `metrics`
1158
+ # @return [Array<Google::Apis::AnalyticsreportingV4::Metric>]
1159
+ attr_accessor :metrics
1160
+
1161
+ # A list of dimensions to show as pivot columns. A Pivot can have a maximum
1162
+ # of 4 dimensions. Pivot dimensions are part of the restriction on the
1163
+ # total number of dimensions allowed in the request.
1164
+ # Corresponds to the JSON property `dimensions`
1165
+ # @return [Array<Google::Apis::AnalyticsreportingV4::Dimension>]
1166
+ attr_accessor :dimensions
1167
+
1168
+ # DimensionFilterClauses are logically combined with an `AND` operator: only
1169
+ # data that is included by all these DimensionFilterClauses contributes to
1170
+ # the values in this pivot region. Dimension filters can be used to restrict
1171
+ # the columns shown in the pivot region. For example if you have
1172
+ # `ga:browser` as the requested dimension in the pivot region, and you
1173
+ # specify key filters to restrict `ga:browser` to only "IE" or "Firefox",
1174
+ # then only those two browsers would show up as columns.
1175
+ # Corresponds to the JSON property `dimensionFilterClauses`
1176
+ # @return [Array<Google::Apis::AnalyticsreportingV4::DimensionFilterClause>]
1177
+ attr_accessor :dimension_filter_clauses
1158
1178
 
1159
1179
  def initialize(**args)
1160
1180
  update!(**args)
@@ -1162,24 +1182,33 @@ module Google
1162
1182
 
1163
1183
  # Update properties of this object
1164
1184
  def update!(**args)
1165
- @start_date = args[:start_date] if args.key?(:start_date)
1166
- @end_date = args[:end_date] if args.key?(:end_date)
1185
+ @max_group_count = args[:max_group_count] if args.key?(:max_group_count)
1186
+ @start_group = args[:start_group] if args.key?(:start_group)
1187
+ @metrics = args[:metrics] if args.key?(:metrics)
1188
+ @dimensions = args[:dimensions] if args.key?(:dimensions)
1189
+ @dimension_filter_clauses = args[:dimension_filter_clauses] if args.key?(:dimension_filter_clauses)
1167
1190
  end
1168
1191
  end
1169
1192
 
1170
- # A row in the report.
1171
- class ReportRow
1193
+ # The headers for the each of the metric column corresponding to the metrics
1194
+ # requested in the pivots section of the response.
1195
+ class PivotHeaderEntry
1172
1196
  include Google::Apis::Core::Hashable
1173
1197
 
1174
- # List of requested dimensions.
1175
- # Corresponds to the JSON property `dimensions`
1198
+ # The name of the dimensions in the pivot response.
1199
+ # Corresponds to the JSON property `dimensionNames`
1176
1200
  # @return [Array<String>]
1177
- attr_accessor :dimensions
1201
+ attr_accessor :dimension_names
1178
1202
 
1179
- # List of metrics for each requested DateRange.
1180
- # Corresponds to the JSON property `metrics`
1181
- # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
1182
- attr_accessor :metrics
1203
+ # Header for the metrics.
1204
+ # Corresponds to the JSON property `metric`
1205
+ # @return [Google::Apis::AnalyticsreportingV4::MetricHeaderEntry]
1206
+ attr_accessor :metric
1207
+
1208
+ # The values for the dimensions in the pivot.
1209
+ # Corresponds to the JSON property `dimensionValues`
1210
+ # @return [Array<String>]
1211
+ attr_accessor :dimension_values
1183
1212
 
1184
1213
  def initialize(**args)
1185
1214
  update!(**args)
@@ -1187,63 +1216,54 @@ module Google
1187
1216
 
1188
1217
  # Update properties of this object
1189
1218
  def update!(**args)
1190
- @dimensions = args[:dimensions] if args.key?(:dimensions)
1191
- @metrics = args[:metrics] if args.key?(:metrics)
1219
+ @dimension_names = args[:dimension_names] if args.key?(:dimension_names)
1220
+ @metric = args[:metric] if args.key?(:metric)
1221
+ @dimension_values = args[:dimension_values] if args.key?(:dimension_values)
1192
1222
  end
1193
1223
  end
1194
1224
 
1195
- # Defines a cohort group.
1196
- # For example:
1197
- # "cohortGroup": `
1198
- # "cohorts": [`
1199
- # "name": "cohort 1",
1200
- # "type": "FIRST_VISIT_DATE",
1201
- # "dateRange": ` "startDate": "2015-08-01", "endDate": "2015-08-01" `
1202
- # `,`
1203
- # "name": "cohort 2"
1204
- # "type": "FIRST_VISIT_DATE"
1205
- # "dateRange": ` "startDate": "2015-07-01", "endDate": "2015-07-01" `
1206
- # `]
1207
- # `
1208
- class CohortGroup
1225
+ # SegmentFilter defines the segment to be either a simple or a sequence
1226
+ # segment. A simple segment condition contains dimension and metric conditions
1227
+ # to select the sessions or users. A sequence segment condition can be used to
1228
+ # select users or sessions based on sequential conditions.
1229
+ class SegmentFilter
1209
1230
  include Google::Apis::Core::Hashable
1210
1231
 
1211
- # Enable Life Time Value (LTV). LTV measures lifetime value for users
1212
- # acquired through different channels.
1213
- # Please see:
1214
- # [Cohort Analysis](https://support.google.com/analytics/answer/6074676) and
1215
- # [Lifetime Value](https://support.google.com/analytics/answer/6182550)
1216
- # If the value of lifetimeValue is false:
1217
- # - The metric values are similar to the values in the web interface cohort
1218
- # report.
1219
- # - The cohort definition date ranges must be aligned to the calendar week
1220
- # and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in
1221
- # the cohort definition should be a Sunday and the `endDate` should be the
1222
- # following Saturday, and for `ga:cohortNthMonth`, the `startDate`
1223
- # should be the 1st of the month and `endDate` should be the last day
1224
- # of the month.
1225
- # When the lifetimeValue is true:
1226
- # - The metric values will correspond to the values in the web interface
1227
- # LifeTime value report.
1228
- # - The Lifetime Value report shows you how user value (Revenue) and
1229
- # engagement (Appviews, Goal Completions, Sessions, and Session Duration)
1230
- # grow during the 90 days after a user is acquired.
1231
- # - The metrics are calculated as a cumulative average per user per the time
1232
- # increment.
1233
- # - The cohort definition date ranges need not be aligned to the calendar
1234
- # week and month boundaries.
1235
- # - The `viewId` must be an
1236
- # [app view ID](https://support.google.com/analytics/answer/2649553#
1237
- # WebVersusAppViews)
1238
- # Corresponds to the JSON property `lifetimeValue`
1232
+ # Sequence conditions consist of one or more steps, where each step is defined
1233
+ # by one or more dimension/metric conditions. Multiple steps can be combined
1234
+ # with special sequence operators.
1235
+ # Corresponds to the JSON property `sequenceSegment`
1236
+ # @return [Google::Apis::AnalyticsreportingV4::SequenceSegment]
1237
+ attr_accessor :sequence_segment
1238
+
1239
+ # If true, match the complement of simple or sequence segment.
1240
+ # For example, to match all visits not from "New York", we can define the
1241
+ # segment as follows:
1242
+ # "sessionSegment": `
1243
+ # "segmentFilters": [`
1244
+ # "simpleSegment" :`
1245
+ # "orFiltersForSegment": [`
1246
+ # "segmentFilterClauses":[`
1247
+ # "dimensionFilter": `
1248
+ # "dimensionName": "ga:city",
1249
+ # "expressions": ["New York"]
1250
+ # `
1251
+ # `]
1252
+ # `]
1253
+ # `,
1254
+ # "not": "True"
1255
+ # `]
1256
+ # `,
1257
+ # Corresponds to the JSON property `not`
1239
1258
  # @return [Boolean]
1240
- attr_accessor :lifetime_value
1241
- alias_method :lifetime_value?, :lifetime_value
1259
+ attr_accessor :not
1260
+ alias_method :not?, :not
1242
1261
 
1243
- # The definition for the cohort.
1244
- # Corresponds to the JSON property `cohorts`
1245
- # @return [Array<Google::Apis::AnalyticsreportingV4::Cohort>]
1246
- attr_accessor :cohorts
1262
+ # A Simple segment conditions consist of one or more dimension/metric
1263
+ # conditions that can be combined.
1264
+ # Corresponds to the JSON property `simpleSegment`
1265
+ # @return [Google::Apis::AnalyticsreportingV4::SimpleSegment]
1266
+ attr_accessor :simple_segment
1247
1267
 
1248
1268
  def initialize(**args)
1249
1269
  update!(**args)
@@ -1251,20 +1271,22 @@ module Google
1251
1271
 
1252
1272
  # Update properties of this object
1253
1273
  def update!(**args)
1254
- @lifetime_value = args[:lifetime_value] if args.key?(:lifetime_value)
1255
- @cohorts = args[:cohorts] if args.key?(:cohorts)
1274
+ @sequence_segment = args[:sequence_segment] if args.key?(:sequence_segment)
1275
+ @not = args[:not] if args.key?(:not)
1276
+ @simple_segment = args[:simple_segment] if args.key?(:simple_segment)
1256
1277
  end
1257
1278
  end
1258
1279
 
1259
- # The main response class which holds the reports from the Reporting API
1260
- # `batchGet` call.
1261
- class GetReportsResponse
1280
+ # SegmentDefinition defines the segment to be a set of SegmentFilters which
1281
+ # are combined together with a logical `AND` operation.
1282
+ class SegmentDefinition
1262
1283
  include Google::Apis::Core::Hashable
1263
1284
 
1264
- # Responses corresponding to each of the request.
1265
- # Corresponds to the JSON property `reports`
1266
- # @return [Array<Google::Apis::AnalyticsreportingV4::Report>]
1267
- attr_accessor :reports
1285
+ # A segment is defined by a set of segment filters which are combined
1286
+ # together with a logical `AND` operation.
1287
+ # Corresponds to the JSON property `segmentFilters`
1288
+ # @return [Array<Google::Apis::AnalyticsreportingV4::SegmentFilter>]
1289
+ attr_accessor :segment_filters
1268
1290
 
1269
1291
  def initialize(**args)
1270
1292
  update!(**args)
@@ -1272,7 +1294,7 @@ module Google
1272
1294
 
1273
1295
  # Update properties of this object
1274
1296
  def update!(**args)
1275
- @reports = args[:reports] if args.key?(:reports)
1297
+ @segment_filters = args[:segment_filters] if args.key?(:segment_filters)
1276
1298
  end
1277
1299
  end
1278
1300
 
@@ -1280,131 +1302,101 @@ module Google
1280
1302
  class MetricHeaderEntry
1281
1303
  include Google::Apis::Core::Hashable
1282
1304
 
1283
- # The type of the metric, for example `INTEGER`.
1284
- # Corresponds to the JSON property `type`
1285
- # @return [String]
1286
- attr_accessor :type
1287
-
1288
1305
  # The name of the header.
1289
1306
  # Corresponds to the JSON property `name`
1290
1307
  # @return [String]
1291
1308
  attr_accessor :name
1292
1309
 
1310
+ # The type of the metric, for example `INTEGER`.
1311
+ # Corresponds to the JSON property `type`
1312
+ # @return [String]
1313
+ attr_accessor :type
1314
+
1293
1315
  def initialize(**args)
1294
1316
  update!(**args)
1295
1317
  end
1296
1318
 
1297
1319
  # Update properties of this object
1298
1320
  def update!(**args)
1299
- @type = args[:type] if args.key?(:type)
1300
1321
  @name = args[:name] if args.key?(:name)
1322
+ @type = args[:type] if args.key?(:type)
1301
1323
  end
1302
1324
  end
1303
1325
 
1304
- # MetricFilter specifies the filter on a metric.
1305
- class MetricFilter
1326
+ # The data part of the report.
1327
+ class ReportData
1306
1328
  include Google::Apis::Core::Hashable
1307
1329
 
1308
- # The metric that will be filtered on. A metricFilter must contain a metric
1309
- # name. A metric name can be an alias earlier defined as a metric or it can
1310
- # also be a metric expression.
1311
- # Corresponds to the JSON property `metricName`
1312
- # @return [String]
1313
- attr_accessor :metric_name
1314
-
1315
- # Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the
1316
- # comparisonValue, the default is `EQUAL`. If the operator is
1317
- # `IS_MISSING`, checks if the metric is missing and would ignore the
1318
- # comparisonValue.
1319
- # Corresponds to the JSON property `operator`
1320
- # @return [String]
1321
- attr_accessor :operator
1322
-
1323
- # The value to compare against.
1324
- # Corresponds to the JSON property `comparisonValue`
1325
- # @return [String]
1326
- attr_accessor :comparison_value
1327
-
1328
- # Logical `NOT` operator. If this boolean is set to true, then the matching
1329
- # metric values will be excluded in the report. The default is false.
1330
- # Corresponds to the JSON property `not`
1331
- # @return [Boolean]
1332
- attr_accessor :not
1333
- alias_method :not?, :not
1330
+ # For each requested date range, for the set of all rows that match
1331
+ # the query, every requested value format gets a total. The total
1332
+ # for a value format is computed by first totaling the metrics
1333
+ # mentioned in the value format and then evaluating the value
1334
+ # format as a scalar expression. E.g., The "totals" for
1335
+ # `3 / (ga:sessions + 2)` we compute
1336
+ # `3 / ((sum of all relevant ga:sessions) + 2)`.
1337
+ # Totals are computed before pagination.
1338
+ # Corresponds to the JSON property `totals`
1339
+ # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
1340
+ attr_accessor :totals
1334
1341
 
1335
- def initialize(**args)
1336
- update!(**args)
1337
- end
1342
+ # If the results are
1343
+ # [sampled](https://support.google.com/analytics/answer/2637192),
1344
+ # this returns the total number of samples read, one entry per date range.
1345
+ # If the results are not sampled this field will not be defined. See
1346
+ # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
1347
+ # for details.
1348
+ # Corresponds to the JSON property `samplesReadCounts`
1349
+ # @return [Array<String>]
1350
+ attr_accessor :samples_read_counts
1338
1351
 
1339
- # Update properties of this object
1340
- def update!(**args)
1341
- @metric_name = args[:metric_name] if args.key?(:metric_name)
1342
- @operator = args[:operator] if args.key?(:operator)
1343
- @comparison_value = args[:comparison_value] if args.key?(:comparison_value)
1344
- @not = args[:not] if args.key?(:not)
1345
- end
1346
- end
1352
+ # Total number of matching rows for this query.
1353
+ # Corresponds to the JSON property `rowCount`
1354
+ # @return [Fixnum]
1355
+ attr_accessor :row_count
1347
1356
 
1348
- # [Dimensions](https://support.google.com/analytics/answer/1033861)
1349
- # are attributes of your data. For example, the dimension `ga:city`
1350
- # indicates the city, for example, "Paris" or "New York", from which
1351
- # a session originates.
1352
- class Dimension
1353
- include Google::Apis::Core::Hashable
1357
+ # There's one ReportRow for every unique combination of dimensions.
1358
+ # Corresponds to the JSON property `rows`
1359
+ # @return [Array<Google::Apis::AnalyticsreportingV4::ReportRow>]
1360
+ attr_accessor :rows
1354
1361
 
1355
- # If non-empty, we place dimension values into buckets after string to
1356
- # int64. Dimension values that are not the string representation of an
1357
- # integral value will be converted to zero. The bucket values have to be in
1358
- # increasing order. Each bucket is closed on the lower end, and open on the
1359
- # upper end. The "first" bucket includes all values less than the first
1360
- # boundary, the "last" bucket includes all values up to infinity. Dimension
1361
- # values that fall in a bucket get transformed to a new dimension value. For
1362
- # example, if one gives a list of "0, 1, 3, 4, 7", then we return the
1363
- # following buckets:
1364
- # - bucket #1: values < 0, dimension value "<0"
1365
- # - bucket #2: values in [0,1), dimension value "0"
1366
- # - bucket #3: values in [1,3), dimension value "1-2"
1367
- # - bucket #4: values in [3,4), dimension value "3"
1368
- # - bucket #5: values in [4,7), dimension value "4-6"
1369
- # - bucket #6: values >= 7, dimension value "7+"
1370
- # NOTE: If you are applying histogram mutation on any dimension, and using
1371
- # that dimension in sort, you will want to use the sort type
1372
- # `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values
1373
- # will be sorted according to dictionary
1374
- # (lexicographic) order. For example the ascending dictionary order is:
1375
- # "<50", "1001+", "121-1000", "50-120"
1376
- # And the ascending `HISTOGRAM_BUCKET` order is:
1377
- # "<50", "50-120", "121-1000", "1001+"
1378
- # The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"`
1379
- # for a histogram-mutated dimension.
1380
- # Corresponds to the JSON property `histogramBuckets`
1381
- # @return [Array<String>]
1382
- attr_accessor :histogram_buckets
1362
+ # Indicates if response to this request is golden or not. Data is
1363
+ # golden when the exact same request will not produce any new results if
1364
+ # asked at a later point in time.
1365
+ # Corresponds to the JSON property `isDataGolden`
1366
+ # @return [Boolean]
1367
+ attr_accessor :is_data_golden
1368
+ alias_method :is_data_golden?, :is_data_golden
1383
1369
 
1384
- # Name of the dimension to fetch, for example `ga:browser`.
1385
- # Corresponds to the JSON property `name`
1370
+ # The last time the data in the report was refreshed. All the hits received
1371
+ # before this timestamp are included in the calculation of the report.
1372
+ # Corresponds to the JSON property `dataLastRefreshed`
1386
1373
  # @return [String]
1387
- attr_accessor :name
1388
-
1389
- def initialize(**args)
1390
- update!(**args)
1391
- end
1392
-
1393
- # Update properties of this object
1394
- def update!(**args)
1395
- @histogram_buckets = args[:histogram_buckets] if args.key?(:histogram_buckets)
1396
- @name = args[:name] if args.key?(:name)
1397
- end
1398
- end
1374
+ attr_accessor :data_last_refreshed
1399
1375
 
1400
- # The metric values in the pivot region.
1401
- class PivotValueRegion
1402
- include Google::Apis::Core::Hashable
1376
+ # Minimum and maximum values seen over all matching rows. These are both
1377
+ # empty when `hideValueRanges` in the request is false, or when
1378
+ # rowCount is zero.
1379
+ # Corresponds to the JSON property `maximums`
1380
+ # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
1381
+ attr_accessor :maximums
1403
1382
 
1404
- # The values of the metrics in each of the pivot regions.
1405
- # Corresponds to the JSON property `values`
1383
+ # If the results are
1384
+ # [sampled](https://support.google.com/analytics/answer/2637192),
1385
+ # this returns the total number of
1386
+ # samples present, one entry per date range. If the results are not sampled
1387
+ # this field will not be defined. See
1388
+ # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
1389
+ # for details.
1390
+ # Corresponds to the JSON property `samplingSpaceSizes`
1406
1391
  # @return [Array<String>]
1407
- attr_accessor :values
1392
+ attr_accessor :sampling_space_sizes
1393
+
1394
+ # Minimum and maximum values seen over all matching rows. These are both
1395
+ # empty when `hideValueRanges` in the request is false, or when
1396
+ # rowCount is zero.
1397
+ # Corresponds to the JSON property `minimums`
1398
+ # @return [Array<Google::Apis::AnalyticsreportingV4::DateRangeValues>]
1399
+ attr_accessor :minimums
1408
1400
 
1409
1401
  def initialize(**args)
1410
1402
  update!(**args)
@@ -1412,7 +1404,15 @@ module Google
1412
1404
 
1413
1405
  # Update properties of this object
1414
1406
  def update!(**args)
1415
- @values = args[:values] if args.key?(:values)
1407
+ @totals = args[:totals] if args.key?(:totals)
1408
+ @samples_read_counts = args[:samples_read_counts] if args.key?(:samples_read_counts)
1409
+ @row_count = args[:row_count] if args.key?(:row_count)
1410
+ @rows = args[:rows] if args.key?(:rows)
1411
+ @is_data_golden = args[:is_data_golden] if args.key?(:is_data_golden)
1412
+ @data_last_refreshed = args[:data_last_refreshed] if args.key?(:data_last_refreshed)
1413
+ @maximums = args[:maximums] if args.key?(:maximums)
1414
+ @sampling_space_sizes = args[:sampling_space_sizes] if args.key?(:sampling_space_sizes)
1415
+ @minimums = args[:minimums] if args.key?(:minimums)
1416
1416
  end
1417
1417
  end
1418
1418
  end