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