OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.analyticsreporting.v4; | 3 library googleapis.analyticsreporting.v4; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client analyticsreporting/v4'; | 15 const core.String USER_AGENT = 'dart-api-client analyticsreporting/v4'; |
16 | 16 |
17 /** Accesses Analytics report data. */ | 17 /// Accesses Analytics report data. |
18 class AnalyticsreportingApi { | 18 class AnalyticsreportingApi { |
19 /** View and manage your Google Analytics data */ | 19 /// View and manage your Google Analytics data |
20 static const AnalyticsScope = "https://www.googleapis.com/auth/analytics"; | 20 static const AnalyticsScope = "https://www.googleapis.com/auth/analytics"; |
21 | 21 |
22 /** View your Google Analytics data */ | 22 /// View your Google Analytics data |
23 static const AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analyti
cs.readonly"; | 23 static const AnalyticsReadonlyScope = |
24 | 24 "https://www.googleapis.com/auth/analytics.readonly"; |
25 | 25 |
26 final commons.ApiRequester _requester; | 26 final commons.ApiRequester _requester; |
27 | 27 |
28 ReportsResourceApi get reports => new ReportsResourceApi(_requester); | 28 ReportsResourceApi get reports => new ReportsResourceApi(_requester); |
29 | 29 |
30 AnalyticsreportingApi(http.Client client, {core.String rootUrl: "https://analy
ticsreporting.googleapis.com/", core.String servicePath: ""}) : | 30 AnalyticsreportingApi(http.Client client, |
31 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 31 {core.String rootUrl: "https://analyticsreporting.googleapis.com/", |
| 32 core.String servicePath: ""}) |
| 33 : _requester = |
| 34 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
32 } | 35 } |
33 | 36 |
34 | |
35 class ReportsResourceApi { | 37 class ReportsResourceApi { |
36 final commons.ApiRequester _requester; | 38 final commons.ApiRequester _requester; |
37 | 39 |
38 ReportsResourceApi(commons.ApiRequester client) : | 40 ReportsResourceApi(commons.ApiRequester client) : _requester = client; |
39 _requester = client; | |
40 | 41 |
41 /** | 42 /// Returns the Analytics data. |
42 * Returns the Analytics data. | 43 /// |
43 * | 44 /// [request] - The metadata request object. |
44 * [request] - The metadata request object. | 45 /// |
45 * | 46 /// Request parameters: |
46 * Request parameters: | 47 /// |
47 * | 48 /// Completes with a [GetReportsResponse]. |
48 * Completes with a [GetReportsResponse]. | 49 /// |
49 * | 50 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
50 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 51 /// an error. |
51 * error. | 52 /// |
52 * | 53 /// If the used [http.Client] completes with an error when making a REST |
53 * If the used [http.Client] completes with an error when making a REST call, | 54 /// call, this method will complete with the same error. |
54 * this method will complete with the same error. | |
55 */ | |
56 async.Future<GetReportsResponse> batchGet(GetReportsRequest request) { | 55 async.Future<GetReportsResponse> batchGet(GetReportsRequest request) { |
57 var _url = null; | 56 var _url = null; |
58 var _queryParams = new core.Map(); | 57 var _queryParams = new core.Map(); |
59 var _uploadMedia = null; | 58 var _uploadMedia = null; |
60 var _uploadOptions = null; | 59 var _uploadOptions = null; |
61 var _downloadOptions = commons.DownloadOptions.Metadata; | 60 var _downloadOptions = commons.DownloadOptions.Metadata; |
62 var _body = null; | 61 var _body = null; |
63 | 62 |
64 if (request != null) { | 63 if (request != null) { |
65 _body = convert.JSON.encode((request).toJson()); | 64 _body = convert.JSON.encode((request).toJson()); |
66 } | 65 } |
67 | 66 |
68 _url = 'v4/reports:batchGet'; | 67 _url = 'v4/reports:batchGet'; |
69 | 68 |
70 var _response = _requester.request(_url, | 69 var _response = _requester.request(_url, "POST", |
71 "POST", | 70 body: _body, |
72 body: _body, | 71 queryParams: _queryParams, |
73 queryParams: _queryParams, | 72 uploadOptions: _uploadOptions, |
74 uploadOptions: _uploadOptions, | 73 uploadMedia: _uploadMedia, |
75 uploadMedia: _uploadMedia, | 74 downloadOptions: _downloadOptions); |
76 downloadOptions: _downloadOptions); | |
77 return _response.then((data) => new GetReportsResponse.fromJson(data)); | 75 return _response.then((data) => new GetReportsResponse.fromJson(data)); |
78 } | 76 } |
79 | |
80 } | 77 } |
81 | 78 |
| 79 /// Defines a cohort. A cohort is a group of users who share a common |
| 80 /// characteristic. For example, all users with the same acquisition date |
| 81 /// belong to the same cohort. |
| 82 class Cohort { |
| 83 /// This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users |
| 84 /// whose first visit date is between start date and end date defined in the |
| 85 /// DateRange. The date ranges should be aligned for cohort requests. If the |
| 86 /// request contains `ga:cohortNthDay` it should be exactly one day long, |
| 87 /// if `ga:cohortNthWeek` it should be aligned to the week boundary (starting |
| 88 /// at Sunday and ending Saturday), and for `ga:cohortNthMonth` the date |
| 89 /// range |
| 90 /// should be aligned to the month (starting at the first and ending on the |
| 91 /// last day of the month). |
| 92 /// For LTV requests there are no such restrictions. |
| 93 /// You do not need to supply a date range for the |
| 94 /// `reportsRequest.dateRanges` field. |
| 95 DateRange dateRange; |
82 | 96 |
| 97 /// A unique name for the cohort. If not defined name will be auto-generated |
| 98 /// with values cohort_[1234...]. |
| 99 core.String name; |
83 | 100 |
84 /** | 101 /// Type of the cohort. The only supported type as of now is |
85 * Defines a cohort. A cohort is a group of users who share a common | 102 /// `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated |
86 * characteristic. For example, all users with the same acquisition date | 103 /// as `FIRST_VISIT_DATE` type cohort. |
87 * belong to the same cohort. | 104 /// Possible string values are: |
88 */ | 105 /// - "UNSPECIFIED_COHORT_TYPE" : If unspecified it's treated as |
89 class Cohort { | 106 /// `FIRST_VISIT_DATE`. |
90 /** | 107 /// - "FIRST_VISIT_DATE" : Cohorts that are selected based on first visit |
91 * This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users | 108 /// date. |
92 * whose first visit date is between start date and end date defined in the | |
93 * DateRange. The date ranges should be aligned for cohort requests. If the | |
94 * request contains `ga:cohortNthDay` it should be exactly one day long, | |
95 * if `ga:cohortNthWeek` it should be aligned to the week boundary (starting | |
96 * at Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range | |
97 * should be aligned to the month (starting at the first and ending on the | |
98 * last day of the month). | |
99 * For LTV requests there are no such restrictions. | |
100 * You do not need to supply a date range for the | |
101 * `reportsRequest.dateRanges` field. | |
102 */ | |
103 DateRange dateRange; | |
104 /** | |
105 * A unique name for the cohort. If not defined name will be auto-generated | |
106 * with values cohort_[1234...]. | |
107 */ | |
108 core.String name; | |
109 /** | |
110 * Type of the cohort. The only supported type as of now is | |
111 * `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated | |
112 * as `FIRST_VISIT_DATE` type cohort. | |
113 * Possible string values are: | |
114 * - "UNSPECIFIED_COHORT_TYPE" : If unspecified it's treated as | |
115 * `FIRST_VISIT_DATE`. | |
116 * - "FIRST_VISIT_DATE" : Cohorts that are selected based on first visit date. | |
117 */ | |
118 core.String type; | 109 core.String type; |
119 | 110 |
120 Cohort(); | 111 Cohort(); |
121 | 112 |
122 Cohort.fromJson(core.Map _json) { | 113 Cohort.fromJson(core.Map _json) { |
123 if (_json.containsKey("dateRange")) { | 114 if (_json.containsKey("dateRange")) { |
124 dateRange = new DateRange.fromJson(_json["dateRange"]); | 115 dateRange = new DateRange.fromJson(_json["dateRange"]); |
125 } | 116 } |
126 if (_json.containsKey("name")) { | 117 if (_json.containsKey("name")) { |
127 name = _json["name"]; | 118 name = _json["name"]; |
128 } | 119 } |
129 if (_json.containsKey("type")) { | 120 if (_json.containsKey("type")) { |
130 type = _json["type"]; | 121 type = _json["type"]; |
131 } | 122 } |
132 } | 123 } |
133 | 124 |
134 core.Map<core.String, core.Object> toJson() { | 125 core.Map<core.String, core.Object> toJson() { |
135 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 126 final core.Map<core.String, core.Object> _json = |
| 127 new core.Map<core.String, core.Object>(); |
136 if (dateRange != null) { | 128 if (dateRange != null) { |
137 _json["dateRange"] = (dateRange).toJson(); | 129 _json["dateRange"] = (dateRange).toJson(); |
138 } | 130 } |
139 if (name != null) { | 131 if (name != null) { |
140 _json["name"] = name; | 132 _json["name"] = name; |
141 } | 133 } |
142 if (type != null) { | 134 if (type != null) { |
143 _json["type"] = type; | 135 _json["type"] = type; |
144 } | 136 } |
145 return _json; | 137 return _json; |
146 } | 138 } |
147 } | 139 } |
148 | 140 |
149 /** | 141 /// Defines a cohort group. |
150 * Defines a cohort group. | 142 /// For example: |
151 * For example: | 143 /// |
152 * | 144 /// "cohortGroup": { |
153 * "cohortGroup": { | 145 /// "cohorts": [{ |
154 * "cohorts": [{ | 146 /// "name": "cohort 1", |
155 * "name": "cohort 1", | 147 /// "type": "FIRST_VISIT_DATE", |
156 * "type": "FIRST_VISIT_DATE", | 148 /// "dateRange": { "startDate": "2015-08-01", "endDate": "2015-08-01" } |
157 * "dateRange": { "startDate": "2015-08-01", "endDate": "2015-08-01" } | 149 /// },{ |
158 * },{ | 150 /// "name": "cohort 2" |
159 * "name": "cohort 2" | 151 /// "type": "FIRST_VISIT_DATE" |
160 * "type": "FIRST_VISIT_DATE" | 152 /// "dateRange": { "startDate": "2015-07-01", "endDate": "2015-07-01" } |
161 * "dateRange": { "startDate": "2015-07-01", "endDate": "2015-07-01" } | 153 /// }] |
162 * }] | 154 /// } |
163 * } | |
164 */ | |
165 class CohortGroup { | 155 class CohortGroup { |
166 /** The definition for the cohort. */ | 156 /// The definition for the cohort. |
167 core.List<Cohort> cohorts; | 157 core.List<Cohort> cohorts; |
168 /** | 158 |
169 * Enable Life Time Value (LTV). LTV measures lifetime value for users | 159 /// Enable Life Time Value (LTV). LTV measures lifetime value for users |
170 * acquired through different channels. | 160 /// acquired through different channels. |
171 * Please see: | 161 /// Please see: |
172 * [Cohort Analysis](https://support.google.com/analytics/answer/6074676) and | 162 /// [Cohort Analysis](https://support.google.com/analytics/answer/6074676) |
173 * [Lifetime Value](https://support.google.com/analytics/answer/6182550) | 163 /// and |
174 * If the value of lifetimeValue is false: | 164 /// [Lifetime Value](https://support.google.com/analytics/answer/6182550) |
175 * | 165 /// If the value of lifetimeValue is false: |
176 * - The metric values are similar to the values in the web interface cohort | 166 /// |
177 * report. | 167 /// - The metric values are similar to the values in the web interface cohort |
178 * - The cohort definition date ranges must be aligned to the calendar week | 168 /// report. |
179 * and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in | 169 /// - The cohort definition date ranges must be aligned to the calendar week |
180 * the cohort definition should be a Sunday and the `endDate` should be the | 170 /// and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in |
181 * following Saturday, and for `ga:cohortNthMonth`, the `startDate` | 171 /// the cohort definition should be a Sunday and the `endDate` should be the |
182 * should be the 1st of the month and `endDate` should be the last day | 172 /// following Saturday, and for `ga:cohortNthMonth`, the `startDate` |
183 * of the month. | 173 /// should be the 1st of the month and `endDate` should be the last day |
184 * | 174 /// of the month. |
185 * When the lifetimeValue is true: | 175 /// |
186 * | 176 /// When the lifetimeValue is true: |
187 * - The metric values will correspond to the values in the web interface | 177 /// |
188 * LifeTime value report. | 178 /// - The metric values will correspond to the values in the web interface |
189 * - The Lifetime Value report shows you how user value (Revenue) and | 179 /// LifeTime value report. |
190 * engagement (Appviews, Goal Completions, Sessions, and Session Duration) | 180 /// - The Lifetime Value report shows you how user value (Revenue) and |
191 * grow during the 90 days after a user is acquired. | 181 /// engagement (Appviews, Goal Completions, Sessions, and Session Duration) |
192 * - The metrics are calculated as a cumulative average per user per the time | 182 /// grow during the 90 days after a user is acquired. |
193 * increment. | 183 /// - The metrics are calculated as a cumulative average per user per the |
194 * - The cohort definition date ranges need not be aligned to the calendar | 184 /// time |
195 * week and month boundaries. | 185 /// increment. |
196 * - The `viewId` must be an | 186 /// - The cohort definition date ranges need not be aligned to the calendar |
197 * [app view | 187 /// week and month boundaries. |
198 * ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) | 188 /// - The `viewId` must be an |
199 */ | 189 /// [app view |
| 190 /// ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) |
200 core.bool lifetimeValue; | 191 core.bool lifetimeValue; |
201 | 192 |
202 CohortGroup(); | 193 CohortGroup(); |
203 | 194 |
204 CohortGroup.fromJson(core.Map _json) { | 195 CohortGroup.fromJson(core.Map _json) { |
205 if (_json.containsKey("cohorts")) { | 196 if (_json.containsKey("cohorts")) { |
206 cohorts = _json["cohorts"].map((value) => new Cohort.fromJson(value)).toLi
st(); | 197 cohorts = |
| 198 _json["cohorts"].map((value) => new Cohort.fromJson(value)).toList(); |
207 } | 199 } |
208 if (_json.containsKey("lifetimeValue")) { | 200 if (_json.containsKey("lifetimeValue")) { |
209 lifetimeValue = _json["lifetimeValue"]; | 201 lifetimeValue = _json["lifetimeValue"]; |
210 } | 202 } |
211 } | 203 } |
212 | 204 |
213 core.Map<core.String, core.Object> toJson() { | 205 core.Map<core.String, core.Object> toJson() { |
214 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 206 final core.Map<core.String, core.Object> _json = |
| 207 new core.Map<core.String, core.Object>(); |
215 if (cohorts != null) { | 208 if (cohorts != null) { |
216 _json["cohorts"] = cohorts.map((value) => (value).toJson()).toList(); | 209 _json["cohorts"] = cohorts.map((value) => (value).toJson()).toList(); |
217 } | 210 } |
218 if (lifetimeValue != null) { | 211 if (lifetimeValue != null) { |
219 _json["lifetimeValue"] = lifetimeValue; | 212 _json["lifetimeValue"] = lifetimeValue; |
220 } | 213 } |
221 return _json; | 214 return _json; |
222 } | 215 } |
223 } | 216 } |
224 | 217 |
225 /** Column headers. */ | 218 /// Column headers. |
226 class ColumnHeader { | 219 class ColumnHeader { |
227 /** The dimension names in the response. */ | 220 /// The dimension names in the response. |
228 core.List<core.String> dimensions; | 221 core.List<core.String> dimensions; |
229 /** Metric headers for the metrics in the response. */ | 222 |
| 223 /// Metric headers for the metrics in the response. |
230 MetricHeader metricHeader; | 224 MetricHeader metricHeader; |
231 | 225 |
232 ColumnHeader(); | 226 ColumnHeader(); |
233 | 227 |
234 ColumnHeader.fromJson(core.Map _json) { | 228 ColumnHeader.fromJson(core.Map _json) { |
235 if (_json.containsKey("dimensions")) { | 229 if (_json.containsKey("dimensions")) { |
236 dimensions = _json["dimensions"]; | 230 dimensions = _json["dimensions"]; |
237 } | 231 } |
238 if (_json.containsKey("metricHeader")) { | 232 if (_json.containsKey("metricHeader")) { |
239 metricHeader = new MetricHeader.fromJson(_json["metricHeader"]); | 233 metricHeader = new MetricHeader.fromJson(_json["metricHeader"]); |
240 } | 234 } |
241 } | 235 } |
242 | 236 |
243 core.Map<core.String, core.Object> toJson() { | 237 core.Map<core.String, core.Object> toJson() { |
244 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 238 final core.Map<core.String, core.Object> _json = |
| 239 new core.Map<core.String, core.Object>(); |
245 if (dimensions != null) { | 240 if (dimensions != null) { |
246 _json["dimensions"] = dimensions; | 241 _json["dimensions"] = dimensions; |
247 } | 242 } |
248 if (metricHeader != null) { | 243 if (metricHeader != null) { |
249 _json["metricHeader"] = (metricHeader).toJson(); | 244 _json["metricHeader"] = (metricHeader).toJson(); |
250 } | 245 } |
251 return _json; | 246 return _json; |
252 } | 247 } |
253 } | 248 } |
254 | 249 |
255 /** | 250 /// A contiguous set of days: startDate, startDate + 1 day, ..., endDate. |
256 * A contiguous set of days: startDate, startDate + 1 day, ..., endDate. | 251 /// The start and end dates are specified in |
257 * The start and end dates are specified in | 252 /// [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`. |
258 * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`. | |
259 */ | |
260 class DateRange { | 253 class DateRange { |
261 /** The end date for the query in the format `YYYY-MM-DD`. */ | 254 /// The end date for the query in the format `YYYY-MM-DD`. |
262 core.String endDate; | 255 core.String endDate; |
263 /** The start date for the query in the format `YYYY-MM-DD`. */ | 256 |
| 257 /// The start date for the query in the format `YYYY-MM-DD`. |
264 core.String startDate; | 258 core.String startDate; |
265 | 259 |
266 DateRange(); | 260 DateRange(); |
267 | 261 |
268 DateRange.fromJson(core.Map _json) { | 262 DateRange.fromJson(core.Map _json) { |
269 if (_json.containsKey("endDate")) { | 263 if (_json.containsKey("endDate")) { |
270 endDate = _json["endDate"]; | 264 endDate = _json["endDate"]; |
271 } | 265 } |
272 if (_json.containsKey("startDate")) { | 266 if (_json.containsKey("startDate")) { |
273 startDate = _json["startDate"]; | 267 startDate = _json["startDate"]; |
274 } | 268 } |
275 } | 269 } |
276 | 270 |
277 core.Map<core.String, core.Object> toJson() { | 271 core.Map<core.String, core.Object> toJson() { |
278 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 272 final core.Map<core.String, core.Object> _json = |
| 273 new core.Map<core.String, core.Object>(); |
279 if (endDate != null) { | 274 if (endDate != null) { |
280 _json["endDate"] = endDate; | 275 _json["endDate"] = endDate; |
281 } | 276 } |
282 if (startDate != null) { | 277 if (startDate != null) { |
283 _json["startDate"] = startDate; | 278 _json["startDate"] = startDate; |
284 } | 279 } |
285 return _json; | 280 return _json; |
286 } | 281 } |
287 } | 282 } |
288 | 283 |
289 /** | 284 /// Used to return a list of metrics for a single DateRange / dimension |
290 * Used to return a list of metrics for a single DateRange / dimension | 285 /// combination |
291 * combination | |
292 */ | |
293 class DateRangeValues { | 286 class DateRangeValues { |
294 /** The values of each pivot region. */ | 287 /// The values of each pivot region. |
295 core.List<PivotValueRegion> pivotValueRegions; | 288 core.List<PivotValueRegion> pivotValueRegions; |
296 /** Each value corresponds to each Metric in the request. */ | 289 |
| 290 /// Each value corresponds to each Metric in the request. |
297 core.List<core.String> values; | 291 core.List<core.String> values; |
298 | 292 |
299 DateRangeValues(); | 293 DateRangeValues(); |
300 | 294 |
301 DateRangeValues.fromJson(core.Map _json) { | 295 DateRangeValues.fromJson(core.Map _json) { |
302 if (_json.containsKey("pivotValueRegions")) { | 296 if (_json.containsKey("pivotValueRegions")) { |
303 pivotValueRegions = _json["pivotValueRegions"].map((value) => new PivotVal
ueRegion.fromJson(value)).toList(); | 297 pivotValueRegions = _json["pivotValueRegions"] |
| 298 .map((value) => new PivotValueRegion.fromJson(value)) |
| 299 .toList(); |
304 } | 300 } |
305 if (_json.containsKey("values")) { | 301 if (_json.containsKey("values")) { |
306 values = _json["values"]; | 302 values = _json["values"]; |
307 } | 303 } |
308 } | 304 } |
309 | 305 |
310 core.Map<core.String, core.Object> toJson() { | 306 core.Map<core.String, core.Object> toJson() { |
311 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 307 final core.Map<core.String, core.Object> _json = |
| 308 new core.Map<core.String, core.Object>(); |
312 if (pivotValueRegions != null) { | 309 if (pivotValueRegions != null) { |
313 _json["pivotValueRegions"] = pivotValueRegions.map((value) => (value).toJs
on()).toList(); | 310 _json["pivotValueRegions"] = |
| 311 pivotValueRegions.map((value) => (value).toJson()).toList(); |
314 } | 312 } |
315 if (values != null) { | 313 if (values != null) { |
316 _json["values"] = values; | 314 _json["values"] = values; |
317 } | 315 } |
318 return _json; | 316 return _json; |
319 } | 317 } |
320 } | 318 } |
321 | 319 |
322 /** | 320 /// [Dimensions](https://support.google.com/analytics/answer/1033861) |
323 * [Dimensions](https://support.google.com/analytics/answer/1033861) | 321 /// are attributes of your data. For example, the dimension `ga:city` |
324 * are attributes of your data. For example, the dimension `ga:city` | 322 /// indicates the city, for example, "Paris" or "New York", from which |
325 * indicates the city, for example, "Paris" or "New York", from which | 323 /// a session originates. |
326 * a session originates. | |
327 */ | |
328 class Dimension { | 324 class Dimension { |
329 /** | 325 /// If non-empty, we place dimension values into buckets after string to |
330 * If non-empty, we place dimension values into buckets after string to | 326 /// int64. Dimension values that are not the string representation of an |
331 * int64. Dimension values that are not the string representation of an | 327 /// integral value will be converted to zero. The bucket values have to be |
332 * integral value will be converted to zero. The bucket values have to be in | 328 /// in |
333 * increasing order. Each bucket is closed on the lower end, and open on the | 329 /// increasing order. Each bucket is closed on the lower end, and open on |
334 * upper end. The "first" bucket includes all values less than the first | 330 /// the |
335 * boundary, the "last" bucket includes all values up to infinity. Dimension | 331 /// upper end. The "first" bucket includes all values less than the first |
336 * values that fall in a bucket get transformed to a new dimension value. For | 332 /// boundary, the "last" bucket includes all values up to infinity. Dimension |
337 * example, if one gives a list of "0, 1, 3, 4, 7", then we return the | 333 /// values that fall in a bucket get transformed to a new dimension value. |
338 * following buckets: | 334 /// For |
339 * | 335 /// example, if one gives a list of "0, 1, 3, 4, 7", then we return the |
340 * - bucket #1: values < 0, dimension value "<0" | 336 /// following buckets: |
341 * - bucket #2: values in [0,1), dimension value "0" | 337 /// |
342 * - bucket #3: values in [1,3), dimension value "1-2" | 338 /// - bucket #1: values < 0, dimension value "<0" |
343 * - bucket #4: values in [3,4), dimension value "3" | 339 /// - bucket #2: values in [0,1), dimension value "0" |
344 * - bucket #5: values in [4,7), dimension value "4-6" | 340 /// - bucket #3: values in [1,3), dimension value "1-2" |
345 * - bucket #6: values >= 7, dimension value "7+" | 341 /// - bucket #4: values in [3,4), dimension value "3" |
346 * | 342 /// - bucket #5: values in [4,7), dimension value "4-6" |
347 * NOTE: If you are applying histogram mutation on any dimension, and using | 343 /// - bucket #6: values >= 7, dimension value "7+" |
348 * that dimension in sort, you will want to use the sort type | 344 /// |
349 * `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values | 345 /// NOTE: If you are applying histogram mutation on any dimension, and using |
350 * will be sorted according to dictionary | 346 /// that dimension in sort, you will want to use the sort type |
351 * (lexicographic) order. For example the ascending dictionary order is: | 347 /// `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values |
352 * | 348 /// will be sorted according to dictionary |
353 * "<50", "1001+", "121-1000", "50-120" | 349 /// (lexicographic) order. For example the ascending dictionary order is: |
354 * | 350 /// |
355 * And the ascending `HISTOGRAM_BUCKET` order is: | 351 /// "<50", "1001+", "121-1000", "50-120" |
356 * | 352 /// |
357 * "<50", "50-120", "121-1000", "1001+" | 353 /// And the ascending `HISTOGRAM_BUCKET` order is: |
358 * | 354 /// |
359 * The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"` | 355 /// "<50", "50-120", "121-1000", "1001+" |
360 * for a histogram-mutated dimension. | 356 /// |
361 */ | 357 /// The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"` |
| 358 /// for a histogram-mutated dimension. |
362 core.List<core.String> histogramBuckets; | 359 core.List<core.String> histogramBuckets; |
363 /** Name of the dimension to fetch, for example `ga:browser`. */ | 360 |
| 361 /// Name of the dimension to fetch, for example `ga:browser`. |
364 core.String name; | 362 core.String name; |
365 | 363 |
366 Dimension(); | 364 Dimension(); |
367 | 365 |
368 Dimension.fromJson(core.Map _json) { | 366 Dimension.fromJson(core.Map _json) { |
369 if (_json.containsKey("histogramBuckets")) { | 367 if (_json.containsKey("histogramBuckets")) { |
370 histogramBuckets = _json["histogramBuckets"]; | 368 histogramBuckets = _json["histogramBuckets"]; |
371 } | 369 } |
372 if (_json.containsKey("name")) { | 370 if (_json.containsKey("name")) { |
373 name = _json["name"]; | 371 name = _json["name"]; |
374 } | 372 } |
375 } | 373 } |
376 | 374 |
377 core.Map<core.String, core.Object> toJson() { | 375 core.Map<core.String, core.Object> toJson() { |
378 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 376 final core.Map<core.String, core.Object> _json = |
| 377 new core.Map<core.String, core.Object>(); |
379 if (histogramBuckets != null) { | 378 if (histogramBuckets != null) { |
380 _json["histogramBuckets"] = histogramBuckets; | 379 _json["histogramBuckets"] = histogramBuckets; |
381 } | 380 } |
382 if (name != null) { | 381 if (name != null) { |
383 _json["name"] = name; | 382 _json["name"] = name; |
384 } | 383 } |
385 return _json; | 384 return _json; |
386 } | 385 } |
387 } | 386 } |
388 | 387 |
389 /** Dimension filter specifies the filtering options on a dimension. */ | 388 /// Dimension filter specifies the filtering options on a dimension. |
390 class DimensionFilter { | 389 class DimensionFilter { |
391 /** Should the match be case sensitive? Default is false. */ | 390 /// Should the match be case sensitive? Default is false. |
392 core.bool caseSensitive; | 391 core.bool caseSensitive; |
393 /** | 392 |
394 * The dimension to filter on. A DimensionFilter must contain a dimension. | 393 /// The dimension to filter on. A DimensionFilter must contain a dimension. |
395 */ | |
396 core.String dimensionName; | 394 core.String dimensionName; |
397 /** | 395 |
398 * Strings or regular expression to match against. Only the first value of | 396 /// Strings or regular expression to match against. Only the first value of |
399 * the list is used for comparison unless the operator is `IN_LIST`. | 397 /// the list is used for comparison unless the operator is `IN_LIST`. |
400 * If `IN_LIST` operator, then the entire list is used to filter the | 398 /// If `IN_LIST` operator, then the entire list is used to filter the |
401 * dimensions as explained in the description of the `IN_LIST` operator. | 399 /// dimensions as explained in the description of the `IN_LIST` operator. |
402 */ | |
403 core.List<core.String> expressions; | 400 core.List<core.String> expressions; |
404 /** | 401 |
405 * Logical `NOT` operator. If this boolean is set to true, then the matching | 402 /// Logical `NOT` operator. If this boolean is set to true, then the matching |
406 * dimension values will be excluded in the report. The default is false. | 403 /// dimension values will be excluded in the report. The default is false. |
407 */ | |
408 core.bool not; | 404 core.bool not; |
409 /** | 405 |
410 * How to match the dimension to the expression. The default is REGEXP. | 406 /// How to match the dimension to the expression. The default is REGEXP. |
411 * Possible string values are: | 407 /// Possible string values are: |
412 * - "OPERATOR_UNSPECIFIED" : If the match type is unspecified, it is treated | 408 /// - "OPERATOR_UNSPECIFIED" : If the match type is unspecified, it is |
413 * as a `REGEXP`. | 409 /// treated as a `REGEXP`. |
414 * - "REGEXP" : The match expression is treated as a regular expression. All | 410 /// - "REGEXP" : The match expression is treated as a regular expression. All |
415 * match types | 411 /// match types |
416 * are not treated as regular expressions. | 412 /// are not treated as regular expressions. |
417 * - "BEGINS_WITH" : Matches the value which begin with the match expression | 413 /// - "BEGINS_WITH" : Matches the value which begin with the match expression |
418 * provided. | 414 /// provided. |
419 * - "ENDS_WITH" : Matches the values which end with the match expression | 415 /// - "ENDS_WITH" : Matches the values which end with the match expression |
420 * provided. | 416 /// provided. |
421 * - "PARTIAL" : Substring match. | 417 /// - "PARTIAL" : Substring match. |
422 * - "EXACT" : The value should match the match expression entirely. | 418 /// - "EXACT" : The value should match the match expression entirely. |
423 * - "NUMERIC_EQUAL" : Integer comparison filters. | 419 /// - "NUMERIC_EQUAL" : Integer comparison filters. |
424 * case sensitivity is ignored for these and the expression | 420 /// case sensitivity is ignored for these and the expression |
425 * is assumed to be a string representing an integer. | 421 /// is assumed to be a string representing an integer. |
426 * Failure conditions: | 422 /// Failure conditions: |
427 * | 423 /// |
428 * - If expression is not a valid int64, the client should expect | 424 /// - If expression is not a valid int64, the client should expect |
429 * an error. | 425 /// an error. |
430 * - Input dimensions that are not valid int64 values will never match the | 426 /// - Input dimensions that are not valid int64 values will never match the |
431 * filter. | 427 /// filter. |
432 * - "NUMERIC_GREATER_THAN" : Checks if the dimension is numerically greater | 428 /// - "NUMERIC_GREATER_THAN" : Checks if the dimension is numerically greater |
433 * than the match | 429 /// than the match |
434 * expression. Read the description for `NUMERIC_EQUALS` for restrictions. | 430 /// expression. Read the description for `NUMERIC_EQUALS` for restrictions. |
435 * - "NUMERIC_LESS_THAN" : Checks if the dimension is numerically less than | 431 /// - "NUMERIC_LESS_THAN" : Checks if the dimension is numerically less than |
436 * the match expression. | 432 /// the match expression. |
437 * Read the description for `NUMERIC_EQUALS` for restrictions. | 433 /// Read the description for `NUMERIC_EQUALS` for restrictions. |
438 * - "IN_LIST" : This option is used to specify a dimension filter whose | 434 /// - "IN_LIST" : This option is used to specify a dimension filter whose |
439 * expression can | 435 /// expression can |
440 * take any value from a selected list of values. This helps avoiding | 436 /// take any value from a selected list of values. This helps avoiding |
441 * evaluating multiple exact match dimension filters which are OR'ed for | 437 /// evaluating multiple exact match dimension filters which are OR'ed for |
442 * every single response row. For example: | 438 /// every single response row. For example: |
443 * | 439 /// |
444 * expressions: ["A", "B", "C"] | 440 /// expressions: ["A", "B", "C"] |
445 * | 441 /// |
446 * Any response row whose dimension has it is value as A, B or C, matches | 442 /// Any response row whose dimension has it is value as A, B or C, matches |
447 * this DimensionFilter. | 443 /// this DimensionFilter. |
448 */ | |
449 core.String operator; | 444 core.String operator; |
450 | 445 |
451 DimensionFilter(); | 446 DimensionFilter(); |
452 | 447 |
453 DimensionFilter.fromJson(core.Map _json) { | 448 DimensionFilter.fromJson(core.Map _json) { |
454 if (_json.containsKey("caseSensitive")) { | 449 if (_json.containsKey("caseSensitive")) { |
455 caseSensitive = _json["caseSensitive"]; | 450 caseSensitive = _json["caseSensitive"]; |
456 } | 451 } |
457 if (_json.containsKey("dimensionName")) { | 452 if (_json.containsKey("dimensionName")) { |
458 dimensionName = _json["dimensionName"]; | 453 dimensionName = _json["dimensionName"]; |
459 } | 454 } |
460 if (_json.containsKey("expressions")) { | 455 if (_json.containsKey("expressions")) { |
461 expressions = _json["expressions"]; | 456 expressions = _json["expressions"]; |
462 } | 457 } |
463 if (_json.containsKey("not")) { | 458 if (_json.containsKey("not")) { |
464 not = _json["not"]; | 459 not = _json["not"]; |
465 } | 460 } |
466 if (_json.containsKey("operator")) { | 461 if (_json.containsKey("operator")) { |
467 operator = _json["operator"]; | 462 operator = _json["operator"]; |
468 } | 463 } |
469 } | 464 } |
470 | 465 |
471 core.Map<core.String, core.Object> toJson() { | 466 core.Map<core.String, core.Object> toJson() { |
472 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 467 final core.Map<core.String, core.Object> _json = |
| 468 new core.Map<core.String, core.Object>(); |
473 if (caseSensitive != null) { | 469 if (caseSensitive != null) { |
474 _json["caseSensitive"] = caseSensitive; | 470 _json["caseSensitive"] = caseSensitive; |
475 } | 471 } |
476 if (dimensionName != null) { | 472 if (dimensionName != null) { |
477 _json["dimensionName"] = dimensionName; | 473 _json["dimensionName"] = dimensionName; |
478 } | 474 } |
479 if (expressions != null) { | 475 if (expressions != null) { |
480 _json["expressions"] = expressions; | 476 _json["expressions"] = expressions; |
481 } | 477 } |
482 if (not != null) { | 478 if (not != null) { |
483 _json["not"] = not; | 479 _json["not"] = not; |
484 } | 480 } |
485 if (operator != null) { | 481 if (operator != null) { |
486 _json["operator"] = operator; | 482 _json["operator"] = operator; |
487 } | 483 } |
488 return _json; | 484 return _json; |
489 } | 485 } |
490 } | 486 } |
491 | 487 |
492 /** | 488 /// A group of dimension filters. Set the operator value to specify how |
493 * A group of dimension filters. Set the operator value to specify how | 489 /// the filters are logically combined. |
494 * the filters are logically combined. | |
495 */ | |
496 class DimensionFilterClause { | 490 class DimensionFilterClause { |
497 /** | 491 /// The repeated set of filters. They are logically combined based on the |
498 * The repeated set of filters. They are logically combined based on the | 492 /// operator specified. |
499 * operator specified. | |
500 */ | |
501 core.List<DimensionFilter> filters; | 493 core.List<DimensionFilter> filters; |
502 /** | 494 |
503 * The operator for combining multiple dimension filters. If unspecified, it | 495 /// The operator for combining multiple dimension filters. If unspecified, it |
504 * is treated as an `OR`. | 496 /// is treated as an `OR`. |
505 * Possible string values are: | 497 /// Possible string values are: |
506 * - "OPERATOR_UNSPECIFIED" : Unspecified operator. It is treated as an `OR`. | 498 /// - "OPERATOR_UNSPECIFIED" : Unspecified operator. It is treated as an |
507 * - "OR" : The logical `OR` operator. | 499 /// `OR`. |
508 * - "AND" : The logical `AND` operator. | 500 /// - "OR" : The logical `OR` operator. |
509 */ | 501 /// - "AND" : The logical `AND` operator. |
510 core.String operator; | 502 core.String operator; |
511 | 503 |
512 DimensionFilterClause(); | 504 DimensionFilterClause(); |
513 | 505 |
514 DimensionFilterClause.fromJson(core.Map _json) { | 506 DimensionFilterClause.fromJson(core.Map _json) { |
515 if (_json.containsKey("filters")) { | 507 if (_json.containsKey("filters")) { |
516 filters = _json["filters"].map((value) => new DimensionFilter.fromJson(val
ue)).toList(); | 508 filters = _json["filters"] |
| 509 .map((value) => new DimensionFilter.fromJson(value)) |
| 510 .toList(); |
517 } | 511 } |
518 if (_json.containsKey("operator")) { | 512 if (_json.containsKey("operator")) { |
519 operator = _json["operator"]; | 513 operator = _json["operator"]; |
520 } | 514 } |
521 } | 515 } |
522 | 516 |
523 core.Map<core.String, core.Object> toJson() { | 517 core.Map<core.String, core.Object> toJson() { |
524 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 518 final core.Map<core.String, core.Object> _json = |
| 519 new core.Map<core.String, core.Object>(); |
525 if (filters != null) { | 520 if (filters != null) { |
526 _json["filters"] = filters.map((value) => (value).toJson()).toList(); | 521 _json["filters"] = filters.map((value) => (value).toJson()).toList(); |
527 } | 522 } |
528 if (operator != null) { | 523 if (operator != null) { |
529 _json["operator"] = operator; | 524 _json["operator"] = operator; |
530 } | 525 } |
531 return _json; | 526 return _json; |
532 } | 527 } |
533 } | 528 } |
534 | 529 |
535 /** | 530 /// Dynamic segment definition for defining the segment within the request. |
536 * Dynamic segment definition for defining the segment within the request. | 531 /// A segment can select users, sessions or both. |
537 * A segment can select users, sessions or both. | |
538 */ | |
539 class DynamicSegment { | 532 class DynamicSegment { |
540 /** The name of the dynamic segment. */ | 533 /// The name of the dynamic segment. |
541 core.String name; | 534 core.String name; |
542 /** Session Segment to select sessions to include in the segment. */ | 535 |
| 536 /// Session Segment to select sessions to include in the segment. |
543 SegmentDefinition sessionSegment; | 537 SegmentDefinition sessionSegment; |
544 /** User Segment to select users to include in the segment. */ | 538 |
| 539 /// User Segment to select users to include in the segment. |
545 SegmentDefinition userSegment; | 540 SegmentDefinition userSegment; |
546 | 541 |
547 DynamicSegment(); | 542 DynamicSegment(); |
548 | 543 |
549 DynamicSegment.fromJson(core.Map _json) { | 544 DynamicSegment.fromJson(core.Map _json) { |
550 if (_json.containsKey("name")) { | 545 if (_json.containsKey("name")) { |
551 name = _json["name"]; | 546 name = _json["name"]; |
552 } | 547 } |
553 if (_json.containsKey("sessionSegment")) { | 548 if (_json.containsKey("sessionSegment")) { |
554 sessionSegment = new SegmentDefinition.fromJson(_json["sessionSegment"]); | 549 sessionSegment = new SegmentDefinition.fromJson(_json["sessionSegment"]); |
555 } | 550 } |
556 if (_json.containsKey("userSegment")) { | 551 if (_json.containsKey("userSegment")) { |
557 userSegment = new SegmentDefinition.fromJson(_json["userSegment"]); | 552 userSegment = new SegmentDefinition.fromJson(_json["userSegment"]); |
558 } | 553 } |
559 } | 554 } |
560 | 555 |
561 core.Map<core.String, core.Object> toJson() { | 556 core.Map<core.String, core.Object> toJson() { |
562 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 557 final core.Map<core.String, core.Object> _json = |
| 558 new core.Map<core.String, core.Object>(); |
563 if (name != null) { | 559 if (name != null) { |
564 _json["name"] = name; | 560 _json["name"] = name; |
565 } | 561 } |
566 if (sessionSegment != null) { | 562 if (sessionSegment != null) { |
567 _json["sessionSegment"] = (sessionSegment).toJson(); | 563 _json["sessionSegment"] = (sessionSegment).toJson(); |
568 } | 564 } |
569 if (userSegment != null) { | 565 if (userSegment != null) { |
570 _json["userSegment"] = (userSegment).toJson(); | 566 _json["userSegment"] = (userSegment).toJson(); |
571 } | 567 } |
572 return _json; | 568 return _json; |
573 } | 569 } |
574 } | 570 } |
575 | 571 |
576 /** The batch request containing multiple report request. */ | 572 /// The batch request containing multiple report request. |
577 class GetReportsRequest { | 573 class GetReportsRequest { |
578 /** | 574 /// Requests, each request will have a separate response. |
579 * Requests, each request will have a separate response. | 575 /// There can be a maximum of 5 requests. All requests should have the same |
580 * There can be a maximum of 5 requests. All requests should have the same | 576 /// `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`. |
581 * `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`. | |
582 */ | |
583 core.List<ReportRequest> reportRequests; | 577 core.List<ReportRequest> reportRequests; |
584 | 578 |
585 GetReportsRequest(); | 579 GetReportsRequest(); |
586 | 580 |
587 GetReportsRequest.fromJson(core.Map _json) { | 581 GetReportsRequest.fromJson(core.Map _json) { |
588 if (_json.containsKey("reportRequests")) { | 582 if (_json.containsKey("reportRequests")) { |
589 reportRequests = _json["reportRequests"].map((value) => new ReportRequest.
fromJson(value)).toList(); | 583 reportRequests = _json["reportRequests"] |
| 584 .map((value) => new ReportRequest.fromJson(value)) |
| 585 .toList(); |
590 } | 586 } |
591 } | 587 } |
592 | 588 |
593 core.Map<core.String, core.Object> toJson() { | 589 core.Map<core.String, core.Object> toJson() { |
594 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 590 final core.Map<core.String, core.Object> _json = |
| 591 new core.Map<core.String, core.Object>(); |
595 if (reportRequests != null) { | 592 if (reportRequests != null) { |
596 _json["reportRequests"] = reportRequests.map((value) => (value).toJson()).
toList(); | 593 _json["reportRequests"] = |
| 594 reportRequests.map((value) => (value).toJson()).toList(); |
597 } | 595 } |
598 return _json; | 596 return _json; |
599 } | 597 } |
600 } | 598 } |
601 | 599 |
602 /** | 600 /// The main response class which holds the reports from the Reporting API |
603 * The main response class which holds the reports from the Reporting API | 601 /// `batchGet` call. |
604 * `batchGet` call. | |
605 */ | |
606 class GetReportsResponse { | 602 class GetReportsResponse { |
607 /** Responses corresponding to each of the request. */ | 603 /// Responses corresponding to each of the request. |
608 core.List<Report> reports; | 604 core.List<Report> reports; |
609 | 605 |
610 GetReportsResponse(); | 606 GetReportsResponse(); |
611 | 607 |
612 GetReportsResponse.fromJson(core.Map _json) { | 608 GetReportsResponse.fromJson(core.Map _json) { |
613 if (_json.containsKey("reports")) { | 609 if (_json.containsKey("reports")) { |
614 reports = _json["reports"].map((value) => new Report.fromJson(value)).toLi
st(); | 610 reports = |
| 611 _json["reports"].map((value) => new Report.fromJson(value)).toList(); |
615 } | 612 } |
616 } | 613 } |
617 | 614 |
618 core.Map<core.String, core.Object> toJson() { | 615 core.Map<core.String, core.Object> toJson() { |
619 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 616 final core.Map<core.String, core.Object> _json = |
| 617 new core.Map<core.String, core.Object>(); |
620 if (reports != null) { | 618 if (reports != null) { |
621 _json["reports"] = reports.map((value) => (value).toJson()).toList(); | 619 _json["reports"] = reports.map((value) => (value).toJson()).toList(); |
622 } | 620 } |
623 return _json; | 621 return _json; |
624 } | 622 } |
625 } | 623 } |
626 | 624 |
627 /** | 625 /// [Metrics](https://support.google.com/analytics/answer/1033861) |
628 * [Metrics](https://support.google.com/analytics/answer/1033861) | 626 /// are the quantitative measurements. For example, the metric `ga:users` |
629 * are the quantitative measurements. For example, the metric `ga:users` | 627 /// indicates the total number of users for the requested time period. |
630 * indicates the total number of users for the requested time period. | |
631 */ | |
632 class Metric { | 628 class Metric { |
633 /** | 629 /// An alias for the metric expression is an alternate name for the |
634 * An alias for the metric expression is an alternate name for the | 630 /// expression. The alias can be used for filtering and sorting. This field |
635 * expression. The alias can be used for filtering and sorting. This field | 631 /// is optional and is useful if the expression is not a single metric but |
636 * is optional and is useful if the expression is not a single metric but | 632 /// a complex expression which cannot be used in filtering and sorting. |
637 * a complex expression which cannot be used in filtering and sorting. | 633 /// The alias is also used in the response column header. |
638 * The alias is also used in the response column header. | |
639 */ | |
640 core.String alias; | 634 core.String alias; |
641 /** | 635 |
642 * A metric expression in the request. An expression is constructed from one | 636 /// A metric expression in the request. An expression is constructed from one |
643 * or more metrics and numbers. Accepted operators include: Plus (+), Minus | 637 /// or more metrics and numbers. Accepted operators include: Plus (+), Minus |
644 * (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, | 638 /// (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, |
645 * Positive cardinal numbers (0-9), can include decimals and is limited to | 639 /// Positive cardinal numbers (0-9), can include decimals and is limited to |
646 * 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the | 640 /// 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the |
647 * metric expression is just a single metric name like `ga:users`. | 641 /// metric expression is just a single metric name like `ga:users`. |
648 * Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics | 642 /// Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics |
649 * will result in unexpected results. | 643 /// will result in unexpected results. |
650 */ | |
651 core.String expression; | 644 core.String expression; |
652 /** | 645 |
653 * Specifies how the metric expression should be formatted, for example | 646 /// Specifies how the metric expression should be formatted, for example |
654 * `INTEGER`. | 647 /// `INTEGER`. |
655 * Possible string values are: | 648 /// Possible string values are: |
656 * - "METRIC_TYPE_UNSPECIFIED" : Metric type is unspecified. | 649 /// - "METRIC_TYPE_UNSPECIFIED" : Metric type is unspecified. |
657 * - "INTEGER" : Integer metric. | 650 /// - "INTEGER" : Integer metric. |
658 * - "FLOAT" : Float metric. | 651 /// - "FLOAT" : Float metric. |
659 * - "CURRENCY" : Currency metric. | 652 /// - "CURRENCY" : Currency metric. |
660 * - "PERCENT" : Percentage metric. | 653 /// - "PERCENT" : Percentage metric. |
661 * - "TIME" : Time metric in `HH:MM:SS` format. | 654 /// - "TIME" : Time metric in `HH:MM:SS` format. |
662 */ | |
663 core.String formattingType; | 655 core.String formattingType; |
664 | 656 |
665 Metric(); | 657 Metric(); |
666 | 658 |
667 Metric.fromJson(core.Map _json) { | 659 Metric.fromJson(core.Map _json) { |
668 if (_json.containsKey("alias")) { | 660 if (_json.containsKey("alias")) { |
669 alias = _json["alias"]; | 661 alias = _json["alias"]; |
670 } | 662 } |
671 if (_json.containsKey("expression")) { | 663 if (_json.containsKey("expression")) { |
672 expression = _json["expression"]; | 664 expression = _json["expression"]; |
673 } | 665 } |
674 if (_json.containsKey("formattingType")) { | 666 if (_json.containsKey("formattingType")) { |
675 formattingType = _json["formattingType"]; | 667 formattingType = _json["formattingType"]; |
676 } | 668 } |
677 } | 669 } |
678 | 670 |
679 core.Map<core.String, core.Object> toJson() { | 671 core.Map<core.String, core.Object> toJson() { |
680 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 672 final core.Map<core.String, core.Object> _json = |
| 673 new core.Map<core.String, core.Object>(); |
681 if (alias != null) { | 674 if (alias != null) { |
682 _json["alias"] = alias; | 675 _json["alias"] = alias; |
683 } | 676 } |
684 if (expression != null) { | 677 if (expression != null) { |
685 _json["expression"] = expression; | 678 _json["expression"] = expression; |
686 } | 679 } |
687 if (formattingType != null) { | 680 if (formattingType != null) { |
688 _json["formattingType"] = formattingType; | 681 _json["formattingType"] = formattingType; |
689 } | 682 } |
690 return _json; | 683 return _json; |
691 } | 684 } |
692 } | 685 } |
693 | 686 |
694 /** MetricFilter specifies the filter on a metric. */ | 687 /// MetricFilter specifies the filter on a metric. |
695 class MetricFilter { | 688 class MetricFilter { |
696 /** The value to compare against. */ | 689 /// The value to compare against. |
697 core.String comparisonValue; | 690 core.String comparisonValue; |
698 /** | 691 |
699 * The metric that will be filtered on. A metricFilter must contain a metric | 692 /// The metric that will be filtered on. A metricFilter must contain a metric |
700 * name. A metric name can be an alias earlier defined as a metric or it can | 693 /// name. A metric name can be an alias earlier defined as a metric or it can |
701 * also be a metric expression. | 694 /// also be a metric expression. |
702 */ | |
703 core.String metricName; | 695 core.String metricName; |
704 /** | 696 |
705 * Logical `NOT` operator. If this boolean is set to true, then the matching | 697 /// Logical `NOT` operator. If this boolean is set to true, then the matching |
706 * metric values will be excluded in the report. The default is false. | 698 /// metric values will be excluded in the report. The default is false. |
707 */ | |
708 core.bool not; | 699 core.bool not; |
709 /** | 700 |
710 * Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the | 701 /// Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the |
711 * comparisonValue, the default is `EQUAL`. If the operator is | 702 /// comparisonValue, the default is `EQUAL`. If the operator is |
712 * `IS_MISSING`, checks if the metric is missing and would ignore the | 703 /// `IS_MISSING`, checks if the metric is missing and would ignore the |
713 * comparisonValue. | 704 /// comparisonValue. |
714 * Possible string values are: | 705 /// Possible string values are: |
715 * - "OPERATOR_UNSPECIFIED" : If the operator is not specified, it is treated | 706 /// - "OPERATOR_UNSPECIFIED" : If the operator is not specified, it is |
716 * as `EQUAL`. | 707 /// treated as `EQUAL`. |
717 * - "EQUAL" : Should the value of the metric be exactly equal to the | 708 /// - "EQUAL" : Should the value of the metric be exactly equal to the |
718 * comparison value. | 709 /// comparison value. |
719 * - "LESS_THAN" : Should the value of the metric be less than to the | 710 /// - "LESS_THAN" : Should the value of the metric be less than to the |
720 * comparison value. | 711 /// comparison value. |
721 * - "GREATER_THAN" : Should the value of the metric be greater than to the | 712 /// - "GREATER_THAN" : Should the value of the metric be greater than to the |
722 * comparison value. | 713 /// comparison value. |
723 * - "IS_MISSING" : Validates if the metric is missing. | 714 /// - "IS_MISSING" : Validates if the metric is missing. |
724 * Doesn't take comparisonValue into account. | 715 /// Doesn't take comparisonValue into account. |
725 */ | |
726 core.String operator; | 716 core.String operator; |
727 | 717 |
728 MetricFilter(); | 718 MetricFilter(); |
729 | 719 |
730 MetricFilter.fromJson(core.Map _json) { | 720 MetricFilter.fromJson(core.Map _json) { |
731 if (_json.containsKey("comparisonValue")) { | 721 if (_json.containsKey("comparisonValue")) { |
732 comparisonValue = _json["comparisonValue"]; | 722 comparisonValue = _json["comparisonValue"]; |
733 } | 723 } |
734 if (_json.containsKey("metricName")) { | 724 if (_json.containsKey("metricName")) { |
735 metricName = _json["metricName"]; | 725 metricName = _json["metricName"]; |
736 } | 726 } |
737 if (_json.containsKey("not")) { | 727 if (_json.containsKey("not")) { |
738 not = _json["not"]; | 728 not = _json["not"]; |
739 } | 729 } |
740 if (_json.containsKey("operator")) { | 730 if (_json.containsKey("operator")) { |
741 operator = _json["operator"]; | 731 operator = _json["operator"]; |
742 } | 732 } |
743 } | 733 } |
744 | 734 |
745 core.Map<core.String, core.Object> toJson() { | 735 core.Map<core.String, core.Object> toJson() { |
746 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 736 final core.Map<core.String, core.Object> _json = |
| 737 new core.Map<core.String, core.Object>(); |
747 if (comparisonValue != null) { | 738 if (comparisonValue != null) { |
748 _json["comparisonValue"] = comparisonValue; | 739 _json["comparisonValue"] = comparisonValue; |
749 } | 740 } |
750 if (metricName != null) { | 741 if (metricName != null) { |
751 _json["metricName"] = metricName; | 742 _json["metricName"] = metricName; |
752 } | 743 } |
753 if (not != null) { | 744 if (not != null) { |
754 _json["not"] = not; | 745 _json["not"] = not; |
755 } | 746 } |
756 if (operator != null) { | 747 if (operator != null) { |
757 _json["operator"] = operator; | 748 _json["operator"] = operator; |
758 } | 749 } |
759 return _json; | 750 return _json; |
760 } | 751 } |
761 } | 752 } |
762 | 753 |
763 /** | 754 /// Represents a group of metric filters. |
764 * Represents a group of metric filters. | 755 /// Set the operator value to specify how the filters are logically combined. |
765 * Set the operator value to specify how the filters are logically combined. | |
766 */ | |
767 class MetricFilterClause { | 756 class MetricFilterClause { |
768 /** | 757 /// The repeated set of filters. They are logically combined based on the |
769 * The repeated set of filters. They are logically combined based on the | 758 /// operator specified. |
770 * operator specified. | |
771 */ | |
772 core.List<MetricFilter> filters; | 759 core.List<MetricFilter> filters; |
773 /** | 760 |
774 * The operator for combining multiple metric filters. If unspecified, it is | 761 /// The operator for combining multiple metric filters. If unspecified, it is |
775 * treated as an `OR`. | 762 /// treated as an `OR`. |
776 * Possible string values are: | 763 /// Possible string values are: |
777 * - "OPERATOR_UNSPECIFIED" : Unspecified operator. It is treated as an `OR`. | 764 /// - "OPERATOR_UNSPECIFIED" : Unspecified operator. It is treated as an |
778 * - "OR" : The logical `OR` operator. | 765 /// `OR`. |
779 * - "AND" : The logical `AND` operator. | 766 /// - "OR" : The logical `OR` operator. |
780 */ | 767 /// - "AND" : The logical `AND` operator. |
781 core.String operator; | 768 core.String operator; |
782 | 769 |
783 MetricFilterClause(); | 770 MetricFilterClause(); |
784 | 771 |
785 MetricFilterClause.fromJson(core.Map _json) { | 772 MetricFilterClause.fromJson(core.Map _json) { |
786 if (_json.containsKey("filters")) { | 773 if (_json.containsKey("filters")) { |
787 filters = _json["filters"].map((value) => new MetricFilter.fromJson(value)
).toList(); | 774 filters = _json["filters"] |
| 775 .map((value) => new MetricFilter.fromJson(value)) |
| 776 .toList(); |
788 } | 777 } |
789 if (_json.containsKey("operator")) { | 778 if (_json.containsKey("operator")) { |
790 operator = _json["operator"]; | 779 operator = _json["operator"]; |
791 } | 780 } |
792 } | 781 } |
793 | 782 |
794 core.Map<core.String, core.Object> toJson() { | 783 core.Map<core.String, core.Object> toJson() { |
795 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 784 final core.Map<core.String, core.Object> _json = |
| 785 new core.Map<core.String, core.Object>(); |
796 if (filters != null) { | 786 if (filters != null) { |
797 _json["filters"] = filters.map((value) => (value).toJson()).toList(); | 787 _json["filters"] = filters.map((value) => (value).toJson()).toList(); |
798 } | 788 } |
799 if (operator != null) { | 789 if (operator != null) { |
800 _json["operator"] = operator; | 790 _json["operator"] = operator; |
801 } | 791 } |
802 return _json; | 792 return _json; |
803 } | 793 } |
804 } | 794 } |
805 | 795 |
806 /** The headers for the metrics. */ | 796 /// The headers for the metrics. |
807 class MetricHeader { | 797 class MetricHeader { |
808 /** Headers for the metrics in the response. */ | 798 /// Headers for the metrics in the response. |
809 core.List<MetricHeaderEntry> metricHeaderEntries; | 799 core.List<MetricHeaderEntry> metricHeaderEntries; |
810 /** Headers for the pivots in the response. */ | 800 |
| 801 /// Headers for the pivots in the response. |
811 core.List<PivotHeader> pivotHeaders; | 802 core.List<PivotHeader> pivotHeaders; |
812 | 803 |
813 MetricHeader(); | 804 MetricHeader(); |
814 | 805 |
815 MetricHeader.fromJson(core.Map _json) { | 806 MetricHeader.fromJson(core.Map _json) { |
816 if (_json.containsKey("metricHeaderEntries")) { | 807 if (_json.containsKey("metricHeaderEntries")) { |
817 metricHeaderEntries = _json["metricHeaderEntries"].map((value) => new Metr
icHeaderEntry.fromJson(value)).toList(); | 808 metricHeaderEntries = _json["metricHeaderEntries"] |
| 809 .map((value) => new MetricHeaderEntry.fromJson(value)) |
| 810 .toList(); |
818 } | 811 } |
819 if (_json.containsKey("pivotHeaders")) { | 812 if (_json.containsKey("pivotHeaders")) { |
820 pivotHeaders = _json["pivotHeaders"].map((value) => new PivotHeader.fromJs
on(value)).toList(); | 813 pivotHeaders = _json["pivotHeaders"] |
| 814 .map((value) => new PivotHeader.fromJson(value)) |
| 815 .toList(); |
821 } | 816 } |
822 } | 817 } |
823 | 818 |
824 core.Map<core.String, core.Object> toJson() { | 819 core.Map<core.String, core.Object> toJson() { |
825 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 820 final core.Map<core.String, core.Object> _json = |
| 821 new core.Map<core.String, core.Object>(); |
826 if (metricHeaderEntries != null) { | 822 if (metricHeaderEntries != null) { |
827 _json["metricHeaderEntries"] = metricHeaderEntries.map((value) => (value).
toJson()).toList(); | 823 _json["metricHeaderEntries"] = |
| 824 metricHeaderEntries.map((value) => (value).toJson()).toList(); |
828 } | 825 } |
829 if (pivotHeaders != null) { | 826 if (pivotHeaders != null) { |
830 _json["pivotHeaders"] = pivotHeaders.map((value) => (value).toJson()).toLi
st(); | 827 _json["pivotHeaders"] = |
| 828 pivotHeaders.map((value) => (value).toJson()).toList(); |
831 } | 829 } |
832 return _json; | 830 return _json; |
833 } | 831 } |
834 } | 832 } |
835 | 833 |
836 /** Header for the metrics. */ | 834 /// Header for the metrics. |
837 class MetricHeaderEntry { | 835 class MetricHeaderEntry { |
838 /** The name of the header. */ | 836 /// The name of the header. |
839 core.String name; | 837 core.String name; |
840 /** | 838 |
841 * The type of the metric, for example `INTEGER`. | 839 /// The type of the metric, for example `INTEGER`. |
842 * Possible string values are: | 840 /// Possible string values are: |
843 * - "METRIC_TYPE_UNSPECIFIED" : Metric type is unspecified. | 841 /// - "METRIC_TYPE_UNSPECIFIED" : Metric type is unspecified. |
844 * - "INTEGER" : Integer metric. | 842 /// - "INTEGER" : Integer metric. |
845 * - "FLOAT" : Float metric. | 843 /// - "FLOAT" : Float metric. |
846 * - "CURRENCY" : Currency metric. | 844 /// - "CURRENCY" : Currency metric. |
847 * - "PERCENT" : Percentage metric. | 845 /// - "PERCENT" : Percentage metric. |
848 * - "TIME" : Time metric in `HH:MM:SS` format. | 846 /// - "TIME" : Time metric in `HH:MM:SS` format. |
849 */ | |
850 core.String type; | 847 core.String type; |
851 | 848 |
852 MetricHeaderEntry(); | 849 MetricHeaderEntry(); |
853 | 850 |
854 MetricHeaderEntry.fromJson(core.Map _json) { | 851 MetricHeaderEntry.fromJson(core.Map _json) { |
855 if (_json.containsKey("name")) { | 852 if (_json.containsKey("name")) { |
856 name = _json["name"]; | 853 name = _json["name"]; |
857 } | 854 } |
858 if (_json.containsKey("type")) { | 855 if (_json.containsKey("type")) { |
859 type = _json["type"]; | 856 type = _json["type"]; |
860 } | 857 } |
861 } | 858 } |
862 | 859 |
863 core.Map<core.String, core.Object> toJson() { | 860 core.Map<core.String, core.Object> toJson() { |
864 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 861 final core.Map<core.String, core.Object> _json = |
| 862 new core.Map<core.String, core.Object>(); |
865 if (name != null) { | 863 if (name != null) { |
866 _json["name"] = name; | 864 _json["name"] = name; |
867 } | 865 } |
868 if (type != null) { | 866 if (type != null) { |
869 _json["type"] = type; | 867 _json["type"] = type; |
870 } | 868 } |
871 return _json; | 869 return _json; |
872 } | 870 } |
873 } | 871 } |
874 | 872 |
875 /** | 873 /// A list of segment filters in the `OR` group are combined with the logical |
876 * A list of segment filters in the `OR` group are combined with the logical OR | 874 /// OR |
877 * operator. | 875 /// operator. |
878 */ | |
879 class OrFiltersForSegment { | 876 class OrFiltersForSegment { |
880 /** List of segment filters to be combined with a `OR` operator. */ | 877 /// List of segment filters to be combined with a `OR` operator. |
881 core.List<SegmentFilterClause> segmentFilterClauses; | 878 core.List<SegmentFilterClause> segmentFilterClauses; |
882 | 879 |
883 OrFiltersForSegment(); | 880 OrFiltersForSegment(); |
884 | 881 |
885 OrFiltersForSegment.fromJson(core.Map _json) { | 882 OrFiltersForSegment.fromJson(core.Map _json) { |
886 if (_json.containsKey("segmentFilterClauses")) { | 883 if (_json.containsKey("segmentFilterClauses")) { |
887 segmentFilterClauses = _json["segmentFilterClauses"].map((value) => new Se
gmentFilterClause.fromJson(value)).toList(); | 884 segmentFilterClauses = _json["segmentFilterClauses"] |
| 885 .map((value) => new SegmentFilterClause.fromJson(value)) |
| 886 .toList(); |
888 } | 887 } |
889 } | 888 } |
890 | 889 |
891 core.Map<core.String, core.Object> toJson() { | 890 core.Map<core.String, core.Object> toJson() { |
892 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 891 final core.Map<core.String, core.Object> _json = |
| 892 new core.Map<core.String, core.Object>(); |
893 if (segmentFilterClauses != null) { | 893 if (segmentFilterClauses != null) { |
894 _json["segmentFilterClauses"] = segmentFilterClauses.map((value) => (value
).toJson()).toList(); | 894 _json["segmentFilterClauses"] = |
| 895 segmentFilterClauses.map((value) => (value).toJson()).toList(); |
895 } | 896 } |
896 return _json; | 897 return _json; |
897 } | 898 } |
898 } | 899 } |
899 | 900 |
900 /** Specifies the sorting options. */ | 901 /// Specifies the sorting options. |
901 class OrderBy { | 902 class OrderBy { |
902 /** | 903 /// The field which to sort by. The default sort order is ascending. Example: |
903 * The field which to sort by. The default sort order is ascending. Example: | 904 /// `ga:browser`. |
904 * `ga:browser`. | 905 /// Note, that you can only specify one field for sort here. For example, |
905 * Note, that you can only specify one field for sort here. For example, | 906 /// `ga:browser, ga:city` is not valid. |
906 * `ga:browser, ga:city` is not valid. | |
907 */ | |
908 core.String fieldName; | 907 core.String fieldName; |
909 /** | 908 |
910 * The order type. The default orderType is `VALUE`. | 909 /// The order type. The default orderType is `VALUE`. |
911 * Possible string values are: | 910 /// Possible string values are: |
912 * - "ORDER_TYPE_UNSPECIFIED" : Unspecified order type will be treated as sort | 911 /// - "ORDER_TYPE_UNSPECIFIED" : Unspecified order type will be treated as |
913 * based on value. | 912 /// sort based on value. |
914 * - "VALUE" : The sort order is based on the value of the chosen column; | 913 /// - "VALUE" : The sort order is based on the value of the chosen column; |
915 * looks only at | 914 /// looks only at |
916 * the first date range. | 915 /// the first date range. |
917 * - "DELTA" : The sort order is based on the difference of the values of the | 916 /// - "DELTA" : The sort order is based on the difference of the values of |
918 * chosen | 917 /// the chosen |
919 * column between the first two date ranges. Usable only if there are | 918 /// column between the first two date ranges. Usable only if there are |
920 * exactly two date ranges. | 919 /// exactly two date ranges. |
921 * - "SMART" : The sort order is based on weighted value of the chosen column. | 920 /// - "SMART" : The sort order is based on weighted value of the chosen |
922 * If | 921 /// column. If |
923 * column has n/d format, then weighted value of this ratio will | 922 /// column has n/d format, then weighted value of this ratio will |
924 * be `(n + totals.n)/(d + totals.d)` Usable only for metrics that | 923 /// be `(n + totals.n)/(d + totals.d)` Usable only for metrics that |
925 * represent ratios. | 924 /// represent ratios. |
926 * - "HISTOGRAM_BUCKET" : Histogram order type is applicable only to dimension | 925 /// - "HISTOGRAM_BUCKET" : Histogram order type is applicable only to |
927 * columns with | 926 /// dimension columns with |
928 * non-empty histogram-buckets. | 927 /// non-empty histogram-buckets. |
929 * - "DIMENSION_AS_INTEGER" : If the dimensions are fixed length numbers, | 928 /// - "DIMENSION_AS_INTEGER" : If the dimensions are fixed length numbers, |
930 * ordinary sort would just | 929 /// ordinary sort would just |
931 * work fine. `DIMENSION_AS_INTEGER` can be used if the dimensions are | 930 /// work fine. `DIMENSION_AS_INTEGER` can be used if the dimensions are |
932 * variable length numbers. | 931 /// variable length numbers. |
933 */ | |
934 core.String orderType; | 932 core.String orderType; |
935 /** | 933 |
936 * The sorting order for the field. | 934 /// The sorting order for the field. |
937 * Possible string values are: | 935 /// Possible string values are: |
938 * - "SORT_ORDER_UNSPECIFIED" : If the sort order is unspecified, the default | 936 /// - "SORT_ORDER_UNSPECIFIED" : If the sort order is unspecified, the |
939 * is ascending. | 937 /// default is ascending. |
940 * - "ASCENDING" : Ascending sort. The field will be sorted in an ascending | 938 /// - "ASCENDING" : Ascending sort. The field will be sorted in an ascending |
941 * manner. | 939 /// manner. |
942 * - "DESCENDING" : Descending sort. The field will be sorted in a descending | 940 /// - "DESCENDING" : Descending sort. The field will be sorted in a |
943 * manner. | 941 /// descending manner. |
944 */ | |
945 core.String sortOrder; | 942 core.String sortOrder; |
946 | 943 |
947 OrderBy(); | 944 OrderBy(); |
948 | 945 |
949 OrderBy.fromJson(core.Map _json) { | 946 OrderBy.fromJson(core.Map _json) { |
950 if (_json.containsKey("fieldName")) { | 947 if (_json.containsKey("fieldName")) { |
951 fieldName = _json["fieldName"]; | 948 fieldName = _json["fieldName"]; |
952 } | 949 } |
953 if (_json.containsKey("orderType")) { | 950 if (_json.containsKey("orderType")) { |
954 orderType = _json["orderType"]; | 951 orderType = _json["orderType"]; |
955 } | 952 } |
956 if (_json.containsKey("sortOrder")) { | 953 if (_json.containsKey("sortOrder")) { |
957 sortOrder = _json["sortOrder"]; | 954 sortOrder = _json["sortOrder"]; |
958 } | 955 } |
959 } | 956 } |
960 | 957 |
961 core.Map<core.String, core.Object> toJson() { | 958 core.Map<core.String, core.Object> toJson() { |
962 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 959 final core.Map<core.String, core.Object> _json = |
| 960 new core.Map<core.String, core.Object>(); |
963 if (fieldName != null) { | 961 if (fieldName != null) { |
964 _json["fieldName"] = fieldName; | 962 _json["fieldName"] = fieldName; |
965 } | 963 } |
966 if (orderType != null) { | 964 if (orderType != null) { |
967 _json["orderType"] = orderType; | 965 _json["orderType"] = orderType; |
968 } | 966 } |
969 if (sortOrder != null) { | 967 if (sortOrder != null) { |
970 _json["sortOrder"] = sortOrder; | 968 _json["sortOrder"] = sortOrder; |
971 } | 969 } |
972 return _json; | 970 return _json; |
973 } | 971 } |
974 } | 972 } |
975 | 973 |
976 /** | 974 /// The Pivot describes the pivot section in the request. |
977 * The Pivot describes the pivot section in the request. | 975 /// The Pivot helps rearrange the information in the table for certain reports |
978 * The Pivot helps rearrange the information in the table for certain reports | 976 /// by pivoting your data on a second dimension. |
979 * by pivoting your data on a second dimension. | |
980 */ | |
981 class Pivot { | 977 class Pivot { |
982 /** | 978 /// DimensionFilterClauses are logically combined with an `AND` operator: |
983 * DimensionFilterClauses are logically combined with an `AND` operator: only | 979 /// only |
984 * data that is included by all these DimensionFilterClauses contributes to | 980 /// data that is included by all these DimensionFilterClauses contributes to |
985 * the values in this pivot region. Dimension filters can be used to restrict | 981 /// the values in this pivot region. Dimension filters can be used to |
986 * the columns shown in the pivot region. For example if you have | 982 /// restrict |
987 * `ga:browser` as the requested dimension in the pivot region, and you | 983 /// the columns shown in the pivot region. For example if you have |
988 * specify key filters to restrict `ga:browser` to only "IE" or "Firefox", | 984 /// `ga:browser` as the requested dimension in the pivot region, and you |
989 * then only those two browsers would show up as columns. | 985 /// specify key filters to restrict `ga:browser` to only "IE" or "Firefox", |
990 */ | 986 /// then only those two browsers would show up as columns. |
991 core.List<DimensionFilterClause> dimensionFilterClauses; | 987 core.List<DimensionFilterClause> dimensionFilterClauses; |
992 /** | 988 |
993 * A list of dimensions to show as pivot columns. A Pivot can have a maximum | 989 /// A list of dimensions to show as pivot columns. A Pivot can have a maximum |
994 * of 4 dimensions. Pivot dimensions are part of the restriction on the | 990 /// of 4 dimensions. Pivot dimensions are part of the restriction on the |
995 * total number of dimensions allowed in the request. | 991 /// total number of dimensions allowed in the request. |
996 */ | |
997 core.List<Dimension> dimensions; | 992 core.List<Dimension> dimensions; |
998 /** | 993 |
999 * Specifies the maximum number of groups to return. | 994 /// Specifies the maximum number of groups to return. |
1000 * The default value is 10, also the maximum value is 1,000. | 995 /// The default value is 10, also the maximum value is 1,000. |
1001 */ | |
1002 core.int maxGroupCount; | 996 core.int maxGroupCount; |
1003 /** | 997 |
1004 * The pivot metrics. Pivot metrics are part of the | 998 /// The pivot metrics. Pivot metrics are part of the |
1005 * restriction on total number of metrics allowed in the request. | 999 /// restriction on total number of metrics allowed in the request. |
1006 */ | |
1007 core.List<Metric> metrics; | 1000 core.List<Metric> metrics; |
1008 /** | 1001 |
1009 * If k metrics were requested, then the response will contain some | 1002 /// If k metrics were requested, then the response will contain some |
1010 * data-dependent multiple of k columns in the report. E.g., if you pivoted | 1003 /// data-dependent multiple of k columns in the report. E.g., if you pivoted |
1011 * on the dimension `ga:browser` then you'd get k columns for "Firefox", k | 1004 /// on the dimension `ga:browser` then you'd get k columns for "Firefox", k |
1012 * columns for "IE", k columns for "Chrome", etc. The ordering of the groups | 1005 /// columns for "IE", k columns for "Chrome", etc. The ordering of the groups |
1013 * of columns is determined by descending order of "total" for the first of | 1006 /// of columns is determined by descending order of "total" for the first of |
1014 * the k values. Ties are broken by lexicographic ordering of the first | 1007 /// the k values. Ties are broken by lexicographic ordering of the first |
1015 * pivot dimension, then lexicographic ordering of the second pivot | 1008 /// pivot dimension, then lexicographic ordering of the second pivot |
1016 * dimension, and so on. E.g., if the totals for the first value for | 1009 /// dimension, and so on. E.g., if the totals for the first value for |
1017 * Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns | 1010 /// Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns |
1018 * would be Chrome, Firefox, IE. | 1011 /// would be Chrome, Firefox, IE. |
1019 * | 1012 /// |
1020 * The following let you choose which of the groups of k columns are | 1013 /// The following let you choose which of the groups of k columns are |
1021 * included in the response. | 1014 /// included in the response. |
1022 */ | |
1023 core.int startGroup; | 1015 core.int startGroup; |
1024 | 1016 |
1025 Pivot(); | 1017 Pivot(); |
1026 | 1018 |
1027 Pivot.fromJson(core.Map _json) { | 1019 Pivot.fromJson(core.Map _json) { |
1028 if (_json.containsKey("dimensionFilterClauses")) { | 1020 if (_json.containsKey("dimensionFilterClauses")) { |
1029 dimensionFilterClauses = _json["dimensionFilterClauses"].map((value) => ne
w DimensionFilterClause.fromJson(value)).toList(); | 1021 dimensionFilterClauses = _json["dimensionFilterClauses"] |
| 1022 .map((value) => new DimensionFilterClause.fromJson(value)) |
| 1023 .toList(); |
1030 } | 1024 } |
1031 if (_json.containsKey("dimensions")) { | 1025 if (_json.containsKey("dimensions")) { |
1032 dimensions = _json["dimensions"].map((value) => new Dimension.fromJson(val
ue)).toList(); | 1026 dimensions = _json["dimensions"] |
| 1027 .map((value) => new Dimension.fromJson(value)) |
| 1028 .toList(); |
1033 } | 1029 } |
1034 if (_json.containsKey("maxGroupCount")) { | 1030 if (_json.containsKey("maxGroupCount")) { |
1035 maxGroupCount = _json["maxGroupCount"]; | 1031 maxGroupCount = _json["maxGroupCount"]; |
1036 } | 1032 } |
1037 if (_json.containsKey("metrics")) { | 1033 if (_json.containsKey("metrics")) { |
1038 metrics = _json["metrics"].map((value) => new Metric.fromJson(value)).toLi
st(); | 1034 metrics = |
| 1035 _json["metrics"].map((value) => new Metric.fromJson(value)).toList(); |
1039 } | 1036 } |
1040 if (_json.containsKey("startGroup")) { | 1037 if (_json.containsKey("startGroup")) { |
1041 startGroup = _json["startGroup"]; | 1038 startGroup = _json["startGroup"]; |
1042 } | 1039 } |
1043 } | 1040 } |
1044 | 1041 |
1045 core.Map<core.String, core.Object> toJson() { | 1042 core.Map<core.String, core.Object> toJson() { |
1046 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1043 final core.Map<core.String, core.Object> _json = |
| 1044 new core.Map<core.String, core.Object>(); |
1047 if (dimensionFilterClauses != null) { | 1045 if (dimensionFilterClauses != null) { |
1048 _json["dimensionFilterClauses"] = dimensionFilterClauses.map((value) => (v
alue).toJson()).toList(); | 1046 _json["dimensionFilterClauses"] = |
| 1047 dimensionFilterClauses.map((value) => (value).toJson()).toList(); |
1049 } | 1048 } |
1050 if (dimensions != null) { | 1049 if (dimensions != null) { |
1051 _json["dimensions"] = dimensions.map((value) => (value).toJson()).toList()
; | 1050 _json["dimensions"] = |
| 1051 dimensions.map((value) => (value).toJson()).toList(); |
1052 } | 1052 } |
1053 if (maxGroupCount != null) { | 1053 if (maxGroupCount != null) { |
1054 _json["maxGroupCount"] = maxGroupCount; | 1054 _json["maxGroupCount"] = maxGroupCount; |
1055 } | 1055 } |
1056 if (metrics != null) { | 1056 if (metrics != null) { |
1057 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); | 1057 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); |
1058 } | 1058 } |
1059 if (startGroup != null) { | 1059 if (startGroup != null) { |
1060 _json["startGroup"] = startGroup; | 1060 _json["startGroup"] = startGroup; |
1061 } | 1061 } |
1062 return _json; | 1062 return _json; |
1063 } | 1063 } |
1064 } | 1064 } |
1065 | 1065 |
1066 /** The headers for each of the pivot sections defined in the request. */ | 1066 /// The headers for each of the pivot sections defined in the request. |
1067 class PivotHeader { | 1067 class PivotHeader { |
1068 /** A single pivot section header. */ | 1068 /// A single pivot section header. |
1069 core.List<PivotHeaderEntry> pivotHeaderEntries; | 1069 core.List<PivotHeaderEntry> pivotHeaderEntries; |
1070 /** The total number of groups for this pivot. */ | 1070 |
| 1071 /// The total number of groups for this pivot. |
1071 core.int totalPivotGroupsCount; | 1072 core.int totalPivotGroupsCount; |
1072 | 1073 |
1073 PivotHeader(); | 1074 PivotHeader(); |
1074 | 1075 |
1075 PivotHeader.fromJson(core.Map _json) { | 1076 PivotHeader.fromJson(core.Map _json) { |
1076 if (_json.containsKey("pivotHeaderEntries")) { | 1077 if (_json.containsKey("pivotHeaderEntries")) { |
1077 pivotHeaderEntries = _json["pivotHeaderEntries"].map((value) => new PivotH
eaderEntry.fromJson(value)).toList(); | 1078 pivotHeaderEntries = _json["pivotHeaderEntries"] |
| 1079 .map((value) => new PivotHeaderEntry.fromJson(value)) |
| 1080 .toList(); |
1078 } | 1081 } |
1079 if (_json.containsKey("totalPivotGroupsCount")) { | 1082 if (_json.containsKey("totalPivotGroupsCount")) { |
1080 totalPivotGroupsCount = _json["totalPivotGroupsCount"]; | 1083 totalPivotGroupsCount = _json["totalPivotGroupsCount"]; |
1081 } | 1084 } |
1082 } | 1085 } |
1083 | 1086 |
1084 core.Map<core.String, core.Object> toJson() { | 1087 core.Map<core.String, core.Object> toJson() { |
1085 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1088 final core.Map<core.String, core.Object> _json = |
| 1089 new core.Map<core.String, core.Object>(); |
1086 if (pivotHeaderEntries != null) { | 1090 if (pivotHeaderEntries != null) { |
1087 _json["pivotHeaderEntries"] = pivotHeaderEntries.map((value) => (value).to
Json()).toList(); | 1091 _json["pivotHeaderEntries"] = |
| 1092 pivotHeaderEntries.map((value) => (value).toJson()).toList(); |
1088 } | 1093 } |
1089 if (totalPivotGroupsCount != null) { | 1094 if (totalPivotGroupsCount != null) { |
1090 _json["totalPivotGroupsCount"] = totalPivotGroupsCount; | 1095 _json["totalPivotGroupsCount"] = totalPivotGroupsCount; |
1091 } | 1096 } |
1092 return _json; | 1097 return _json; |
1093 } | 1098 } |
1094 } | 1099 } |
1095 | 1100 |
1096 /** | 1101 /// The headers for the each of the metric column corresponding to the metrics |
1097 * The headers for the each of the metric column corresponding to the metrics | 1102 /// requested in the pivots section of the response. |
1098 * requested in the pivots section of the response. | |
1099 */ | |
1100 class PivotHeaderEntry { | 1103 class PivotHeaderEntry { |
1101 /** The name of the dimensions in the pivot response. */ | 1104 /// The name of the dimensions in the pivot response. |
1102 core.List<core.String> dimensionNames; | 1105 core.List<core.String> dimensionNames; |
1103 /** The values for the dimensions in the pivot. */ | 1106 |
| 1107 /// The values for the dimensions in the pivot. |
1104 core.List<core.String> dimensionValues; | 1108 core.List<core.String> dimensionValues; |
1105 /** The metric header for the metric in the pivot. */ | 1109 |
| 1110 /// The metric header for the metric in the pivot. |
1106 MetricHeaderEntry metric; | 1111 MetricHeaderEntry metric; |
1107 | 1112 |
1108 PivotHeaderEntry(); | 1113 PivotHeaderEntry(); |
1109 | 1114 |
1110 PivotHeaderEntry.fromJson(core.Map _json) { | 1115 PivotHeaderEntry.fromJson(core.Map _json) { |
1111 if (_json.containsKey("dimensionNames")) { | 1116 if (_json.containsKey("dimensionNames")) { |
1112 dimensionNames = _json["dimensionNames"]; | 1117 dimensionNames = _json["dimensionNames"]; |
1113 } | 1118 } |
1114 if (_json.containsKey("dimensionValues")) { | 1119 if (_json.containsKey("dimensionValues")) { |
1115 dimensionValues = _json["dimensionValues"]; | 1120 dimensionValues = _json["dimensionValues"]; |
1116 } | 1121 } |
1117 if (_json.containsKey("metric")) { | 1122 if (_json.containsKey("metric")) { |
1118 metric = new MetricHeaderEntry.fromJson(_json["metric"]); | 1123 metric = new MetricHeaderEntry.fromJson(_json["metric"]); |
1119 } | 1124 } |
1120 } | 1125 } |
1121 | 1126 |
1122 core.Map<core.String, core.Object> toJson() { | 1127 core.Map<core.String, core.Object> toJson() { |
1123 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1128 final core.Map<core.String, core.Object> _json = |
| 1129 new core.Map<core.String, core.Object>(); |
1124 if (dimensionNames != null) { | 1130 if (dimensionNames != null) { |
1125 _json["dimensionNames"] = dimensionNames; | 1131 _json["dimensionNames"] = dimensionNames; |
1126 } | 1132 } |
1127 if (dimensionValues != null) { | 1133 if (dimensionValues != null) { |
1128 _json["dimensionValues"] = dimensionValues; | 1134 _json["dimensionValues"] = dimensionValues; |
1129 } | 1135 } |
1130 if (metric != null) { | 1136 if (metric != null) { |
1131 _json["metric"] = (metric).toJson(); | 1137 _json["metric"] = (metric).toJson(); |
1132 } | 1138 } |
1133 return _json; | 1139 return _json; |
1134 } | 1140 } |
1135 } | 1141 } |
1136 | 1142 |
1137 /** The metric values in the pivot region. */ | 1143 /// The metric values in the pivot region. |
1138 class PivotValueRegion { | 1144 class PivotValueRegion { |
1139 /** The values of the metrics in each of the pivot regions. */ | 1145 /// The values of the metrics in each of the pivot regions. |
1140 core.List<core.String> values; | 1146 core.List<core.String> values; |
1141 | 1147 |
1142 PivotValueRegion(); | 1148 PivotValueRegion(); |
1143 | 1149 |
1144 PivotValueRegion.fromJson(core.Map _json) { | 1150 PivotValueRegion.fromJson(core.Map _json) { |
1145 if (_json.containsKey("values")) { | 1151 if (_json.containsKey("values")) { |
1146 values = _json["values"]; | 1152 values = _json["values"]; |
1147 } | 1153 } |
1148 } | 1154 } |
1149 | 1155 |
1150 core.Map<core.String, core.Object> toJson() { | 1156 core.Map<core.String, core.Object> toJson() { |
1151 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1157 final core.Map<core.String, core.Object> _json = |
| 1158 new core.Map<core.String, core.Object>(); |
1152 if (values != null) { | 1159 if (values != null) { |
1153 _json["values"] = values; | 1160 _json["values"] = values; |
1154 } | 1161 } |
1155 return _json; | 1162 return _json; |
1156 } | 1163 } |
1157 } | 1164 } |
1158 | 1165 |
1159 /** The data response corresponding to the request. */ | 1166 /// The data response corresponding to the request. |
1160 class Report { | 1167 class Report { |
1161 /** The column headers. */ | 1168 /// The column headers. |
1162 ColumnHeader columnHeader; | 1169 ColumnHeader columnHeader; |
1163 /** Response data. */ | 1170 |
| 1171 /// Response data. |
1164 ReportData data; | 1172 ReportData data; |
1165 /** Page token to retrieve the next page of results in the list. */ | 1173 |
| 1174 /// Page token to retrieve the next page of results in the list. |
1166 core.String nextPageToken; | 1175 core.String nextPageToken; |
1167 | 1176 |
1168 Report(); | 1177 Report(); |
1169 | 1178 |
1170 Report.fromJson(core.Map _json) { | 1179 Report.fromJson(core.Map _json) { |
1171 if (_json.containsKey("columnHeader")) { | 1180 if (_json.containsKey("columnHeader")) { |
1172 columnHeader = new ColumnHeader.fromJson(_json["columnHeader"]); | 1181 columnHeader = new ColumnHeader.fromJson(_json["columnHeader"]); |
1173 } | 1182 } |
1174 if (_json.containsKey("data")) { | 1183 if (_json.containsKey("data")) { |
1175 data = new ReportData.fromJson(_json["data"]); | 1184 data = new ReportData.fromJson(_json["data"]); |
1176 } | 1185 } |
1177 if (_json.containsKey("nextPageToken")) { | 1186 if (_json.containsKey("nextPageToken")) { |
1178 nextPageToken = _json["nextPageToken"]; | 1187 nextPageToken = _json["nextPageToken"]; |
1179 } | 1188 } |
1180 } | 1189 } |
1181 | 1190 |
1182 core.Map<core.String, core.Object> toJson() { | 1191 core.Map<core.String, core.Object> toJson() { |
1183 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1192 final core.Map<core.String, core.Object> _json = |
| 1193 new core.Map<core.String, core.Object>(); |
1184 if (columnHeader != null) { | 1194 if (columnHeader != null) { |
1185 _json["columnHeader"] = (columnHeader).toJson(); | 1195 _json["columnHeader"] = (columnHeader).toJson(); |
1186 } | 1196 } |
1187 if (data != null) { | 1197 if (data != null) { |
1188 _json["data"] = (data).toJson(); | 1198 _json["data"] = (data).toJson(); |
1189 } | 1199 } |
1190 if (nextPageToken != null) { | 1200 if (nextPageToken != null) { |
1191 _json["nextPageToken"] = nextPageToken; | 1201 _json["nextPageToken"] = nextPageToken; |
1192 } | 1202 } |
1193 return _json; | 1203 return _json; |
1194 } | 1204 } |
1195 } | 1205 } |
1196 | 1206 |
1197 /** The data part of the report. */ | 1207 /// The data part of the report. |
1198 class ReportData { | 1208 class ReportData { |
1199 /** | 1209 /// The last time the data in the report was refreshed. All the hits received |
1200 * The last time the data in the report was refreshed. All the hits received | 1210 /// before this timestamp are included in the calculation of the report. |
1201 * before this timestamp are included in the calculation of the report. | |
1202 */ | |
1203 core.String dataLastRefreshed; | 1211 core.String dataLastRefreshed; |
1204 /** | 1212 |
1205 * Indicates if response to this request is golden or not. Data is | 1213 /// Indicates if response to this request is golden or not. Data is |
1206 * golden when the exact same request will not produce any new results if | 1214 /// golden when the exact same request will not produce any new results if |
1207 * asked at a later point in time. | 1215 /// asked at a later point in time. |
1208 */ | |
1209 core.bool isDataGolden; | 1216 core.bool isDataGolden; |
1210 /** | 1217 |
1211 * Minimum and maximum values seen over all matching rows. These are both | 1218 /// Minimum and maximum values seen over all matching rows. These are both |
1212 * empty when `hideValueRanges` in the request is false, or when | 1219 /// empty when `hideValueRanges` in the request is false, or when |
1213 * rowCount is zero. | 1220 /// rowCount is zero. |
1214 */ | |
1215 core.List<DateRangeValues> maximums; | 1221 core.List<DateRangeValues> maximums; |
1216 /** | 1222 |
1217 * Minimum and maximum values seen over all matching rows. These are both | 1223 /// Minimum and maximum values seen over all matching rows. These are both |
1218 * empty when `hideValueRanges` in the request is false, or when | 1224 /// empty when `hideValueRanges` in the request is false, or when |
1219 * rowCount is zero. | 1225 /// rowCount is zero. |
1220 */ | |
1221 core.List<DateRangeValues> minimums; | 1226 core.List<DateRangeValues> minimums; |
1222 /** Total number of matching rows for this query. */ | 1227 |
| 1228 /// Total number of matching rows for this query. |
1223 core.int rowCount; | 1229 core.int rowCount; |
1224 /** There's one ReportRow for every unique combination of dimensions. */ | 1230 |
| 1231 /// There's one ReportRow for every unique combination of dimensions. |
1225 core.List<ReportRow> rows; | 1232 core.List<ReportRow> rows; |
1226 /** | 1233 |
1227 * If the results are | 1234 /// If the results are |
1228 * [sampled](https://support.google.com/analytics/answer/2637192), | 1235 /// [sampled](https://support.google.com/analytics/answer/2637192), |
1229 * this returns the total number of samples read, one entry per date range. | 1236 /// this returns the total number of samples read, one entry per date range. |
1230 * If the results are not sampled this field will not be defined. See | 1237 /// If the results are not sampled this field will not be defined. See |
1231 * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) | 1238 /// [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) |
1232 * for details. | 1239 /// for details. |
1233 */ | |
1234 core.List<core.String> samplesReadCounts; | 1240 core.List<core.String> samplesReadCounts; |
1235 /** | 1241 |
1236 * If the results are | 1242 /// If the results are |
1237 * [sampled](https://support.google.com/analytics/answer/2637192), | 1243 /// [sampled](https://support.google.com/analytics/answer/2637192), |
1238 * this returns the total number of | 1244 /// this returns the total number of |
1239 * samples present, one entry per date range. If the results are not sampled | 1245 /// samples present, one entry per date range. If the results are not sampled |
1240 * this field will not be defined. See | 1246 /// this field will not be defined. See |
1241 * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) | 1247 /// [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) |
1242 * for details. | 1248 /// for details. |
1243 */ | |
1244 core.List<core.String> samplingSpaceSizes; | 1249 core.List<core.String> samplingSpaceSizes; |
1245 /** | 1250 |
1246 * For each requested date range, for the set of all rows that match | 1251 /// For each requested date range, for the set of all rows that match |
1247 * the query, every requested value format gets a total. The total | 1252 /// the query, every requested value format gets a total. The total |
1248 * for a value format is computed by first totaling the metrics | 1253 /// for a value format is computed by first totaling the metrics |
1249 * mentioned in the value format and then evaluating the value | 1254 /// mentioned in the value format and then evaluating the value |
1250 * format as a scalar expression. E.g., The "totals" for | 1255 /// format as a scalar expression. E.g., The "totals" for |
1251 * `3 / (ga:sessions + 2)` we compute | 1256 /// `3 / (ga:sessions + 2)` we compute |
1252 * `3 / ((sum of all relevant ga:sessions) + 2)`. | 1257 /// `3 / ((sum of all relevant ga:sessions) + 2)`. |
1253 * Totals are computed before pagination. | 1258 /// Totals are computed before pagination. |
1254 */ | |
1255 core.List<DateRangeValues> totals; | 1259 core.List<DateRangeValues> totals; |
1256 | 1260 |
1257 ReportData(); | 1261 ReportData(); |
1258 | 1262 |
1259 ReportData.fromJson(core.Map _json) { | 1263 ReportData.fromJson(core.Map _json) { |
1260 if (_json.containsKey("dataLastRefreshed")) { | 1264 if (_json.containsKey("dataLastRefreshed")) { |
1261 dataLastRefreshed = _json["dataLastRefreshed"]; | 1265 dataLastRefreshed = _json["dataLastRefreshed"]; |
1262 } | 1266 } |
1263 if (_json.containsKey("isDataGolden")) { | 1267 if (_json.containsKey("isDataGolden")) { |
1264 isDataGolden = _json["isDataGolden"]; | 1268 isDataGolden = _json["isDataGolden"]; |
1265 } | 1269 } |
1266 if (_json.containsKey("maximums")) { | 1270 if (_json.containsKey("maximums")) { |
1267 maximums = _json["maximums"].map((value) => new DateRangeValues.fromJson(v
alue)).toList(); | 1271 maximums = _json["maximums"] |
| 1272 .map((value) => new DateRangeValues.fromJson(value)) |
| 1273 .toList(); |
1268 } | 1274 } |
1269 if (_json.containsKey("minimums")) { | 1275 if (_json.containsKey("minimums")) { |
1270 minimums = _json["minimums"].map((value) => new DateRangeValues.fromJson(v
alue)).toList(); | 1276 minimums = _json["minimums"] |
| 1277 .map((value) => new DateRangeValues.fromJson(value)) |
| 1278 .toList(); |
1271 } | 1279 } |
1272 if (_json.containsKey("rowCount")) { | 1280 if (_json.containsKey("rowCount")) { |
1273 rowCount = _json["rowCount"]; | 1281 rowCount = _json["rowCount"]; |
1274 } | 1282 } |
1275 if (_json.containsKey("rows")) { | 1283 if (_json.containsKey("rows")) { |
1276 rows = _json["rows"].map((value) => new ReportRow.fromJson(value)).toList(
); | 1284 rows = |
| 1285 _json["rows"].map((value) => new ReportRow.fromJson(value)).toList(); |
1277 } | 1286 } |
1278 if (_json.containsKey("samplesReadCounts")) { | 1287 if (_json.containsKey("samplesReadCounts")) { |
1279 samplesReadCounts = _json["samplesReadCounts"]; | 1288 samplesReadCounts = _json["samplesReadCounts"]; |
1280 } | 1289 } |
1281 if (_json.containsKey("samplingSpaceSizes")) { | 1290 if (_json.containsKey("samplingSpaceSizes")) { |
1282 samplingSpaceSizes = _json["samplingSpaceSizes"]; | 1291 samplingSpaceSizes = _json["samplingSpaceSizes"]; |
1283 } | 1292 } |
1284 if (_json.containsKey("totals")) { | 1293 if (_json.containsKey("totals")) { |
1285 totals = _json["totals"].map((value) => new DateRangeValues.fromJson(value
)).toList(); | 1294 totals = _json["totals"] |
| 1295 .map((value) => new DateRangeValues.fromJson(value)) |
| 1296 .toList(); |
1286 } | 1297 } |
1287 } | 1298 } |
1288 | 1299 |
1289 core.Map<core.String, core.Object> toJson() { | 1300 core.Map<core.String, core.Object> toJson() { |
1290 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1301 final core.Map<core.String, core.Object> _json = |
| 1302 new core.Map<core.String, core.Object>(); |
1291 if (dataLastRefreshed != null) { | 1303 if (dataLastRefreshed != null) { |
1292 _json["dataLastRefreshed"] = dataLastRefreshed; | 1304 _json["dataLastRefreshed"] = dataLastRefreshed; |
1293 } | 1305 } |
1294 if (isDataGolden != null) { | 1306 if (isDataGolden != null) { |
1295 _json["isDataGolden"] = isDataGolden; | 1307 _json["isDataGolden"] = isDataGolden; |
1296 } | 1308 } |
1297 if (maximums != null) { | 1309 if (maximums != null) { |
1298 _json["maximums"] = maximums.map((value) => (value).toJson()).toList(); | 1310 _json["maximums"] = maximums.map((value) => (value).toJson()).toList(); |
1299 } | 1311 } |
1300 if (minimums != null) { | 1312 if (minimums != null) { |
(...skipping 11 matching lines...) Expand all Loading... |
1312 if (samplingSpaceSizes != null) { | 1324 if (samplingSpaceSizes != null) { |
1313 _json["samplingSpaceSizes"] = samplingSpaceSizes; | 1325 _json["samplingSpaceSizes"] = samplingSpaceSizes; |
1314 } | 1326 } |
1315 if (totals != null) { | 1327 if (totals != null) { |
1316 _json["totals"] = totals.map((value) => (value).toJson()).toList(); | 1328 _json["totals"] = totals.map((value) => (value).toJson()).toList(); |
1317 } | 1329 } |
1318 return _json; | 1330 return _json; |
1319 } | 1331 } |
1320 } | 1332 } |
1321 | 1333 |
1322 /** The main request class which specifies the Reporting API request. */ | 1334 /// The main request class which specifies the Reporting API request. |
1323 class ReportRequest { | 1335 class ReportRequest { |
1324 /** | 1336 /// Cohort group associated with this request. If there is a cohort group |
1325 * Cohort group associated with this request. If there is a cohort group | 1337 /// in the request the `ga:cohort` dimension must be present. |
1326 * in the request the `ga:cohort` dimension must be present. | 1338 /// Every [ReportRequest](#ReportRequest) within a `batchGet` method must |
1327 * Every [ReportRequest](#ReportRequest) within a `batchGet` method must | 1339 /// contain the same `cohortGroup` definition. |
1328 * contain the same `cohortGroup` definition. | |
1329 */ | |
1330 CohortGroup cohortGroup; | 1340 CohortGroup cohortGroup; |
1331 /** | 1341 |
1332 * Date ranges in the request. The request can have a maximum of 2 date | 1342 /// Date ranges in the request. The request can have a maximum of 2 date |
1333 * ranges. The response will contain a set of metric values for each | 1343 /// ranges. The response will contain a set of metric values for each |
1334 * combination of the dimensions for each date range in the request. So, if | 1344 /// combination of the dimensions for each date range in the request. So, if |
1335 * there are two date ranges, there will be two set of metric values, one for | 1345 /// there are two date ranges, there will be two set of metric values, one |
1336 * the original date range and one for the second date range. | 1346 /// for |
1337 * The `reportRequest.dateRanges` field should not be specified for cohorts | 1347 /// the original date range and one for the second date range. |
1338 * or Lifetime value requests. | 1348 /// The `reportRequest.dateRanges` field should not be specified for cohorts |
1339 * If a date range is not provided, the default date range is (startDate: | 1349 /// or Lifetime value requests. |
1340 * current date - 7 days, endDate: current date - 1 day). Every | 1350 /// If a date range is not provided, the default date range is (startDate: |
1341 * [ReportRequest](#ReportRequest) within a `batchGet` method must | 1351 /// current date - 7 days, endDate: current date - 1 day). Every |
1342 * contain the same `dateRanges` definition. | 1352 /// [ReportRequest](#ReportRequest) within a `batchGet` method must |
1343 */ | 1353 /// contain the same `dateRanges` definition. |
1344 core.List<DateRange> dateRanges; | 1354 core.List<DateRange> dateRanges; |
1345 /** | 1355 |
1346 * The dimension filter clauses for filtering Dimension Values. They are | 1356 /// The dimension filter clauses for filtering Dimension Values. They are |
1347 * logically combined with the `AND` operator. Note that filtering occurs | 1357 /// logically combined with the `AND` operator. Note that filtering occurs |
1348 * before any dimensions are aggregated, so that the returned metrics | 1358 /// before any dimensions are aggregated, so that the returned metrics |
1349 * represent the total for only the relevant dimensions. | 1359 /// represent the total for only the relevant dimensions. |
1350 */ | |
1351 core.List<DimensionFilterClause> dimensionFilterClauses; | 1360 core.List<DimensionFilterClause> dimensionFilterClauses; |
1352 /** | 1361 |
1353 * The dimensions requested. | 1362 /// The dimensions requested. |
1354 * Requests can have a total of 7 dimensions. | 1363 /// Requests can have a total of 7 dimensions. |
1355 */ | |
1356 core.List<Dimension> dimensions; | 1364 core.List<Dimension> dimensions; |
1357 /** | 1365 |
1358 * Dimension or metric filters that restrict the data returned for your | 1366 /// Dimension or metric filters that restrict the data returned for your |
1359 * request. To use the `filtersExpression`, supply a dimension or metric on | 1367 /// request. To use the `filtersExpression`, supply a dimension or metric on |
1360 * which to filter, followed by the filter expression. For example, the | 1368 /// which to filter, followed by the filter expression. For example, the |
1361 * following expression selects `ga:browser` dimension which starts with | 1369 /// following expression selects `ga:browser` dimension which starts with |
1362 * Firefox; `ga:browser=~^Firefox`. For more information on dimensions | 1370 /// Firefox; `ga:browser=~^Firefox`. For more information on dimensions |
1363 * and metric filters, see | 1371 /// and metric filters, see |
1364 * [Filters | 1372 /// [Filters |
1365 * reference](https://developers.google.com/analytics/devguides/reporting/core
/v3/reference#filters). | 1373 /// reference](https://developers.google.com/analytics/devguides/reporting/cor
e/v3/reference#filters). |
1366 */ | |
1367 core.String filtersExpression; | 1374 core.String filtersExpression; |
1368 /** | 1375 |
1369 * If set to true, hides the total of all metrics for all the matching rows, | 1376 /// If set to true, hides the total of all metrics for all the matching rows, |
1370 * for every date range. The default false and will return the totals. | 1377 /// for every date range. The default false and will return the totals. |
1371 */ | |
1372 core.bool hideTotals; | 1378 core.bool hideTotals; |
1373 /** | 1379 |
1374 * If set to true, hides the minimum and maximum across all matching rows. | 1380 /// If set to true, hides the minimum and maximum across all matching rows. |
1375 * The default is false and the value ranges are returned. | 1381 /// The default is false and the value ranges are returned. |
1376 */ | |
1377 core.bool hideValueRanges; | 1382 core.bool hideValueRanges; |
1378 /** | 1383 |
1379 * If set to false, the response does not include rows if all the retrieved | 1384 /// If set to false, the response does not include rows if all the retrieved |
1380 * metrics are equal to zero. The default is false which will exclude these | 1385 /// metrics are equal to zero. The default is false which will exclude these |
1381 * rows. | 1386 /// rows. |
1382 */ | |
1383 core.bool includeEmptyRows; | 1387 core.bool includeEmptyRows; |
1384 /** | 1388 |
1385 * The metric filter clauses. They are logically combined with the `AND` | 1389 /// The metric filter clauses. They are logically combined with the `AND` |
1386 * operator. Metric filters look at only the first date range and not the | 1390 /// operator. Metric filters look at only the first date range and not the |
1387 * comparing date range. Note that filtering on metrics occurs after the | 1391 /// comparing date range. Note that filtering on metrics occurs after the |
1388 * metrics are aggregated. | 1392 /// metrics are aggregated. |
1389 */ | |
1390 core.List<MetricFilterClause> metricFilterClauses; | 1393 core.List<MetricFilterClause> metricFilterClauses; |
1391 /** | 1394 |
1392 * The metrics requested. | 1395 /// The metrics requested. |
1393 * Requests must specify at least one metric. Requests can have a | 1396 /// Requests must specify at least one metric. Requests can have a |
1394 * total of 10 metrics. | 1397 /// total of 10 metrics. |
1395 */ | |
1396 core.List<Metric> metrics; | 1398 core.List<Metric> metrics; |
1397 /** | 1399 |
1398 * Sort order on output rows. To compare two rows, the elements of the | 1400 /// Sort order on output rows. To compare two rows, the elements of the |
1399 * following are applied in order until a difference is found. All date | 1401 /// following are applied in order until a difference is found. All date |
1400 * ranges in the output get the same row order. | 1402 /// ranges in the output get the same row order. |
1401 */ | |
1402 core.List<OrderBy> orderBys; | 1403 core.List<OrderBy> orderBys; |
1403 /** | 1404 |
1404 * Page size is for paging and specifies the maximum number of returned rows. | 1405 /// Page size is for paging and specifies the maximum number of returned |
1405 * Page size should be >= 0. A query returns the default of 1,000 rows. | 1406 /// rows. |
1406 * The Analytics Core Reporting API returns a maximum of 10,000 rows per | 1407 /// Page size should be >= 0. A query returns the default of 1,000 rows. |
1407 * request, no matter how many you ask for. It can also return fewer rows | 1408 /// The Analytics Core Reporting API returns a maximum of 10,000 rows per |
1408 * than requested, if there aren't as many dimension segments as you expect. | 1409 /// request, no matter how many you ask for. It can also return fewer rows |
1409 * For instance, there are fewer than 300 possible values for `ga:country`, | 1410 /// than requested, if there aren't as many dimension segments as you expect. |
1410 * so when segmenting only by country, you can't get more than 300 rows, | 1411 /// For instance, there are fewer than 300 possible values for `ga:country`, |
1411 * even if you set `pageSize` to a higher value. | 1412 /// so when segmenting only by country, you can't get more than 300 rows, |
1412 */ | 1413 /// even if you set `pageSize` to a higher value. |
1413 core.int pageSize; | 1414 core.int pageSize; |
1414 /** | 1415 |
1415 * A continuation token to get the next page of the results. Adding this to | 1416 /// A continuation token to get the next page of the results. Adding this to |
1416 * the request will return the rows after the pageToken. The pageToken should | 1417 /// the request will return the rows after the pageToken. The pageToken |
1417 * be the value returned in the nextPageToken parameter in the response to | 1418 /// should |
1418 * the GetReports request. | 1419 /// be the value returned in the nextPageToken parameter in the response to |
1419 */ | 1420 /// the GetReports request. |
1420 core.String pageToken; | 1421 core.String pageToken; |
1421 /** The pivot definitions. Requests can have a maximum of 2 pivots. */ | 1422 |
| 1423 /// The pivot definitions. Requests can have a maximum of 2 pivots. |
1422 core.List<Pivot> pivots; | 1424 core.List<Pivot> pivots; |
1423 /** | 1425 |
1424 * The desired report | 1426 /// The desired report |
1425 * [sample](https://support.google.com/analytics/answer/2637192) size. | 1427 /// [sample](https://support.google.com/analytics/answer/2637192) size. |
1426 * If the the `samplingLevel` field is unspecified the `DEFAULT` sampling | 1428 /// If the the `samplingLevel` field is unspecified the `DEFAULT` sampling |
1427 * level is used. Every [ReportRequest](#ReportRequest) within a | 1429 /// level is used. Every [ReportRequest](#ReportRequest) within a |
1428 * `batchGet` method must contain the same `samplingLevel` definition. See | 1430 /// `batchGet` method must contain the same `samplingLevel` definition. See |
1429 * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) | 1431 /// [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) |
1430 * for details. | 1432 /// for details. |
1431 * Possible string values are: | 1433 /// Possible string values are: |
1432 * - "SAMPLING_UNSPECIFIED" : If the `samplingLevel` field is unspecified the | 1434 /// - "SAMPLING_UNSPECIFIED" : If the `samplingLevel` field is unspecified |
1433 * `DEFAULT` sampling level | 1435 /// the `DEFAULT` sampling level |
1434 * is used. | 1436 /// is used. |
1435 * - "DEFAULT" : Returns response with a sample size that balances speed and | 1437 /// - "DEFAULT" : Returns response with a sample size that balances speed and |
1436 * accuracy. | 1438 /// accuracy. |
1437 * - "SMALL" : It returns a fast response with a smaller sampling size. | 1439 /// - "SMALL" : It returns a fast response with a smaller sampling size. |
1438 * - "LARGE" : Returns a more accurate response using a large sampling size. | 1440 /// - "LARGE" : Returns a more accurate response using a large sampling size. |
1439 * But this | 1441 /// But this |
1440 * may result in response being slower. | 1442 /// may result in response being slower. |
1441 */ | |
1442 core.String samplingLevel; | 1443 core.String samplingLevel; |
1443 /** | 1444 |
1444 * Segment the data returned for the request. A segment definition helps look | 1445 /// Segment the data returned for the request. A segment definition helps |
1445 * at a subset of the segment request. A request can contain up to four | 1446 /// look |
1446 * segments. Every [ReportRequest](#ReportRequest) within a | 1447 /// at a subset of the segment request. A request can contain up to four |
1447 * `batchGet` method must contain the same `segments` definition. Requests | 1448 /// segments. Every [ReportRequest](#ReportRequest) within a |
1448 * with segments must have the `ga:segment` dimension. | 1449 /// `batchGet` method must contain the same `segments` definition. Requests |
1449 */ | 1450 /// with segments must have the `ga:segment` dimension. |
1450 core.List<Segment> segments; | 1451 core.List<Segment> segments; |
1451 /** | 1452 |
1452 * The Analytics | 1453 /// The Analytics |
1453 * [view ID](https://support.google.com/analytics/answer/1009618) | 1454 /// [view ID](https://support.google.com/analytics/answer/1009618) |
1454 * from which to retrieve data. Every [ReportRequest](#ReportRequest) | 1455 /// from which to retrieve data. Every [ReportRequest](#ReportRequest) |
1455 * within a `batchGet` method must contain the same `viewId`. | 1456 /// within a `batchGet` method must contain the same `viewId`. |
1456 */ | |
1457 core.String viewId; | 1457 core.String viewId; |
1458 | 1458 |
1459 ReportRequest(); | 1459 ReportRequest(); |
1460 | 1460 |
1461 ReportRequest.fromJson(core.Map _json) { | 1461 ReportRequest.fromJson(core.Map _json) { |
1462 if (_json.containsKey("cohortGroup")) { | 1462 if (_json.containsKey("cohortGroup")) { |
1463 cohortGroup = new CohortGroup.fromJson(_json["cohortGroup"]); | 1463 cohortGroup = new CohortGroup.fromJson(_json["cohortGroup"]); |
1464 } | 1464 } |
1465 if (_json.containsKey("dateRanges")) { | 1465 if (_json.containsKey("dateRanges")) { |
1466 dateRanges = _json["dateRanges"].map((value) => new DateRange.fromJson(val
ue)).toList(); | 1466 dateRanges = _json["dateRanges"] |
| 1467 .map((value) => new DateRange.fromJson(value)) |
| 1468 .toList(); |
1467 } | 1469 } |
1468 if (_json.containsKey("dimensionFilterClauses")) { | 1470 if (_json.containsKey("dimensionFilterClauses")) { |
1469 dimensionFilterClauses = _json["dimensionFilterClauses"].map((value) => ne
w DimensionFilterClause.fromJson(value)).toList(); | 1471 dimensionFilterClauses = _json["dimensionFilterClauses"] |
| 1472 .map((value) => new DimensionFilterClause.fromJson(value)) |
| 1473 .toList(); |
1470 } | 1474 } |
1471 if (_json.containsKey("dimensions")) { | 1475 if (_json.containsKey("dimensions")) { |
1472 dimensions = _json["dimensions"].map((value) => new Dimension.fromJson(val
ue)).toList(); | 1476 dimensions = _json["dimensions"] |
| 1477 .map((value) => new Dimension.fromJson(value)) |
| 1478 .toList(); |
1473 } | 1479 } |
1474 if (_json.containsKey("filtersExpression")) { | 1480 if (_json.containsKey("filtersExpression")) { |
1475 filtersExpression = _json["filtersExpression"]; | 1481 filtersExpression = _json["filtersExpression"]; |
1476 } | 1482 } |
1477 if (_json.containsKey("hideTotals")) { | 1483 if (_json.containsKey("hideTotals")) { |
1478 hideTotals = _json["hideTotals"]; | 1484 hideTotals = _json["hideTotals"]; |
1479 } | 1485 } |
1480 if (_json.containsKey("hideValueRanges")) { | 1486 if (_json.containsKey("hideValueRanges")) { |
1481 hideValueRanges = _json["hideValueRanges"]; | 1487 hideValueRanges = _json["hideValueRanges"]; |
1482 } | 1488 } |
1483 if (_json.containsKey("includeEmptyRows")) { | 1489 if (_json.containsKey("includeEmptyRows")) { |
1484 includeEmptyRows = _json["includeEmptyRows"]; | 1490 includeEmptyRows = _json["includeEmptyRows"]; |
1485 } | 1491 } |
1486 if (_json.containsKey("metricFilterClauses")) { | 1492 if (_json.containsKey("metricFilterClauses")) { |
1487 metricFilterClauses = _json["metricFilterClauses"].map((value) => new Metr
icFilterClause.fromJson(value)).toList(); | 1493 metricFilterClauses = _json["metricFilterClauses"] |
| 1494 .map((value) => new MetricFilterClause.fromJson(value)) |
| 1495 .toList(); |
1488 } | 1496 } |
1489 if (_json.containsKey("metrics")) { | 1497 if (_json.containsKey("metrics")) { |
1490 metrics = _json["metrics"].map((value) => new Metric.fromJson(value)).toLi
st(); | 1498 metrics = |
| 1499 _json["metrics"].map((value) => new Metric.fromJson(value)).toList(); |
1491 } | 1500 } |
1492 if (_json.containsKey("orderBys")) { | 1501 if (_json.containsKey("orderBys")) { |
1493 orderBys = _json["orderBys"].map((value) => new OrderBy.fromJson(value)).t
oList(); | 1502 orderBys = _json["orderBys"] |
| 1503 .map((value) => new OrderBy.fromJson(value)) |
| 1504 .toList(); |
1494 } | 1505 } |
1495 if (_json.containsKey("pageSize")) { | 1506 if (_json.containsKey("pageSize")) { |
1496 pageSize = _json["pageSize"]; | 1507 pageSize = _json["pageSize"]; |
1497 } | 1508 } |
1498 if (_json.containsKey("pageToken")) { | 1509 if (_json.containsKey("pageToken")) { |
1499 pageToken = _json["pageToken"]; | 1510 pageToken = _json["pageToken"]; |
1500 } | 1511 } |
1501 if (_json.containsKey("pivots")) { | 1512 if (_json.containsKey("pivots")) { |
1502 pivots = _json["pivots"].map((value) => new Pivot.fromJson(value)).toList(
); | 1513 pivots = |
| 1514 _json["pivots"].map((value) => new Pivot.fromJson(value)).toList(); |
1503 } | 1515 } |
1504 if (_json.containsKey("samplingLevel")) { | 1516 if (_json.containsKey("samplingLevel")) { |
1505 samplingLevel = _json["samplingLevel"]; | 1517 samplingLevel = _json["samplingLevel"]; |
1506 } | 1518 } |
1507 if (_json.containsKey("segments")) { | 1519 if (_json.containsKey("segments")) { |
1508 segments = _json["segments"].map((value) => new Segment.fromJson(value)).t
oList(); | 1520 segments = _json["segments"] |
| 1521 .map((value) => new Segment.fromJson(value)) |
| 1522 .toList(); |
1509 } | 1523 } |
1510 if (_json.containsKey("viewId")) { | 1524 if (_json.containsKey("viewId")) { |
1511 viewId = _json["viewId"]; | 1525 viewId = _json["viewId"]; |
1512 } | 1526 } |
1513 } | 1527 } |
1514 | 1528 |
1515 core.Map<core.String, core.Object> toJson() { | 1529 core.Map<core.String, core.Object> toJson() { |
1516 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1530 final core.Map<core.String, core.Object> _json = |
| 1531 new core.Map<core.String, core.Object>(); |
1517 if (cohortGroup != null) { | 1532 if (cohortGroup != null) { |
1518 _json["cohortGroup"] = (cohortGroup).toJson(); | 1533 _json["cohortGroup"] = (cohortGroup).toJson(); |
1519 } | 1534 } |
1520 if (dateRanges != null) { | 1535 if (dateRanges != null) { |
1521 _json["dateRanges"] = dateRanges.map((value) => (value).toJson()).toList()
; | 1536 _json["dateRanges"] = |
| 1537 dateRanges.map((value) => (value).toJson()).toList(); |
1522 } | 1538 } |
1523 if (dimensionFilterClauses != null) { | 1539 if (dimensionFilterClauses != null) { |
1524 _json["dimensionFilterClauses"] = dimensionFilterClauses.map((value) => (v
alue).toJson()).toList(); | 1540 _json["dimensionFilterClauses"] = |
| 1541 dimensionFilterClauses.map((value) => (value).toJson()).toList(); |
1525 } | 1542 } |
1526 if (dimensions != null) { | 1543 if (dimensions != null) { |
1527 _json["dimensions"] = dimensions.map((value) => (value).toJson()).toList()
; | 1544 _json["dimensions"] = |
| 1545 dimensions.map((value) => (value).toJson()).toList(); |
1528 } | 1546 } |
1529 if (filtersExpression != null) { | 1547 if (filtersExpression != null) { |
1530 _json["filtersExpression"] = filtersExpression; | 1548 _json["filtersExpression"] = filtersExpression; |
1531 } | 1549 } |
1532 if (hideTotals != null) { | 1550 if (hideTotals != null) { |
1533 _json["hideTotals"] = hideTotals; | 1551 _json["hideTotals"] = hideTotals; |
1534 } | 1552 } |
1535 if (hideValueRanges != null) { | 1553 if (hideValueRanges != null) { |
1536 _json["hideValueRanges"] = hideValueRanges; | 1554 _json["hideValueRanges"] = hideValueRanges; |
1537 } | 1555 } |
1538 if (includeEmptyRows != null) { | 1556 if (includeEmptyRows != null) { |
1539 _json["includeEmptyRows"] = includeEmptyRows; | 1557 _json["includeEmptyRows"] = includeEmptyRows; |
1540 } | 1558 } |
1541 if (metricFilterClauses != null) { | 1559 if (metricFilterClauses != null) { |
1542 _json["metricFilterClauses"] = metricFilterClauses.map((value) => (value).
toJson()).toList(); | 1560 _json["metricFilterClauses"] = |
| 1561 metricFilterClauses.map((value) => (value).toJson()).toList(); |
1543 } | 1562 } |
1544 if (metrics != null) { | 1563 if (metrics != null) { |
1545 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); | 1564 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); |
1546 } | 1565 } |
1547 if (orderBys != null) { | 1566 if (orderBys != null) { |
1548 _json["orderBys"] = orderBys.map((value) => (value).toJson()).toList(); | 1567 _json["orderBys"] = orderBys.map((value) => (value).toJson()).toList(); |
1549 } | 1568 } |
1550 if (pageSize != null) { | 1569 if (pageSize != null) { |
1551 _json["pageSize"] = pageSize; | 1570 _json["pageSize"] = pageSize; |
1552 } | 1571 } |
1553 if (pageToken != null) { | 1572 if (pageToken != null) { |
1554 _json["pageToken"] = pageToken; | 1573 _json["pageToken"] = pageToken; |
1555 } | 1574 } |
1556 if (pivots != null) { | 1575 if (pivots != null) { |
1557 _json["pivots"] = pivots.map((value) => (value).toJson()).toList(); | 1576 _json["pivots"] = pivots.map((value) => (value).toJson()).toList(); |
1558 } | 1577 } |
1559 if (samplingLevel != null) { | 1578 if (samplingLevel != null) { |
1560 _json["samplingLevel"] = samplingLevel; | 1579 _json["samplingLevel"] = samplingLevel; |
1561 } | 1580 } |
1562 if (segments != null) { | 1581 if (segments != null) { |
1563 _json["segments"] = segments.map((value) => (value).toJson()).toList(); | 1582 _json["segments"] = segments.map((value) => (value).toJson()).toList(); |
1564 } | 1583 } |
1565 if (viewId != null) { | 1584 if (viewId != null) { |
1566 _json["viewId"] = viewId; | 1585 _json["viewId"] = viewId; |
1567 } | 1586 } |
1568 return _json; | 1587 return _json; |
1569 } | 1588 } |
1570 } | 1589 } |
1571 | 1590 |
1572 /** A row in the report. */ | 1591 /// A row in the report. |
1573 class ReportRow { | 1592 class ReportRow { |
1574 /** List of requested dimensions. */ | 1593 /// List of requested dimensions. |
1575 core.List<core.String> dimensions; | 1594 core.List<core.String> dimensions; |
1576 /** List of metrics for each requested DateRange. */ | 1595 |
| 1596 /// List of metrics for each requested DateRange. |
1577 core.List<DateRangeValues> metrics; | 1597 core.List<DateRangeValues> metrics; |
1578 | 1598 |
1579 ReportRow(); | 1599 ReportRow(); |
1580 | 1600 |
1581 ReportRow.fromJson(core.Map _json) { | 1601 ReportRow.fromJson(core.Map _json) { |
1582 if (_json.containsKey("dimensions")) { | 1602 if (_json.containsKey("dimensions")) { |
1583 dimensions = _json["dimensions"]; | 1603 dimensions = _json["dimensions"]; |
1584 } | 1604 } |
1585 if (_json.containsKey("metrics")) { | 1605 if (_json.containsKey("metrics")) { |
1586 metrics = _json["metrics"].map((value) => new DateRangeValues.fromJson(val
ue)).toList(); | 1606 metrics = _json["metrics"] |
| 1607 .map((value) => new DateRangeValues.fromJson(value)) |
| 1608 .toList(); |
1587 } | 1609 } |
1588 } | 1610 } |
1589 | 1611 |
1590 core.Map<core.String, core.Object> toJson() { | 1612 core.Map<core.String, core.Object> toJson() { |
1591 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1613 final core.Map<core.String, core.Object> _json = |
| 1614 new core.Map<core.String, core.Object>(); |
1592 if (dimensions != null) { | 1615 if (dimensions != null) { |
1593 _json["dimensions"] = dimensions; | 1616 _json["dimensions"] = dimensions; |
1594 } | 1617 } |
1595 if (metrics != null) { | 1618 if (metrics != null) { |
1596 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); | 1619 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); |
1597 } | 1620 } |
1598 return _json; | 1621 return _json; |
1599 } | 1622 } |
1600 } | 1623 } |
1601 | 1624 |
1602 /** | 1625 /// The segment definition, if the report needs to be segmented. |
1603 * The segment definition, if the report needs to be segmented. | 1626 /// A Segment is a subset of the Analytics data. For example, of the entire |
1604 * A Segment is a subset of the Analytics data. For example, of the entire | 1627 /// set of users, one Segment might be users from a particular country or city. |
1605 * set of users, one Segment might be users from a particular country or city. | |
1606 */ | |
1607 class Segment { | 1628 class Segment { |
1608 /** A dynamic segment definition in the request. */ | 1629 /// A dynamic segment definition in the request. |
1609 DynamicSegment dynamicSegment; | 1630 DynamicSegment dynamicSegment; |
1610 /** | 1631 |
1611 * The segment ID of a built-in or custom segment, for example `gaid::-3`. | 1632 /// The segment ID of a built-in or custom segment, for example `gaid::-3`. |
1612 */ | |
1613 core.String segmentId; | 1633 core.String segmentId; |
1614 | 1634 |
1615 Segment(); | 1635 Segment(); |
1616 | 1636 |
1617 Segment.fromJson(core.Map _json) { | 1637 Segment.fromJson(core.Map _json) { |
1618 if (_json.containsKey("dynamicSegment")) { | 1638 if (_json.containsKey("dynamicSegment")) { |
1619 dynamicSegment = new DynamicSegment.fromJson(_json["dynamicSegment"]); | 1639 dynamicSegment = new DynamicSegment.fromJson(_json["dynamicSegment"]); |
1620 } | 1640 } |
1621 if (_json.containsKey("segmentId")) { | 1641 if (_json.containsKey("segmentId")) { |
1622 segmentId = _json["segmentId"]; | 1642 segmentId = _json["segmentId"]; |
1623 } | 1643 } |
1624 } | 1644 } |
1625 | 1645 |
1626 core.Map<core.String, core.Object> toJson() { | 1646 core.Map<core.String, core.Object> toJson() { |
1627 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1647 final core.Map<core.String, core.Object> _json = |
| 1648 new core.Map<core.String, core.Object>(); |
1628 if (dynamicSegment != null) { | 1649 if (dynamicSegment != null) { |
1629 _json["dynamicSegment"] = (dynamicSegment).toJson(); | 1650 _json["dynamicSegment"] = (dynamicSegment).toJson(); |
1630 } | 1651 } |
1631 if (segmentId != null) { | 1652 if (segmentId != null) { |
1632 _json["segmentId"] = segmentId; | 1653 _json["segmentId"] = segmentId; |
1633 } | 1654 } |
1634 return _json; | 1655 return _json; |
1635 } | 1656 } |
1636 } | 1657 } |
1637 | 1658 |
1638 /** | 1659 /// SegmentDefinition defines the segment to be a set of SegmentFilters which |
1639 * SegmentDefinition defines the segment to be a set of SegmentFilters which | 1660 /// are combined together with a logical `AND` operation. |
1640 * are combined together with a logical `AND` operation. | |
1641 */ | |
1642 class SegmentDefinition { | 1661 class SegmentDefinition { |
1643 /** | 1662 /// A segment is defined by a set of segment filters which are combined |
1644 * A segment is defined by a set of segment filters which are combined | 1663 /// together with a logical `AND` operation. |
1645 * together with a logical `AND` operation. | |
1646 */ | |
1647 core.List<SegmentFilter> segmentFilters; | 1664 core.List<SegmentFilter> segmentFilters; |
1648 | 1665 |
1649 SegmentDefinition(); | 1666 SegmentDefinition(); |
1650 | 1667 |
1651 SegmentDefinition.fromJson(core.Map _json) { | 1668 SegmentDefinition.fromJson(core.Map _json) { |
1652 if (_json.containsKey("segmentFilters")) { | 1669 if (_json.containsKey("segmentFilters")) { |
1653 segmentFilters = _json["segmentFilters"].map((value) => new SegmentFilter.
fromJson(value)).toList(); | 1670 segmentFilters = _json["segmentFilters"] |
| 1671 .map((value) => new SegmentFilter.fromJson(value)) |
| 1672 .toList(); |
1654 } | 1673 } |
1655 } | 1674 } |
1656 | 1675 |
1657 core.Map<core.String, core.Object> toJson() { | 1676 core.Map<core.String, core.Object> toJson() { |
1658 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1677 final core.Map<core.String, core.Object> _json = |
| 1678 new core.Map<core.String, core.Object>(); |
1659 if (segmentFilters != null) { | 1679 if (segmentFilters != null) { |
1660 _json["segmentFilters"] = segmentFilters.map((value) => (value).toJson()).
toList(); | 1680 _json["segmentFilters"] = |
| 1681 segmentFilters.map((value) => (value).toJson()).toList(); |
1661 } | 1682 } |
1662 return _json; | 1683 return _json; |
1663 } | 1684 } |
1664 } | 1685 } |
1665 | 1686 |
1666 /** Dimension filter specifies the filtering options on a dimension. */ | 1687 /// Dimension filter specifies the filtering options on a dimension. |
1667 class SegmentDimensionFilter { | 1688 class SegmentDimensionFilter { |
1668 /** Should the match be case sensitive, ignored for `IN_LIST` operator. */ | 1689 /// Should the match be case sensitive, ignored for `IN_LIST` operator. |
1669 core.bool caseSensitive; | 1690 core.bool caseSensitive; |
1670 /** Name of the dimension for which the filter is being applied. */ | 1691 |
| 1692 /// Name of the dimension for which the filter is being applied. |
1671 core.String dimensionName; | 1693 core.String dimensionName; |
1672 /** | 1694 |
1673 * The list of expressions, only the first element is used for all operators | 1695 /// The list of expressions, only the first element is used for all operators |
1674 */ | |
1675 core.List<core.String> expressions; | 1696 core.List<core.String> expressions; |
1676 /** Maximum comparison values for `BETWEEN` match type. */ | 1697 |
| 1698 /// Maximum comparison values for `BETWEEN` match type. |
1677 core.String maxComparisonValue; | 1699 core.String maxComparisonValue; |
1678 /** Minimum comparison values for `BETWEEN` match type. */ | 1700 |
| 1701 /// Minimum comparison values for `BETWEEN` match type. |
1679 core.String minComparisonValue; | 1702 core.String minComparisonValue; |
1680 /** | 1703 |
1681 * The operator to use to match the dimension with the expressions. | 1704 /// The operator to use to match the dimension with the expressions. |
1682 * Possible string values are: | 1705 /// Possible string values are: |
1683 * - "OPERATOR_UNSPECIFIED" : If the match type is unspecified, it is treated | 1706 /// - "OPERATOR_UNSPECIFIED" : If the match type is unspecified, it is |
1684 * as a REGEXP. | 1707 /// treated as a REGEXP. |
1685 * - "REGEXP" : The match expression is treated as a regular expression. All | 1708 /// - "REGEXP" : The match expression is treated as a regular expression. All |
1686 * other match | 1709 /// other match |
1687 * types are not treated as regular expressions. | 1710 /// types are not treated as regular expressions. |
1688 * - "BEGINS_WITH" : Matches the values which begin with the match expression | 1711 /// - "BEGINS_WITH" : Matches the values which begin with the match |
1689 * provided. | 1712 /// expression provided. |
1690 * - "ENDS_WITH" : Matches the values which end with the match expression | 1713 /// - "ENDS_WITH" : Matches the values which end with the match expression |
1691 * provided. | 1714 /// provided. |
1692 * - "PARTIAL" : Substring match. | 1715 /// - "PARTIAL" : Substring match. |
1693 * - "EXACT" : The value should match the match expression entirely. | 1716 /// - "EXACT" : The value should match the match expression entirely. |
1694 * - "IN_LIST" : This option is used to specify a dimension filter whose | 1717 /// - "IN_LIST" : This option is used to specify a dimension filter whose |
1695 * expression can | 1718 /// expression can |
1696 * take any value from a selected list of values. This helps avoiding | 1719 /// take any value from a selected list of values. This helps avoiding |
1697 * evaluating multiple exact match dimension filters which are OR'ed for | 1720 /// evaluating multiple exact match dimension filters which are OR'ed for |
1698 * every single response row. For example: | 1721 /// every single response row. For example: |
1699 * | 1722 /// |
1700 * expressions: ["A", "B", "C"] | 1723 /// expressions: ["A", "B", "C"] |
1701 * | 1724 /// |
1702 * Any response row whose dimension has it is value as A, B or C, matches | 1725 /// Any response row whose dimension has it is value as A, B or C, matches |
1703 * this DimensionFilter. | 1726 /// this DimensionFilter. |
1704 * - "NUMERIC_LESS_THAN" : Integer comparison filters. | 1727 /// - "NUMERIC_LESS_THAN" : Integer comparison filters. |
1705 * case sensitivity is ignored for these and the expression | 1728 /// case sensitivity is ignored for these and the expression |
1706 * is assumed to be a string representing an integer. | 1729 /// is assumed to be a string representing an integer. |
1707 * Failure conditions: | 1730 /// Failure conditions: |
1708 * | 1731 /// |
1709 * - if expression is not a valid int64, the client should expect | 1732 /// - if expression is not a valid int64, the client should expect |
1710 * an error. | 1733 /// an error. |
1711 * - input dimensions that are not valid int64 values will never match the | 1734 /// - input dimensions that are not valid int64 values will never match the |
1712 * filter. | 1735 /// filter. |
1713 * | 1736 /// |
1714 * Checks if the dimension is numerically less than the match expression. | 1737 /// Checks if the dimension is numerically less than the match expression. |
1715 * - "NUMERIC_GREATER_THAN" : Checks if the dimension is numerically greater | 1738 /// - "NUMERIC_GREATER_THAN" : Checks if the dimension is numerically greater |
1716 * than the match | 1739 /// than the match |
1717 * expression. | 1740 /// expression. |
1718 * - "NUMERIC_BETWEEN" : Checks if the dimension is numerically between the | 1741 /// - "NUMERIC_BETWEEN" : Checks if the dimension is numerically between the |
1719 * minimum and maximum | 1742 /// minimum and maximum |
1720 * of the match expression, boundaries excluded. | 1743 /// of the match expression, boundaries excluded. |
1721 */ | |
1722 core.String operator; | 1744 core.String operator; |
1723 | 1745 |
1724 SegmentDimensionFilter(); | 1746 SegmentDimensionFilter(); |
1725 | 1747 |
1726 SegmentDimensionFilter.fromJson(core.Map _json) { | 1748 SegmentDimensionFilter.fromJson(core.Map _json) { |
1727 if (_json.containsKey("caseSensitive")) { | 1749 if (_json.containsKey("caseSensitive")) { |
1728 caseSensitive = _json["caseSensitive"]; | 1750 caseSensitive = _json["caseSensitive"]; |
1729 } | 1751 } |
1730 if (_json.containsKey("dimensionName")) { | 1752 if (_json.containsKey("dimensionName")) { |
1731 dimensionName = _json["dimensionName"]; | 1753 dimensionName = _json["dimensionName"]; |
1732 } | 1754 } |
1733 if (_json.containsKey("expressions")) { | 1755 if (_json.containsKey("expressions")) { |
1734 expressions = _json["expressions"]; | 1756 expressions = _json["expressions"]; |
1735 } | 1757 } |
1736 if (_json.containsKey("maxComparisonValue")) { | 1758 if (_json.containsKey("maxComparisonValue")) { |
1737 maxComparisonValue = _json["maxComparisonValue"]; | 1759 maxComparisonValue = _json["maxComparisonValue"]; |
1738 } | 1760 } |
1739 if (_json.containsKey("minComparisonValue")) { | 1761 if (_json.containsKey("minComparisonValue")) { |
1740 minComparisonValue = _json["minComparisonValue"]; | 1762 minComparisonValue = _json["minComparisonValue"]; |
1741 } | 1763 } |
1742 if (_json.containsKey("operator")) { | 1764 if (_json.containsKey("operator")) { |
1743 operator = _json["operator"]; | 1765 operator = _json["operator"]; |
1744 } | 1766 } |
1745 } | 1767 } |
1746 | 1768 |
1747 core.Map<core.String, core.Object> toJson() { | 1769 core.Map<core.String, core.Object> toJson() { |
1748 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1770 final core.Map<core.String, core.Object> _json = |
| 1771 new core.Map<core.String, core.Object>(); |
1749 if (caseSensitive != null) { | 1772 if (caseSensitive != null) { |
1750 _json["caseSensitive"] = caseSensitive; | 1773 _json["caseSensitive"] = caseSensitive; |
1751 } | 1774 } |
1752 if (dimensionName != null) { | 1775 if (dimensionName != null) { |
1753 _json["dimensionName"] = dimensionName; | 1776 _json["dimensionName"] = dimensionName; |
1754 } | 1777 } |
1755 if (expressions != null) { | 1778 if (expressions != null) { |
1756 _json["expressions"] = expressions; | 1779 _json["expressions"] = expressions; |
1757 } | 1780 } |
1758 if (maxComparisonValue != null) { | 1781 if (maxComparisonValue != null) { |
1759 _json["maxComparisonValue"] = maxComparisonValue; | 1782 _json["maxComparisonValue"] = maxComparisonValue; |
1760 } | 1783 } |
1761 if (minComparisonValue != null) { | 1784 if (minComparisonValue != null) { |
1762 _json["minComparisonValue"] = minComparisonValue; | 1785 _json["minComparisonValue"] = minComparisonValue; |
1763 } | 1786 } |
1764 if (operator != null) { | 1787 if (operator != null) { |
1765 _json["operator"] = operator; | 1788 _json["operator"] = operator; |
1766 } | 1789 } |
1767 return _json; | 1790 return _json; |
1768 } | 1791 } |
1769 } | 1792 } |
1770 | 1793 |
1771 /** | 1794 /// SegmentFilter defines the segment to be either a simple or a sequence |
1772 * SegmentFilter defines the segment to be either a simple or a sequence | 1795 /// segment. A simple segment condition contains dimension and metric |
1773 * segment. A simple segment condition contains dimension and metric conditions | 1796 /// conditions |
1774 * to select the sessions or users. A sequence segment condition can be used to | 1797 /// to select the sessions or users. A sequence segment condition can be used |
1775 * select users or sessions based on sequential conditions. | 1798 /// to |
1776 */ | 1799 /// select users or sessions based on sequential conditions. |
1777 class SegmentFilter { | 1800 class SegmentFilter { |
1778 /** | 1801 /// If true, match the complement of simple or sequence segment. |
1779 * If true, match the complement of simple or sequence segment. | 1802 /// For example, to match all visits not from "New York", we can define the |
1780 * For example, to match all visits not from "New York", we can define the | 1803 /// segment as follows: |
1781 * segment as follows: | 1804 /// |
1782 * | 1805 /// "sessionSegment": { |
1783 * "sessionSegment": { | 1806 /// "segmentFilters": [{ |
1784 * "segmentFilters": [{ | 1807 /// "simpleSegment" :{ |
1785 * "simpleSegment" :{ | 1808 /// "orFiltersForSegment": [{ |
1786 * "orFiltersForSegment": [{ | 1809 /// "segmentFilterClauses":[{ |
1787 * "segmentFilterClauses":[{ | 1810 /// "dimensionFilter": { |
1788 * "dimensionFilter": { | 1811 /// "dimensionName": "ga:city", |
1789 * "dimensionName": "ga:city", | 1812 /// "expressions": ["New York"] |
1790 * "expressions": ["New York"] | 1813 /// } |
1791 * } | 1814 /// }] |
1792 * }] | 1815 /// }] |
1793 * }] | 1816 /// }, |
1794 * }, | 1817 /// "not": "True" |
1795 * "not": "True" | 1818 /// }] |
1796 * }] | 1819 /// }, |
1797 * }, | |
1798 */ | |
1799 core.bool not; | 1820 core.bool not; |
1800 /** | 1821 |
1801 * Sequence conditions consist of one or more steps, where each step is | 1822 /// Sequence conditions consist of one or more steps, where each step is |
1802 * defined by one or more dimension/metric conditions. Multiple steps can | 1823 /// defined by one or more dimension/metric conditions. Multiple steps can |
1803 * be combined with special sequence operators. | 1824 /// be combined with special sequence operators. |
1804 */ | |
1805 SequenceSegment sequenceSegment; | 1825 SequenceSegment sequenceSegment; |
1806 /** | 1826 |
1807 * A Simple segment conditions consist of one or more dimension/metric | 1827 /// A Simple segment conditions consist of one or more dimension/metric |
1808 * conditions that can be combined | 1828 /// conditions that can be combined |
1809 */ | |
1810 SimpleSegment simpleSegment; | 1829 SimpleSegment simpleSegment; |
1811 | 1830 |
1812 SegmentFilter(); | 1831 SegmentFilter(); |
1813 | 1832 |
1814 SegmentFilter.fromJson(core.Map _json) { | 1833 SegmentFilter.fromJson(core.Map _json) { |
1815 if (_json.containsKey("not")) { | 1834 if (_json.containsKey("not")) { |
1816 not = _json["not"]; | 1835 not = _json["not"]; |
1817 } | 1836 } |
1818 if (_json.containsKey("sequenceSegment")) { | 1837 if (_json.containsKey("sequenceSegment")) { |
1819 sequenceSegment = new SequenceSegment.fromJson(_json["sequenceSegment"]); | 1838 sequenceSegment = new SequenceSegment.fromJson(_json["sequenceSegment"]); |
1820 } | 1839 } |
1821 if (_json.containsKey("simpleSegment")) { | 1840 if (_json.containsKey("simpleSegment")) { |
1822 simpleSegment = new SimpleSegment.fromJson(_json["simpleSegment"]); | 1841 simpleSegment = new SimpleSegment.fromJson(_json["simpleSegment"]); |
1823 } | 1842 } |
1824 } | 1843 } |
1825 | 1844 |
1826 core.Map<core.String, core.Object> toJson() { | 1845 core.Map<core.String, core.Object> toJson() { |
1827 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1846 final core.Map<core.String, core.Object> _json = |
| 1847 new core.Map<core.String, core.Object>(); |
1828 if (not != null) { | 1848 if (not != null) { |
1829 _json["not"] = not; | 1849 _json["not"] = not; |
1830 } | 1850 } |
1831 if (sequenceSegment != null) { | 1851 if (sequenceSegment != null) { |
1832 _json["sequenceSegment"] = (sequenceSegment).toJson(); | 1852 _json["sequenceSegment"] = (sequenceSegment).toJson(); |
1833 } | 1853 } |
1834 if (simpleSegment != null) { | 1854 if (simpleSegment != null) { |
1835 _json["simpleSegment"] = (simpleSegment).toJson(); | 1855 _json["simpleSegment"] = (simpleSegment).toJson(); |
1836 } | 1856 } |
1837 return _json; | 1857 return _json; |
1838 } | 1858 } |
1839 } | 1859 } |
1840 | 1860 |
1841 /** | 1861 /// Filter Clause to be used in a segment definition, can be wither a metric or |
1842 * Filter Clause to be used in a segment definition, can be wither a metric or | 1862 /// a dimension filter. |
1843 * a dimension filter. | |
1844 */ | |
1845 class SegmentFilterClause { | 1863 class SegmentFilterClause { |
1846 /** Dimension Filter for the segment definition. */ | 1864 /// Dimension Filter for the segment definition. |
1847 SegmentDimensionFilter dimensionFilter; | 1865 SegmentDimensionFilter dimensionFilter; |
1848 /** Metric Filter for the segment definition. */ | 1866 |
| 1867 /// Metric Filter for the segment definition. |
1849 SegmentMetricFilter metricFilter; | 1868 SegmentMetricFilter metricFilter; |
1850 /** Matches the complement (`!`) of the filter. */ | 1869 |
| 1870 /// Matches the complement (`!`) of the filter. |
1851 core.bool not; | 1871 core.bool not; |
1852 | 1872 |
1853 SegmentFilterClause(); | 1873 SegmentFilterClause(); |
1854 | 1874 |
1855 SegmentFilterClause.fromJson(core.Map _json) { | 1875 SegmentFilterClause.fromJson(core.Map _json) { |
1856 if (_json.containsKey("dimensionFilter")) { | 1876 if (_json.containsKey("dimensionFilter")) { |
1857 dimensionFilter = new SegmentDimensionFilter.fromJson(_json["dimensionFilt
er"]); | 1877 dimensionFilter = |
| 1878 new SegmentDimensionFilter.fromJson(_json["dimensionFilter"]); |
1858 } | 1879 } |
1859 if (_json.containsKey("metricFilter")) { | 1880 if (_json.containsKey("metricFilter")) { |
1860 metricFilter = new SegmentMetricFilter.fromJson(_json["metricFilter"]); | 1881 metricFilter = new SegmentMetricFilter.fromJson(_json["metricFilter"]); |
1861 } | 1882 } |
1862 if (_json.containsKey("not")) { | 1883 if (_json.containsKey("not")) { |
1863 not = _json["not"]; | 1884 not = _json["not"]; |
1864 } | 1885 } |
1865 } | 1886 } |
1866 | 1887 |
1867 core.Map<core.String, core.Object> toJson() { | 1888 core.Map<core.String, core.Object> toJson() { |
1868 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1889 final core.Map<core.String, core.Object> _json = |
| 1890 new core.Map<core.String, core.Object>(); |
1869 if (dimensionFilter != null) { | 1891 if (dimensionFilter != null) { |
1870 _json["dimensionFilter"] = (dimensionFilter).toJson(); | 1892 _json["dimensionFilter"] = (dimensionFilter).toJson(); |
1871 } | 1893 } |
1872 if (metricFilter != null) { | 1894 if (metricFilter != null) { |
1873 _json["metricFilter"] = (metricFilter).toJson(); | 1895 _json["metricFilter"] = (metricFilter).toJson(); |
1874 } | 1896 } |
1875 if (not != null) { | 1897 if (not != null) { |
1876 _json["not"] = not; | 1898 _json["not"] = not; |
1877 } | 1899 } |
1878 return _json; | 1900 return _json; |
1879 } | 1901 } |
1880 } | 1902 } |
1881 | 1903 |
1882 /** Metric filter to be used in a segment filter clause. */ | 1904 /// Metric filter to be used in a segment filter clause. |
1883 class SegmentMetricFilter { | 1905 class SegmentMetricFilter { |
1884 /** | 1906 /// The value to compare against. If the operator is `BETWEEN`, this value is |
1885 * The value to compare against. If the operator is `BETWEEN`, this value is | 1907 /// treated as minimum comparison value. |
1886 * treated as minimum comparison value. | |
1887 */ | |
1888 core.String comparisonValue; | 1908 core.String comparisonValue; |
1889 /** Max comparison value is only used for `BETWEEN` operator. */ | 1909 |
| 1910 /// Max comparison value is only used for `BETWEEN` operator. |
1890 core.String maxComparisonValue; | 1911 core.String maxComparisonValue; |
1891 /** | 1912 |
1892 * The metric that will be filtered on. A `metricFilter` must contain a | 1913 /// The metric that will be filtered on. A `metricFilter` must contain a |
1893 * metric name. | 1914 /// metric name. |
1894 */ | |
1895 core.String metricName; | 1915 core.String metricName; |
1896 /** | 1916 |
1897 * Specifies is the operation to perform to compare the metric. The default | 1917 /// Specifies is the operation to perform to compare the metric. The default |
1898 * is `EQUAL`. | 1918 /// is `EQUAL`. |
1899 * Possible string values are: | 1919 /// Possible string values are: |
1900 * - "UNSPECIFIED_OPERATOR" : Unspecified operator is treated as `LESS_THAN` | 1920 /// - "UNSPECIFIED_OPERATOR" : Unspecified operator is treated as `LESS_THAN` |
1901 * operator. | 1921 /// operator. |
1902 * - "LESS_THAN" : Checks if the metric value is less than comparison value. | 1922 /// - "LESS_THAN" : Checks if the metric value is less than comparison value. |
1903 * - "GREATER_THAN" : Checks if the metric value is greater than comparison | 1923 /// - "GREATER_THAN" : Checks if the metric value is greater than comparison |
1904 * value. | 1924 /// value. |
1905 * - "EQUAL" : Equals operator. | 1925 /// - "EQUAL" : Equals operator. |
1906 * - "BETWEEN" : For between operator, both the minimum and maximum are | 1926 /// - "BETWEEN" : For between operator, both the minimum and maximum are |
1907 * exclusive. | 1927 /// exclusive. |
1908 * We will use `LT` and `GT` for comparison. | 1928 /// We will use `LT` and `GT` for comparison. |
1909 */ | |
1910 core.String operator; | 1929 core.String operator; |
1911 /** | 1930 |
1912 * Scope for a metric defines the level at which that metric is defined. The | 1931 /// Scope for a metric defines the level at which that metric is defined. |
1913 * specified metric scope must be equal to or greater than its primary scope | 1932 /// The |
1914 * as defined in the data model. The primary scope is defined by if the | 1933 /// specified metric scope must be equal to or greater than its primary scope |
1915 * segment is selecting users or sessions. | 1934 /// as defined in the data model. The primary scope is defined by if the |
1916 * Possible string values are: | 1935 /// segment is selecting users or sessions. |
1917 * - "UNSPECIFIED_SCOPE" : If the scope is unspecified, it defaults to the | 1936 /// Possible string values are: |
1918 * condition scope, | 1937 /// - "UNSPECIFIED_SCOPE" : If the scope is unspecified, it defaults to the |
1919 * `USER` or `SESSION` depending on if the segment is trying to choose | 1938 /// condition scope, |
1920 * users or sessions. | 1939 /// `USER` or `SESSION` depending on if the segment is trying to choose |
1921 * - "PRODUCT" : Product scope. | 1940 /// users or sessions. |
1922 * - "HIT" : Hit scope. | 1941 /// - "PRODUCT" : Product scope. |
1923 * - "SESSION" : Session scope. | 1942 /// - "HIT" : Hit scope. |
1924 * - "USER" : User scope. | 1943 /// - "SESSION" : Session scope. |
1925 */ | 1944 /// - "USER" : User scope. |
1926 core.String scope; | 1945 core.String scope; |
1927 | 1946 |
1928 SegmentMetricFilter(); | 1947 SegmentMetricFilter(); |
1929 | 1948 |
1930 SegmentMetricFilter.fromJson(core.Map _json) { | 1949 SegmentMetricFilter.fromJson(core.Map _json) { |
1931 if (_json.containsKey("comparisonValue")) { | 1950 if (_json.containsKey("comparisonValue")) { |
1932 comparisonValue = _json["comparisonValue"]; | 1951 comparisonValue = _json["comparisonValue"]; |
1933 } | 1952 } |
1934 if (_json.containsKey("maxComparisonValue")) { | 1953 if (_json.containsKey("maxComparisonValue")) { |
1935 maxComparisonValue = _json["maxComparisonValue"]; | 1954 maxComparisonValue = _json["maxComparisonValue"]; |
1936 } | 1955 } |
1937 if (_json.containsKey("metricName")) { | 1956 if (_json.containsKey("metricName")) { |
1938 metricName = _json["metricName"]; | 1957 metricName = _json["metricName"]; |
1939 } | 1958 } |
1940 if (_json.containsKey("operator")) { | 1959 if (_json.containsKey("operator")) { |
1941 operator = _json["operator"]; | 1960 operator = _json["operator"]; |
1942 } | 1961 } |
1943 if (_json.containsKey("scope")) { | 1962 if (_json.containsKey("scope")) { |
1944 scope = _json["scope"]; | 1963 scope = _json["scope"]; |
1945 } | 1964 } |
1946 } | 1965 } |
1947 | 1966 |
1948 core.Map<core.String, core.Object> toJson() { | 1967 core.Map<core.String, core.Object> toJson() { |
1949 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1968 final core.Map<core.String, core.Object> _json = |
| 1969 new core.Map<core.String, core.Object>(); |
1950 if (comparisonValue != null) { | 1970 if (comparisonValue != null) { |
1951 _json["comparisonValue"] = comparisonValue; | 1971 _json["comparisonValue"] = comparisonValue; |
1952 } | 1972 } |
1953 if (maxComparisonValue != null) { | 1973 if (maxComparisonValue != null) { |
1954 _json["maxComparisonValue"] = maxComparisonValue; | 1974 _json["maxComparisonValue"] = maxComparisonValue; |
1955 } | 1975 } |
1956 if (metricName != null) { | 1976 if (metricName != null) { |
1957 _json["metricName"] = metricName; | 1977 _json["metricName"] = metricName; |
1958 } | 1978 } |
1959 if (operator != null) { | 1979 if (operator != null) { |
1960 _json["operator"] = operator; | 1980 _json["operator"] = operator; |
1961 } | 1981 } |
1962 if (scope != null) { | 1982 if (scope != null) { |
1963 _json["scope"] = scope; | 1983 _json["scope"] = scope; |
1964 } | 1984 } |
1965 return _json; | 1985 return _json; |
1966 } | 1986 } |
1967 } | 1987 } |
1968 | 1988 |
1969 /** A segment sequence definition. */ | 1989 /// A segment sequence definition. |
1970 class SegmentSequenceStep { | 1990 class SegmentSequenceStep { |
1971 /** | 1991 /// Specifies if the step immediately precedes or can be any time before the |
1972 * Specifies if the step immediately precedes or can be any time before the | 1992 /// next step. |
1973 * next step. | 1993 /// Possible string values are: |
1974 * Possible string values are: | 1994 /// - "UNSPECIFIED_MATCH_TYPE" : Unspecified match type is treated as |
1975 * - "UNSPECIFIED_MATCH_TYPE" : Unspecified match type is treated as precedes. | 1995 /// precedes. |
1976 * - "PRECEDES" : Operator indicates that the previous step precedes the next | 1996 /// - "PRECEDES" : Operator indicates that the previous step precedes the |
1977 * step. | 1997 /// next step. |
1978 * - "IMMEDIATELY_PRECEDES" : Operator indicates that the previous step | 1998 /// - "IMMEDIATELY_PRECEDES" : Operator indicates that the previous step |
1979 * immediately precedes the next | 1999 /// immediately precedes the next |
1980 * step. | 2000 /// step. |
1981 */ | |
1982 core.String matchType; | 2001 core.String matchType; |
1983 /** | 2002 |
1984 * A sequence is specified with a list of Or grouped filters which are | 2003 /// A sequence is specified with a list of Or grouped filters which are |
1985 * combined with `AND` operator. | 2004 /// combined with `AND` operator. |
1986 */ | |
1987 core.List<OrFiltersForSegment> orFiltersForSegment; | 2005 core.List<OrFiltersForSegment> orFiltersForSegment; |
1988 | 2006 |
1989 SegmentSequenceStep(); | 2007 SegmentSequenceStep(); |
1990 | 2008 |
1991 SegmentSequenceStep.fromJson(core.Map _json) { | 2009 SegmentSequenceStep.fromJson(core.Map _json) { |
1992 if (_json.containsKey("matchType")) { | 2010 if (_json.containsKey("matchType")) { |
1993 matchType = _json["matchType"]; | 2011 matchType = _json["matchType"]; |
1994 } | 2012 } |
1995 if (_json.containsKey("orFiltersForSegment")) { | 2013 if (_json.containsKey("orFiltersForSegment")) { |
1996 orFiltersForSegment = _json["orFiltersForSegment"].map((value) => new OrFi
ltersForSegment.fromJson(value)).toList(); | 2014 orFiltersForSegment = _json["orFiltersForSegment"] |
| 2015 .map((value) => new OrFiltersForSegment.fromJson(value)) |
| 2016 .toList(); |
1997 } | 2017 } |
1998 } | 2018 } |
1999 | 2019 |
2000 core.Map<core.String, core.Object> toJson() { | 2020 core.Map<core.String, core.Object> toJson() { |
2001 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2021 final core.Map<core.String, core.Object> _json = |
| 2022 new core.Map<core.String, core.Object>(); |
2002 if (matchType != null) { | 2023 if (matchType != null) { |
2003 _json["matchType"] = matchType; | 2024 _json["matchType"] = matchType; |
2004 } | 2025 } |
2005 if (orFiltersForSegment != null) { | 2026 if (orFiltersForSegment != null) { |
2006 _json["orFiltersForSegment"] = orFiltersForSegment.map((value) => (value).
toJson()).toList(); | 2027 _json["orFiltersForSegment"] = |
| 2028 orFiltersForSegment.map((value) => (value).toJson()).toList(); |
2007 } | 2029 } |
2008 return _json; | 2030 return _json; |
2009 } | 2031 } |
2010 } | 2032 } |
2011 | 2033 |
2012 /** | 2034 /// Sequence conditions consist of one or more steps, where each step is |
2013 * Sequence conditions consist of one or more steps, where each step is defined | 2035 /// defined |
2014 * by one or more dimension/metric conditions. Multiple steps can be combined | 2036 /// by one or more dimension/metric conditions. Multiple steps can be combined |
2015 * with special sequence operators. | 2037 /// with special sequence operators. |
2016 */ | |
2017 class SequenceSegment { | 2038 class SequenceSegment { |
2018 /** | 2039 /// If set, first step condition must match the first hit of the visitor (in |
2019 * If set, first step condition must match the first hit of the visitor (in | 2040 /// the date range). |
2020 * the date range). | |
2021 */ | |
2022 core.bool firstStepShouldMatchFirstHit; | 2041 core.bool firstStepShouldMatchFirstHit; |
2023 /** The list of steps in the sequence. */ | 2042 |
| 2043 /// The list of steps in the sequence. |
2024 core.List<SegmentSequenceStep> segmentSequenceSteps; | 2044 core.List<SegmentSequenceStep> segmentSequenceSteps; |
2025 | 2045 |
2026 SequenceSegment(); | 2046 SequenceSegment(); |
2027 | 2047 |
2028 SequenceSegment.fromJson(core.Map _json) { | 2048 SequenceSegment.fromJson(core.Map _json) { |
2029 if (_json.containsKey("firstStepShouldMatchFirstHit")) { | 2049 if (_json.containsKey("firstStepShouldMatchFirstHit")) { |
2030 firstStepShouldMatchFirstHit = _json["firstStepShouldMatchFirstHit"]; | 2050 firstStepShouldMatchFirstHit = _json["firstStepShouldMatchFirstHit"]; |
2031 } | 2051 } |
2032 if (_json.containsKey("segmentSequenceSteps")) { | 2052 if (_json.containsKey("segmentSequenceSteps")) { |
2033 segmentSequenceSteps = _json["segmentSequenceSteps"].map((value) => new Se
gmentSequenceStep.fromJson(value)).toList(); | 2053 segmentSequenceSteps = _json["segmentSequenceSteps"] |
| 2054 .map((value) => new SegmentSequenceStep.fromJson(value)) |
| 2055 .toList(); |
2034 } | 2056 } |
2035 } | 2057 } |
2036 | 2058 |
2037 core.Map<core.String, core.Object> toJson() { | 2059 core.Map<core.String, core.Object> toJson() { |
2038 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2060 final core.Map<core.String, core.Object> _json = |
| 2061 new core.Map<core.String, core.Object>(); |
2039 if (firstStepShouldMatchFirstHit != null) { | 2062 if (firstStepShouldMatchFirstHit != null) { |
2040 _json["firstStepShouldMatchFirstHit"] = firstStepShouldMatchFirstHit; | 2063 _json["firstStepShouldMatchFirstHit"] = firstStepShouldMatchFirstHit; |
2041 } | 2064 } |
2042 if (segmentSequenceSteps != null) { | 2065 if (segmentSequenceSteps != null) { |
2043 _json["segmentSequenceSteps"] = segmentSequenceSteps.map((value) => (value
).toJson()).toList(); | 2066 _json["segmentSequenceSteps"] = |
| 2067 segmentSequenceSteps.map((value) => (value).toJson()).toList(); |
2044 } | 2068 } |
2045 return _json; | 2069 return _json; |
2046 } | 2070 } |
2047 } | 2071 } |
2048 | 2072 |
2049 /** | 2073 /// A Simple segment conditions consist of one or more dimension/metric |
2050 * A Simple segment conditions consist of one or more dimension/metric | 2074 /// conditions that can be combined. |
2051 * conditions that can be combined. | |
2052 */ | |
2053 class SimpleSegment { | 2075 class SimpleSegment { |
2054 /** | 2076 /// A list of segment filters groups which are combined with logical `AND` |
2055 * A list of segment filters groups which are combined with logical `AND` | 2077 /// operator. |
2056 * operator. | |
2057 */ | |
2058 core.List<OrFiltersForSegment> orFiltersForSegment; | 2078 core.List<OrFiltersForSegment> orFiltersForSegment; |
2059 | 2079 |
2060 SimpleSegment(); | 2080 SimpleSegment(); |
2061 | 2081 |
2062 SimpleSegment.fromJson(core.Map _json) { | 2082 SimpleSegment.fromJson(core.Map _json) { |
2063 if (_json.containsKey("orFiltersForSegment")) { | 2083 if (_json.containsKey("orFiltersForSegment")) { |
2064 orFiltersForSegment = _json["orFiltersForSegment"].map((value) => new OrFi
ltersForSegment.fromJson(value)).toList(); | 2084 orFiltersForSegment = _json["orFiltersForSegment"] |
| 2085 .map((value) => new OrFiltersForSegment.fromJson(value)) |
| 2086 .toList(); |
2065 } | 2087 } |
2066 } | 2088 } |
2067 | 2089 |
2068 core.Map<core.String, core.Object> toJson() { | 2090 core.Map<core.String, core.Object> toJson() { |
2069 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2091 final core.Map<core.String, core.Object> _json = |
| 2092 new core.Map<core.String, core.Object>(); |
2070 if (orFiltersForSegment != null) { | 2093 if (orFiltersForSegment != null) { |
2071 _json["orFiltersForSegment"] = orFiltersForSegment.map((value) => (value).
toJson()).toList(); | 2094 _json["orFiltersForSegment"] = |
| 2095 orFiltersForSegment.map((value) => (value).toJson()).toList(); |
2072 } | 2096 } |
2073 return _json; | 2097 return _json; |
2074 } | 2098 } |
2075 } | 2099 } |
OLD | NEW |