Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: generated/googleapis/lib/adsense/v1_4.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis.adsense.v1_4;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import "package:crypto/crypto.dart" as crypto;
9 import 'package:http/http.dart' as http;
10 import '../src/common_internal.dart' as common_internal;
11 import '../common/common.dart' as common;
12
13 export '../common/common.dart' show ApiRequestError;
14 export '../common/common.dart' show DetailedApiRequestError;
15
16 /**
17 * Gives AdSense publishers access to their inventory and the ability to
18 * generate reports
19 */
20 class AdsenseApi {
21 /** View and manage your AdSense data */
22 static const AdsenseScope = "https://www.googleapis.com/auth/adsense";
23
24 /** View your AdSense data */
25 static const AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.r eadonly";
26
27
28 final common_internal.ApiRequester _requester;
29
30 AccountsResourceApi get accounts => new AccountsResourceApi(_requester);
31 AdclientsResourceApi get adclients => new AdclientsResourceApi(_requester);
32 AdunitsResourceApi get adunits => new AdunitsResourceApi(_requester);
33 AlertsResourceApi get alerts => new AlertsResourceApi(_requester);
34 CustomchannelsResourceApi get customchannels => new CustomchannelsResourceApi( _requester);
35 MetadataResourceApi get metadata => new MetadataResourceApi(_requester);
36 PaymentsResourceApi get payments => new PaymentsResourceApi(_requester);
37 ReportsResourceApi get reports => new ReportsResourceApi(_requester);
38 SavedadstylesResourceApi get savedadstyles => new SavedadstylesResourceApi(_re quester);
39 UrlchannelsResourceApi get urlchannels => new UrlchannelsResourceApi(_requeste r);
40
41 AdsenseApi(http.Client client) :
42 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/adsense/v1.4/");
43 }
44
45
46 /** Not documented yet. */
47 class AccountsResourceApi {
48 final common_internal.ApiRequester _requester;
49
50 AccountsAdclientsResourceApi get adclients => new AccountsAdclientsResourceApi (_requester);
51 AccountsAdunitsResourceApi get adunits => new AccountsAdunitsResourceApi(_requ ester);
52 AccountsAlertsResourceApi get alerts => new AccountsAlertsResourceApi(_request er);
53 AccountsCustomchannelsResourceApi get customchannels => new AccountsCustomchan nelsResourceApi(_requester);
54 AccountsPaymentsResourceApi get payments => new AccountsPaymentsResourceApi(_r equester);
55 AccountsReportsResourceApi get reports => new AccountsReportsResourceApi(_requ ester);
56 AccountsSavedadstylesResourceApi get savedadstyles => new AccountsSavedadstyle sResourceApi(_requester);
57 AccountsUrlchannelsResourceApi get urlchannels => new AccountsUrlchannelsResou rceApi(_requester);
58
59 AccountsResourceApi(common_internal.ApiRequester client) :
60 _requester = client;
61
62 /**
63 * Get information about the selected AdSense account.
64 *
65 * Request parameters:
66 *
67 * [accountId] - Account to get information about.
68 *
69 * [tree] - Whether the tree of sub accounts should be returned.
70 *
71 * Completes with a [Account].
72 *
73 * Completes with a [common.ApiRequestError] if the API endpoint returned an
74 * error.
75 *
76 * If the used [http.Client] completes with an error when making a REST call,
77 * this method will complete with the same error.
78 */
79 async.Future<Account> get(core.String accountId, {core.bool tree}) {
80 var _url = null;
81 var _queryParams = new core.Map();
82 var _uploadMedia = null;
83 var _uploadOptions = null;
84 var _downloadOptions = common.DownloadOptions.Metadata;
85 var _body = null;
86
87 if (accountId == null) {
88 throw new core.ArgumentError("Parameter accountId is required.");
89 }
90 if (tree != null) {
91 _queryParams["tree"] = ["${tree}"];
92 }
93
94
95 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId');
96
97 var _response = _requester.request(_url,
98 "GET",
99 body: _body,
100 queryParams: _queryParams,
101 uploadOptions: _uploadOptions,
102 uploadMedia: _uploadMedia,
103 downloadOptions: _downloadOptions);
104 return _response.then((data) => new Account.fromJson(data));
105 }
106
107 /**
108 * List all accounts available to this AdSense account.
109 *
110 * Request parameters:
111 *
112 * [maxResults] - The maximum number of accounts to include in the response,
113 * used for paging.
114 * Value must be between "0" and "10000".
115 *
116 * [pageToken] - A continuation token, used to page through accounts. To
117 * retrieve the next page, set this parameter to the value of "nextPageToken"
118 * from the previous response.
119 *
120 * Completes with a [Accounts].
121 *
122 * Completes with a [common.ApiRequestError] if the API endpoint returned an
123 * error.
124 *
125 * If the used [http.Client] completes with an error when making a REST call,
126 * this method will complete with the same error.
127 */
128 async.Future<Accounts> list({core.int maxResults, core.String pageToken}) {
129 var _url = null;
130 var _queryParams = new core.Map();
131 var _uploadMedia = null;
132 var _uploadOptions = null;
133 var _downloadOptions = common.DownloadOptions.Metadata;
134 var _body = null;
135
136 if (maxResults != null) {
137 _queryParams["maxResults"] = ["${maxResults}"];
138 }
139 if (pageToken != null) {
140 _queryParams["pageToken"] = [pageToken];
141 }
142
143
144 _url = 'accounts';
145
146 var _response = _requester.request(_url,
147 "GET",
148 body: _body,
149 queryParams: _queryParams,
150 uploadOptions: _uploadOptions,
151 uploadMedia: _uploadMedia,
152 downloadOptions: _downloadOptions);
153 return _response.then((data) => new Accounts.fromJson(data));
154 }
155
156 }
157
158
159 /** Not documented yet. */
160 class AccountsAdclientsResourceApi {
161 final common_internal.ApiRequester _requester;
162
163 AccountsAdclientsResourceApi(common_internal.ApiRequester client) :
164 _requester = client;
165
166 /**
167 * List all ad clients in the specified account.
168 *
169 * Request parameters:
170 *
171 * [accountId] - Account for which to list ad clients.
172 *
173 * [maxResults] - The maximum number of ad clients to include in the response,
174 * used for paging.
175 * Value must be between "0" and "10000".
176 *
177 * [pageToken] - A continuation token, used to page through ad clients. To
178 * retrieve the next page, set this parameter to the value of "nextPageToken"
179 * from the previous response.
180 *
181 * Completes with a [AdClients].
182 *
183 * Completes with a [common.ApiRequestError] if the API endpoint returned an
184 * error.
185 *
186 * If the used [http.Client] completes with an error when making a REST call,
187 * this method will complete with the same error.
188 */
189 async.Future<AdClients> list(core.String accountId, {core.int maxResults, core .String pageToken}) {
190 var _url = null;
191 var _queryParams = new core.Map();
192 var _uploadMedia = null;
193 var _uploadOptions = null;
194 var _downloadOptions = common.DownloadOptions.Metadata;
195 var _body = null;
196
197 if (accountId == null) {
198 throw new core.ArgumentError("Parameter accountId is required.");
199 }
200 if (maxResults != null) {
201 _queryParams["maxResults"] = ["${maxResults}"];
202 }
203 if (pageToken != null) {
204 _queryParams["pageToken"] = [pageToken];
205 }
206
207
208 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients';
209
210 var _response = _requester.request(_url,
211 "GET",
212 body: _body,
213 queryParams: _queryParams,
214 uploadOptions: _uploadOptions,
215 uploadMedia: _uploadMedia,
216 downloadOptions: _downloadOptions);
217 return _response.then((data) => new AdClients.fromJson(data));
218 }
219
220 }
221
222
223 /** Not documented yet. */
224 class AccountsAdunitsResourceApi {
225 final common_internal.ApiRequester _requester;
226
227 AccountsAdunitsCustomchannelsResourceApi get customchannels => new AccountsAdu nitsCustomchannelsResourceApi(_requester);
228
229 AccountsAdunitsResourceApi(common_internal.ApiRequester client) :
230 _requester = client;
231
232 /**
233 * Gets the specified ad unit in the specified ad client for the specified
234 * account.
235 *
236 * Request parameters:
237 *
238 * [accountId] - Account to which the ad client belongs.
239 *
240 * [adClientId] - Ad client for which to get the ad unit.
241 *
242 * [adUnitId] - Ad unit to retrieve.
243 *
244 * Completes with a [AdUnit].
245 *
246 * Completes with a [common.ApiRequestError] if the API endpoint returned an
247 * error.
248 *
249 * If the used [http.Client] completes with an error when making a REST call,
250 * this method will complete with the same error.
251 */
252 async.Future<AdUnit> get(core.String accountId, core.String adClientId, core.S tring adUnitId) {
253 var _url = null;
254 var _queryParams = new core.Map();
255 var _uploadMedia = null;
256 var _uploadOptions = null;
257 var _downloadOptions = common.DownloadOptions.Metadata;
258 var _body = null;
259
260 if (accountId == null) {
261 throw new core.ArgumentError("Parameter accountId is required.");
262 }
263 if (adClientId == null) {
264 throw new core.ArgumentError("Parameter adClientId is required.");
265 }
266 if (adUnitId == null) {
267 throw new core.ArgumentError("Parameter adUnitId is required.");
268 }
269
270
271 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/ ' + common_internal.Escaper.ecapeVariable('$adUnitId');
272
273 var _response = _requester.request(_url,
274 "GET",
275 body: _body,
276 queryParams: _queryParams,
277 uploadOptions: _uploadOptions,
278 uploadMedia: _uploadMedia,
279 downloadOptions: _downloadOptions);
280 return _response.then((data) => new AdUnit.fromJson(data));
281 }
282
283 /**
284 * Get ad code for the specified ad unit.
285 *
286 * Request parameters:
287 *
288 * [accountId] - Account which contains the ad client.
289 *
290 * [adClientId] - Ad client with contains the ad unit.
291 *
292 * [adUnitId] - Ad unit to get the code for.
293 *
294 * Completes with a [AdCode].
295 *
296 * Completes with a [common.ApiRequestError] if the API endpoint returned an
297 * error.
298 *
299 * If the used [http.Client] completes with an error when making a REST call,
300 * this method will complete with the same error.
301 */
302 async.Future<AdCode> getAdCode(core.String accountId, core.String adClientId, core.String adUnitId) {
303 var _url = null;
304 var _queryParams = new core.Map();
305 var _uploadMedia = null;
306 var _uploadOptions = null;
307 var _downloadOptions = common.DownloadOptions.Metadata;
308 var _body = null;
309
310 if (accountId == null) {
311 throw new core.ArgumentError("Parameter accountId is required.");
312 }
313 if (adClientId == null) {
314 throw new core.ArgumentError("Parameter adClientId is required.");
315 }
316 if (adUnitId == null) {
317 throw new core.ArgumentError("Parameter adUnitId is required.");
318 }
319
320
321 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/ ' + common_internal.Escaper.ecapeVariable('$adUnitId') + '/adcode';
322
323 var _response = _requester.request(_url,
324 "GET",
325 body: _body,
326 queryParams: _queryParams,
327 uploadOptions: _uploadOptions,
328 uploadMedia: _uploadMedia,
329 downloadOptions: _downloadOptions);
330 return _response.then((data) => new AdCode.fromJson(data));
331 }
332
333 /**
334 * List all ad units in the specified ad client for the specified account.
335 *
336 * Request parameters:
337 *
338 * [accountId] - Account to which the ad client belongs.
339 *
340 * [adClientId] - Ad client for which to list ad units.
341 *
342 * [includeInactive] - Whether to include inactive ad units. Default: true.
343 *
344 * [maxResults] - The maximum number of ad units to include in the response,
345 * used for paging.
346 * Value must be between "0" and "10000".
347 *
348 * [pageToken] - A continuation token, used to page through ad units. To
349 * retrieve the next page, set this parameter to the value of "nextPageToken"
350 * from the previous response.
351 *
352 * Completes with a [AdUnits].
353 *
354 * Completes with a [common.ApiRequestError] if the API endpoint returned an
355 * error.
356 *
357 * If the used [http.Client] completes with an error when making a REST call,
358 * this method will complete with the same error.
359 */
360 async.Future<AdUnits> list(core.String accountId, core.String adClientId, {cor e.bool includeInactive, core.int maxResults, core.String pageToken}) {
361 var _url = null;
362 var _queryParams = new core.Map();
363 var _uploadMedia = null;
364 var _uploadOptions = null;
365 var _downloadOptions = common.DownloadOptions.Metadata;
366 var _body = null;
367
368 if (accountId == null) {
369 throw new core.ArgumentError("Parameter accountId is required.");
370 }
371 if (adClientId == null) {
372 throw new core.ArgumentError("Parameter adClientId is required.");
373 }
374 if (includeInactive != null) {
375 _queryParams["includeInactive"] = ["${includeInactive}"];
376 }
377 if (maxResults != null) {
378 _queryParams["maxResults"] = ["${maxResults}"];
379 }
380 if (pageToken != null) {
381 _queryParams["pageToken"] = [pageToken];
382 }
383
384
385 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits' ;
386
387 var _response = _requester.request(_url,
388 "GET",
389 body: _body,
390 queryParams: _queryParams,
391 uploadOptions: _uploadOptions,
392 uploadMedia: _uploadMedia,
393 downloadOptions: _downloadOptions);
394 return _response.then((data) => new AdUnits.fromJson(data));
395 }
396
397 }
398
399
400 /** Not documented yet. */
401 class AccountsAdunitsCustomchannelsResourceApi {
402 final common_internal.ApiRequester _requester;
403
404 AccountsAdunitsCustomchannelsResourceApi(common_internal.ApiRequester client) :
405 _requester = client;
406
407 /**
408 * List all custom channels which the specified ad unit belongs to.
409 *
410 * Request parameters:
411 *
412 * [accountId] - Account to which the ad client belongs.
413 *
414 * [adClientId] - Ad client which contains the ad unit.
415 *
416 * [adUnitId] - Ad unit for which to list custom channels.
417 *
418 * [maxResults] - The maximum number of custom channels to include in the
419 * response, used for paging.
420 * Value must be between "0" and "10000".
421 *
422 * [pageToken] - A continuation token, used to page through custom channels.
423 * To retrieve the next page, set this parameter to the value of
424 * "nextPageToken" from the previous response.
425 *
426 * Completes with a [CustomChannels].
427 *
428 * Completes with a [common.ApiRequestError] if the API endpoint returned an
429 * error.
430 *
431 * If the used [http.Client] completes with an error when making a REST call,
432 * this method will complete with the same error.
433 */
434 async.Future<CustomChannels> list(core.String accountId, core.String adClientI d, core.String adUnitId, {core.int maxResults, core.String pageToken}) {
435 var _url = null;
436 var _queryParams = new core.Map();
437 var _uploadMedia = null;
438 var _uploadOptions = null;
439 var _downloadOptions = common.DownloadOptions.Metadata;
440 var _body = null;
441
442 if (accountId == null) {
443 throw new core.ArgumentError("Parameter accountId is required.");
444 }
445 if (adClientId == null) {
446 throw new core.ArgumentError("Parameter adClientId is required.");
447 }
448 if (adUnitId == null) {
449 throw new core.ArgumentError("Parameter adUnitId is required.");
450 }
451 if (maxResults != null) {
452 _queryParams["maxResults"] = ["${maxResults}"];
453 }
454 if (pageToken != null) {
455 _queryParams["pageToken"] = [pageToken];
456 }
457
458
459 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/ ' + common_internal.Escaper.ecapeVariable('$adUnitId') + '/customchannels';
460
461 var _response = _requester.request(_url,
462 "GET",
463 body: _body,
464 queryParams: _queryParams,
465 uploadOptions: _uploadOptions,
466 uploadMedia: _uploadMedia,
467 downloadOptions: _downloadOptions);
468 return _response.then((data) => new CustomChannels.fromJson(data));
469 }
470
471 }
472
473
474 /** Not documented yet. */
475 class AccountsAlertsResourceApi {
476 final common_internal.ApiRequester _requester;
477
478 AccountsAlertsResourceApi(common_internal.ApiRequester client) :
479 _requester = client;
480
481 /**
482 * Dismiss (delete) the specified alert from the specified publisher AdSense
483 * account.
484 *
485 * Request parameters:
486 *
487 * [accountId] - Account which contains the ad unit.
488 *
489 * [alertId] - Alert to delete.
490 *
491 * Completes with a [common.ApiRequestError] if the API endpoint returned an
492 * error.
493 *
494 * If the used [http.Client] completes with an error when making a REST call,
495 * this method will complete with the same error.
496 */
497 async.Future delete(core.String accountId, core.String alertId) {
498 var _url = null;
499 var _queryParams = new core.Map();
500 var _uploadMedia = null;
501 var _uploadOptions = null;
502 var _downloadOptions = common.DownloadOptions.Metadata;
503 var _body = null;
504
505 if (accountId == null) {
506 throw new core.ArgumentError("Parameter accountId is required.");
507 }
508 if (alertId == null) {
509 throw new core.ArgumentError("Parameter alertId is required.");
510 }
511
512 _downloadOptions = null;
513
514 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /alerts/' + common_internal.Escaper.ecapeVariable('$alertId');
515
516 var _response = _requester.request(_url,
517 "DELETE",
518 body: _body,
519 queryParams: _queryParams,
520 uploadOptions: _uploadOptions,
521 uploadMedia: _uploadMedia,
522 downloadOptions: _downloadOptions);
523 return _response.then((data) => null);
524 }
525
526 /**
527 * List the alerts for the specified AdSense account.
528 *
529 * Request parameters:
530 *
531 * [accountId] - Account for which to retrieve the alerts.
532 *
533 * [locale] - The locale to use for translating alert messages. The account
534 * locale will be used if this is not supplied. The AdSense default (English)
535 * will be used if the supplied locale is invalid or unsupported.
536 *
537 * Completes with a [Alerts].
538 *
539 * Completes with a [common.ApiRequestError] if the API endpoint returned an
540 * error.
541 *
542 * If the used [http.Client] completes with an error when making a REST call,
543 * this method will complete with the same error.
544 */
545 async.Future<Alerts> list(core.String accountId, {core.String locale}) {
546 var _url = null;
547 var _queryParams = new core.Map();
548 var _uploadMedia = null;
549 var _uploadOptions = null;
550 var _downloadOptions = common.DownloadOptions.Metadata;
551 var _body = null;
552
553 if (accountId == null) {
554 throw new core.ArgumentError("Parameter accountId is required.");
555 }
556 if (locale != null) {
557 _queryParams["locale"] = [locale];
558 }
559
560
561 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /alerts';
562
563 var _response = _requester.request(_url,
564 "GET",
565 body: _body,
566 queryParams: _queryParams,
567 uploadOptions: _uploadOptions,
568 uploadMedia: _uploadMedia,
569 downloadOptions: _downloadOptions);
570 return _response.then((data) => new Alerts.fromJson(data));
571 }
572
573 }
574
575
576 /** Not documented yet. */
577 class AccountsCustomchannelsResourceApi {
578 final common_internal.ApiRequester _requester;
579
580 AccountsCustomchannelsAdunitsResourceApi get adunits => new AccountsCustomchan nelsAdunitsResourceApi(_requester);
581
582 AccountsCustomchannelsResourceApi(common_internal.ApiRequester client) :
583 _requester = client;
584
585 /**
586 * Get the specified custom channel from the specified ad client for the
587 * specified account.
588 *
589 * Request parameters:
590 *
591 * [accountId] - Account to which the ad client belongs.
592 *
593 * [adClientId] - Ad client which contains the custom channel.
594 *
595 * [customChannelId] - Custom channel to retrieve.
596 *
597 * Completes with a [CustomChannel].
598 *
599 * Completes with a [common.ApiRequestError] if the API endpoint returned an
600 * error.
601 *
602 * If the used [http.Client] completes with an error when making a REST call,
603 * this method will complete with the same error.
604 */
605 async.Future<CustomChannel> get(core.String accountId, core.String adClientId, core.String customChannelId) {
606 var _url = null;
607 var _queryParams = new core.Map();
608 var _uploadMedia = null;
609 var _uploadOptions = null;
610 var _downloadOptions = common.DownloadOptions.Metadata;
611 var _body = null;
612
613 if (accountId == null) {
614 throw new core.ArgumentError("Parameter accountId is required.");
615 }
616 if (adClientId == null) {
617 throw new core.ArgumentError("Parameter adClientId is required.");
618 }
619 if (customChannelId == null) {
620 throw new core.ArgumentError("Parameter customChannelId is required.");
621 }
622
623
624 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customch annels/' + common_internal.Escaper.ecapeVariable('$customChannelId');
625
626 var _response = _requester.request(_url,
627 "GET",
628 body: _body,
629 queryParams: _queryParams,
630 uploadOptions: _uploadOptions,
631 uploadMedia: _uploadMedia,
632 downloadOptions: _downloadOptions);
633 return _response.then((data) => new CustomChannel.fromJson(data));
634 }
635
636 /**
637 * List all custom channels in the specified ad client for the specified
638 * account.
639 *
640 * Request parameters:
641 *
642 * [accountId] - Account to which the ad client belongs.
643 *
644 * [adClientId] - Ad client for which to list custom channels.
645 *
646 * [maxResults] - The maximum number of custom channels to include in the
647 * response, used for paging.
648 * Value must be between "0" and "10000".
649 *
650 * [pageToken] - A continuation token, used to page through custom channels.
651 * To retrieve the next page, set this parameter to the value of
652 * "nextPageToken" from the previous response.
653 *
654 * Completes with a [CustomChannels].
655 *
656 * Completes with a [common.ApiRequestError] if the API endpoint returned an
657 * error.
658 *
659 * If the used [http.Client] completes with an error when making a REST call,
660 * this method will complete with the same error.
661 */
662 async.Future<CustomChannels> list(core.String accountId, core.String adClientI d, {core.int maxResults, core.String pageToken}) {
663 var _url = null;
664 var _queryParams = new core.Map();
665 var _uploadMedia = null;
666 var _uploadOptions = null;
667 var _downloadOptions = common.DownloadOptions.Metadata;
668 var _body = null;
669
670 if (accountId == null) {
671 throw new core.ArgumentError("Parameter accountId is required.");
672 }
673 if (adClientId == null) {
674 throw new core.ArgumentError("Parameter adClientId is required.");
675 }
676 if (maxResults != null) {
677 _queryParams["maxResults"] = ["${maxResults}"];
678 }
679 if (pageToken != null) {
680 _queryParams["pageToken"] = [pageToken];
681 }
682
683
684 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customch annels';
685
686 var _response = _requester.request(_url,
687 "GET",
688 body: _body,
689 queryParams: _queryParams,
690 uploadOptions: _uploadOptions,
691 uploadMedia: _uploadMedia,
692 downloadOptions: _downloadOptions);
693 return _response.then((data) => new CustomChannels.fromJson(data));
694 }
695
696 }
697
698
699 /** Not documented yet. */
700 class AccountsCustomchannelsAdunitsResourceApi {
701 final common_internal.ApiRequester _requester;
702
703 AccountsCustomchannelsAdunitsResourceApi(common_internal.ApiRequester client) :
704 _requester = client;
705
706 /**
707 * List all ad units in the specified custom channel.
708 *
709 * Request parameters:
710 *
711 * [accountId] - Account to which the ad client belongs.
712 *
713 * [adClientId] - Ad client which contains the custom channel.
714 *
715 * [customChannelId] - Custom channel for which to list ad units.
716 *
717 * [includeInactive] - Whether to include inactive ad units. Default: true.
718 *
719 * [maxResults] - The maximum number of ad units to include in the response,
720 * used for paging.
721 * Value must be between "0" and "10000".
722 *
723 * [pageToken] - A continuation token, used to page through ad units. To
724 * retrieve the next page, set this parameter to the value of "nextPageToken"
725 * from the previous response.
726 *
727 * Completes with a [AdUnits].
728 *
729 * Completes with a [common.ApiRequestError] if the API endpoint returned an
730 * error.
731 *
732 * If the used [http.Client] completes with an error when making a REST call,
733 * this method will complete with the same error.
734 */
735 async.Future<AdUnits> list(core.String accountId, core.String adClientId, core .String customChannelId, {core.bool includeInactive, core.int maxResults, core.S tring pageToken}) {
736 var _url = null;
737 var _queryParams = new core.Map();
738 var _uploadMedia = null;
739 var _uploadOptions = null;
740 var _downloadOptions = common.DownloadOptions.Metadata;
741 var _body = null;
742
743 if (accountId == null) {
744 throw new core.ArgumentError("Parameter accountId is required.");
745 }
746 if (adClientId == null) {
747 throw new core.ArgumentError("Parameter adClientId is required.");
748 }
749 if (customChannelId == null) {
750 throw new core.ArgumentError("Parameter customChannelId is required.");
751 }
752 if (includeInactive != null) {
753 _queryParams["includeInactive"] = ["${includeInactive}"];
754 }
755 if (maxResults != null) {
756 _queryParams["maxResults"] = ["${maxResults}"];
757 }
758 if (pageToken != null) {
759 _queryParams["pageToken"] = [pageToken];
760 }
761
762
763 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customch annels/' + common_internal.Escaper.ecapeVariable('$customChannelId') + '/adunits ';
764
765 var _response = _requester.request(_url,
766 "GET",
767 body: _body,
768 queryParams: _queryParams,
769 uploadOptions: _uploadOptions,
770 uploadMedia: _uploadMedia,
771 downloadOptions: _downloadOptions);
772 return _response.then((data) => new AdUnits.fromJson(data));
773 }
774
775 }
776
777
778 /** Not documented yet. */
779 class AccountsPaymentsResourceApi {
780 final common_internal.ApiRequester _requester;
781
782 AccountsPaymentsResourceApi(common_internal.ApiRequester client) :
783 _requester = client;
784
785 /**
786 * List the payments for the specified AdSense account.
787 *
788 * Request parameters:
789 *
790 * [accountId] - Account for which to retrieve the payments.
791 *
792 * Completes with a [Payments].
793 *
794 * Completes with a [common.ApiRequestError] if the API endpoint returned an
795 * error.
796 *
797 * If the used [http.Client] completes with an error when making a REST call,
798 * this method will complete with the same error.
799 */
800 async.Future<Payments> list(core.String accountId) {
801 var _url = null;
802 var _queryParams = new core.Map();
803 var _uploadMedia = null;
804 var _uploadOptions = null;
805 var _downloadOptions = common.DownloadOptions.Metadata;
806 var _body = null;
807
808 if (accountId == null) {
809 throw new core.ArgumentError("Parameter accountId is required.");
810 }
811
812
813 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /payments';
814
815 var _response = _requester.request(_url,
816 "GET",
817 body: _body,
818 queryParams: _queryParams,
819 uploadOptions: _uploadOptions,
820 uploadMedia: _uploadMedia,
821 downloadOptions: _downloadOptions);
822 return _response.then((data) => new Payments.fromJson(data));
823 }
824
825 }
826
827
828 /** Not documented yet. */
829 class AccountsReportsResourceApi {
830 final common_internal.ApiRequester _requester;
831
832 AccountsReportsSavedResourceApi get saved => new AccountsReportsSavedResourceA pi(_requester);
833
834 AccountsReportsResourceApi(common_internal.ApiRequester client) :
835 _requester = client;
836
837 /**
838 * Generate an AdSense report based on the report request sent in the query
839 * parameters. Returns the result as JSON; to retrieve output in CSV format
840 * specify "alt=csv" as a query parameter.
841 *
842 * Request parameters:
843 *
844 * [accountId] - Account upon which to report.
845 *
846 * [startDate] - Start of the date range to report on in "YYYY-MM-DD" format,
847 * inclusive.
848 * Value must have pattern
849 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )|(latest-(\d{2})-(\d{2})(-\d+y)?)|(latest-latest-(\d{2})(-\d+m)?)".
850 *
851 * [endDate] - End of the date range to report on in "YYYY-MM-DD" format,
852 * inclusive.
853 * Value must have pattern
854 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )|(latest-(\d{2})-(\d{2})(-\d+y)?)|(latest-latest-(\d{2})(-\d+m)?)".
855 *
856 * [currency] - Optional currency to use when reporting on monetary metrics.
857 * Defaults to the account's currency if not set.
858 * Value must have pattern "[a-zA-Z]+".
859 *
860 * [dimension] - Dimensions to base the report on.
861 * Value must have pattern "[a-zA-Z_]+".
862 *
863 * [filter] - Filters to be run on the report.
864 * Value must have pattern "[a-zA-Z_]+(==|=@).+".
865 *
866 * [locale] - Optional locale to use for translating report output to a local
867 * language. Defaults to "en_US" if not specified.
868 * Value must have pattern "[a-zA-Z_]+".
869 *
870 * [maxResults] - The maximum number of rows of report data to return.
871 * Value must be between "0" and "50000".
872 *
873 * [metric] - Numeric columns to include in the report.
874 * Value must have pattern "[a-zA-Z_]+".
875 *
876 * [sort] - The name of a dimension or metric to sort the resulting report on,
877 * optionally prefixed with "+" to sort ascending or "-" to sort descending.
878 * If no prefix is specified, the column is sorted ascending.
879 * Value must have pattern "(\+|-)?[a-zA-Z_]+".
880 *
881 * [startIndex] - Index of the first row of report data to return.
882 * Value must be between "0" and "5000".
883 *
884 * [useTimezoneReporting] - Whether the report should be generated in the
885 * AdSense account's local timezone. If false default PST/PDT timezone will be
886 * used.
887 *
888 * [downloadOptions] - Options for downloading. A download can be either a
889 * Metadata (default) or Media download. Partial Media downloads are possible
890 * as well.
891 *
892 * Completes with a
893 *
894 * - [AdsenseReportsGenerateResponse] for Metadata downloads (see
895 * [downloadOptions]).
896 *
897 * - [common.Media] for Media downloads (see [downloadOptions]).
898 *
899 * Completes with a [common.ApiRequestError] if the API endpoint returned an
900 * error.
901 *
902 * If the used [http.Client] completes with an error when making a REST call,
903 * this method will complete with the same error.
904 */
905 async.Future generate(core.String accountId, core.String startDate, core.Strin g endDate, {core.String currency, core.List<core.String> dimension, core.List<co re.String> filter, core.String locale, core.int maxResults, core.List<core.Strin g> metric, core.List<core.String> sort, core.int startIndex, core.bool useTimezo neReporting, common.DownloadOptions downloadOptions: common.DownloadOptions.Meta data}) {
906 var _url = null;
907 var _queryParams = new core.Map();
908 var _uploadMedia = null;
909 var _uploadOptions = null;
910 var _downloadOptions = common.DownloadOptions.Metadata;
911 var _body = null;
912
913 if (accountId == null) {
914 throw new core.ArgumentError("Parameter accountId is required.");
915 }
916 if (startDate == null) {
917 throw new core.ArgumentError("Parameter startDate is required.");
918 }
919 _queryParams["startDate"] = [startDate];
920 if (endDate == null) {
921 throw new core.ArgumentError("Parameter endDate is required.");
922 }
923 _queryParams["endDate"] = [endDate];
924 if (currency != null) {
925 _queryParams["currency"] = [currency];
926 }
927 if (dimension != null) {
928 _queryParams["dimension"] = dimension;
929 }
930 if (filter != null) {
931 _queryParams["filter"] = filter;
932 }
933 if (locale != null) {
934 _queryParams["locale"] = [locale];
935 }
936 if (maxResults != null) {
937 _queryParams["maxResults"] = ["${maxResults}"];
938 }
939 if (metric != null) {
940 _queryParams["metric"] = metric;
941 }
942 if (sort != null) {
943 _queryParams["sort"] = sort;
944 }
945 if (startIndex != null) {
946 _queryParams["startIndex"] = ["${startIndex}"];
947 }
948 if (useTimezoneReporting != null) {
949 _queryParams["useTimezoneReporting"] = ["${useTimezoneReporting}"];
950 }
951
952 _downloadOptions = downloadOptions;
953
954 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /reports';
955
956 var _response = _requester.request(_url,
957 "GET",
958 body: _body,
959 queryParams: _queryParams,
960 uploadOptions: _uploadOptions,
961 uploadMedia: _uploadMedia,
962 downloadOptions: _downloadOptions);
963 if (_downloadOptions == null ||
964 _downloadOptions == common.DownloadOptions.Metadata) {
965 return _response.then((data) => new AdsenseReportsGenerateResponse.fromJso n(data));
966 } else {
967 return _response;
968 }
969 }
970
971 }
972
973
974 /** Not documented yet. */
975 class AccountsReportsSavedResourceApi {
976 final common_internal.ApiRequester _requester;
977
978 AccountsReportsSavedResourceApi(common_internal.ApiRequester client) :
979 _requester = client;
980
981 /**
982 * Generate an AdSense report based on the saved report ID sent in the query
983 * parameters.
984 *
985 * Request parameters:
986 *
987 * [accountId] - Account to which the saved reports belong.
988 *
989 * [savedReportId] - The saved report to retrieve.
990 *
991 * [locale] - Optional locale to use for translating report output to a local
992 * language. Defaults to "en_US" if not specified.
993 * Value must have pattern "[a-zA-Z_]+".
994 *
995 * [maxResults] - The maximum number of rows of report data to return.
996 * Value must be between "0" and "50000".
997 *
998 * [startIndex] - Index of the first row of report data to return.
999 * Value must be between "0" and "5000".
1000 *
1001 * Completes with a [AdsenseReportsGenerateResponse].
1002 *
1003 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1004 * error.
1005 *
1006 * If the used [http.Client] completes with an error when making a REST call,
1007 * this method will complete with the same error.
1008 */
1009 async.Future<AdsenseReportsGenerateResponse> generate(core.String accountId, c ore.String savedReportId, {core.String locale, core.int maxResults, core.int sta rtIndex}) {
1010 var _url = null;
1011 var _queryParams = new core.Map();
1012 var _uploadMedia = null;
1013 var _uploadOptions = null;
1014 var _downloadOptions = common.DownloadOptions.Metadata;
1015 var _body = null;
1016
1017 if (accountId == null) {
1018 throw new core.ArgumentError("Parameter accountId is required.");
1019 }
1020 if (savedReportId == null) {
1021 throw new core.ArgumentError("Parameter savedReportId is required.");
1022 }
1023 if (locale != null) {
1024 _queryParams["locale"] = [locale];
1025 }
1026 if (maxResults != null) {
1027 _queryParams["maxResults"] = ["${maxResults}"];
1028 }
1029 if (startIndex != null) {
1030 _queryParams["startIndex"] = ["${startIndex}"];
1031 }
1032
1033
1034 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /reports/' + common_internal.Escaper.ecapeVariable('$savedReportId');
1035
1036 var _response = _requester.request(_url,
1037 "GET",
1038 body: _body,
1039 queryParams: _queryParams,
1040 uploadOptions: _uploadOptions,
1041 uploadMedia: _uploadMedia,
1042 downloadOptions: _downloadOptions);
1043 return _response.then((data) => new AdsenseReportsGenerateResponse.fromJson( data));
1044 }
1045
1046 /**
1047 * List all saved reports in the specified AdSense account.
1048 *
1049 * Request parameters:
1050 *
1051 * [accountId] - Account to which the saved reports belong.
1052 *
1053 * [maxResults] - The maximum number of saved reports to include in the
1054 * response, used for paging.
1055 * Value must be between "0" and "100".
1056 *
1057 * [pageToken] - A continuation token, used to page through saved reports. To
1058 * retrieve the next page, set this parameter to the value of "nextPageToken"
1059 * from the previous response.
1060 *
1061 * Completes with a [SavedReports].
1062 *
1063 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1064 * error.
1065 *
1066 * If the used [http.Client] completes with an error when making a REST call,
1067 * this method will complete with the same error.
1068 */
1069 async.Future<SavedReports> list(core.String accountId, {core.int maxResults, c ore.String pageToken}) {
1070 var _url = null;
1071 var _queryParams = new core.Map();
1072 var _uploadMedia = null;
1073 var _uploadOptions = null;
1074 var _downloadOptions = common.DownloadOptions.Metadata;
1075 var _body = null;
1076
1077 if (accountId == null) {
1078 throw new core.ArgumentError("Parameter accountId is required.");
1079 }
1080 if (maxResults != null) {
1081 _queryParams["maxResults"] = ["${maxResults}"];
1082 }
1083 if (pageToken != null) {
1084 _queryParams["pageToken"] = [pageToken];
1085 }
1086
1087
1088 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /reports/saved';
1089
1090 var _response = _requester.request(_url,
1091 "GET",
1092 body: _body,
1093 queryParams: _queryParams,
1094 uploadOptions: _uploadOptions,
1095 uploadMedia: _uploadMedia,
1096 downloadOptions: _downloadOptions);
1097 return _response.then((data) => new SavedReports.fromJson(data));
1098 }
1099
1100 }
1101
1102
1103 /** Not documented yet. */
1104 class AccountsSavedadstylesResourceApi {
1105 final common_internal.ApiRequester _requester;
1106
1107 AccountsSavedadstylesResourceApi(common_internal.ApiRequester client) :
1108 _requester = client;
1109
1110 /**
1111 * List a specific saved ad style for the specified account.
1112 *
1113 * Request parameters:
1114 *
1115 * [accountId] - Account for which to get the saved ad style.
1116 *
1117 * [savedAdStyleId] - Saved ad style to retrieve.
1118 *
1119 * Completes with a [SavedAdStyle].
1120 *
1121 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1122 * error.
1123 *
1124 * If the used [http.Client] completes with an error when making a REST call,
1125 * this method will complete with the same error.
1126 */
1127 async.Future<SavedAdStyle> get(core.String accountId, core.String savedAdStyle Id) {
1128 var _url = null;
1129 var _queryParams = new core.Map();
1130 var _uploadMedia = null;
1131 var _uploadOptions = null;
1132 var _downloadOptions = common.DownloadOptions.Metadata;
1133 var _body = null;
1134
1135 if (accountId == null) {
1136 throw new core.ArgumentError("Parameter accountId is required.");
1137 }
1138 if (savedAdStyleId == null) {
1139 throw new core.ArgumentError("Parameter savedAdStyleId is required.");
1140 }
1141
1142
1143 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /savedadstyles/' + common_internal.Escaper.ecapeVariable('$savedAdStyleId');
1144
1145 var _response = _requester.request(_url,
1146 "GET",
1147 body: _body,
1148 queryParams: _queryParams,
1149 uploadOptions: _uploadOptions,
1150 uploadMedia: _uploadMedia,
1151 downloadOptions: _downloadOptions);
1152 return _response.then((data) => new SavedAdStyle.fromJson(data));
1153 }
1154
1155 /**
1156 * List all saved ad styles in the specified account.
1157 *
1158 * Request parameters:
1159 *
1160 * [accountId] - Account for which to list saved ad styles.
1161 *
1162 * [maxResults] - The maximum number of saved ad styles to include in the
1163 * response, used for paging.
1164 * Value must be between "0" and "10000".
1165 *
1166 * [pageToken] - A continuation token, used to page through saved ad styles.
1167 * To retrieve the next page, set this parameter to the value of
1168 * "nextPageToken" from the previous response.
1169 *
1170 * Completes with a [SavedAdStyles].
1171 *
1172 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1173 * error.
1174 *
1175 * If the used [http.Client] completes with an error when making a REST call,
1176 * this method will complete with the same error.
1177 */
1178 async.Future<SavedAdStyles> list(core.String accountId, {core.int maxResults, core.String pageToken}) {
1179 var _url = null;
1180 var _queryParams = new core.Map();
1181 var _uploadMedia = null;
1182 var _uploadOptions = null;
1183 var _downloadOptions = common.DownloadOptions.Metadata;
1184 var _body = null;
1185
1186 if (accountId == null) {
1187 throw new core.ArgumentError("Parameter accountId is required.");
1188 }
1189 if (maxResults != null) {
1190 _queryParams["maxResults"] = ["${maxResults}"];
1191 }
1192 if (pageToken != null) {
1193 _queryParams["pageToken"] = [pageToken];
1194 }
1195
1196
1197 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /savedadstyles';
1198
1199 var _response = _requester.request(_url,
1200 "GET",
1201 body: _body,
1202 queryParams: _queryParams,
1203 uploadOptions: _uploadOptions,
1204 uploadMedia: _uploadMedia,
1205 downloadOptions: _downloadOptions);
1206 return _response.then((data) => new SavedAdStyles.fromJson(data));
1207 }
1208
1209 }
1210
1211
1212 /** Not documented yet. */
1213 class AccountsUrlchannelsResourceApi {
1214 final common_internal.ApiRequester _requester;
1215
1216 AccountsUrlchannelsResourceApi(common_internal.ApiRequester client) :
1217 _requester = client;
1218
1219 /**
1220 * List all URL channels in the specified ad client for the specified account.
1221 *
1222 * Request parameters:
1223 *
1224 * [accountId] - Account to which the ad client belongs.
1225 *
1226 * [adClientId] - Ad client for which to list URL channels.
1227 *
1228 * [maxResults] - The maximum number of URL channels to include in the
1229 * response, used for paging.
1230 * Value must be between "0" and "10000".
1231 *
1232 * [pageToken] - A continuation token, used to page through URL channels. To
1233 * retrieve the next page, set this parameter to the value of "nextPageToken"
1234 * from the previous response.
1235 *
1236 * Completes with a [UrlChannels].
1237 *
1238 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1239 * error.
1240 *
1241 * If the used [http.Client] completes with an error when making a REST call,
1242 * this method will complete with the same error.
1243 */
1244 async.Future<UrlChannels> list(core.String accountId, core.String adClientId, {core.int maxResults, core.String pageToken}) {
1245 var _url = null;
1246 var _queryParams = new core.Map();
1247 var _uploadMedia = null;
1248 var _uploadOptions = null;
1249 var _downloadOptions = common.DownloadOptions.Metadata;
1250 var _body = null;
1251
1252 if (accountId == null) {
1253 throw new core.ArgumentError("Parameter accountId is required.");
1254 }
1255 if (adClientId == null) {
1256 throw new core.ArgumentError("Parameter adClientId is required.");
1257 }
1258 if (maxResults != null) {
1259 _queryParams["maxResults"] = ["${maxResults}"];
1260 }
1261 if (pageToken != null) {
1262 _queryParams["pageToken"] = [pageToken];
1263 }
1264
1265
1266 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/urlchann els';
1267
1268 var _response = _requester.request(_url,
1269 "GET",
1270 body: _body,
1271 queryParams: _queryParams,
1272 uploadOptions: _uploadOptions,
1273 uploadMedia: _uploadMedia,
1274 downloadOptions: _downloadOptions);
1275 return _response.then((data) => new UrlChannels.fromJson(data));
1276 }
1277
1278 }
1279
1280
1281 /** Not documented yet. */
1282 class AdclientsResourceApi {
1283 final common_internal.ApiRequester _requester;
1284
1285 AdclientsResourceApi(common_internal.ApiRequester client) :
1286 _requester = client;
1287
1288 /**
1289 * List all ad clients in this AdSense account.
1290 *
1291 * Request parameters:
1292 *
1293 * [maxResults] - The maximum number of ad clients to include in the response,
1294 * used for paging.
1295 * Value must be between "0" and "10000".
1296 *
1297 * [pageToken] - A continuation token, used to page through ad clients. To
1298 * retrieve the next page, set this parameter to the value of "nextPageToken"
1299 * from the previous response.
1300 *
1301 * Completes with a [AdClients].
1302 *
1303 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1304 * error.
1305 *
1306 * If the used [http.Client] completes with an error when making a REST call,
1307 * this method will complete with the same error.
1308 */
1309 async.Future<AdClients> list({core.int maxResults, core.String pageToken}) {
1310 var _url = null;
1311 var _queryParams = new core.Map();
1312 var _uploadMedia = null;
1313 var _uploadOptions = null;
1314 var _downloadOptions = common.DownloadOptions.Metadata;
1315 var _body = null;
1316
1317 if (maxResults != null) {
1318 _queryParams["maxResults"] = ["${maxResults}"];
1319 }
1320 if (pageToken != null) {
1321 _queryParams["pageToken"] = [pageToken];
1322 }
1323
1324
1325 _url = 'adclients';
1326
1327 var _response = _requester.request(_url,
1328 "GET",
1329 body: _body,
1330 queryParams: _queryParams,
1331 uploadOptions: _uploadOptions,
1332 uploadMedia: _uploadMedia,
1333 downloadOptions: _downloadOptions);
1334 return _response.then((data) => new AdClients.fromJson(data));
1335 }
1336
1337 }
1338
1339
1340 /** Not documented yet. */
1341 class AdunitsResourceApi {
1342 final common_internal.ApiRequester _requester;
1343
1344 AdunitsCustomchannelsResourceApi get customchannels => new AdunitsCustomchanne lsResourceApi(_requester);
1345
1346 AdunitsResourceApi(common_internal.ApiRequester client) :
1347 _requester = client;
1348
1349 /**
1350 * Gets the specified ad unit in the specified ad client.
1351 *
1352 * Request parameters:
1353 *
1354 * [adClientId] - Ad client for which to get the ad unit.
1355 *
1356 * [adUnitId] - Ad unit to retrieve.
1357 *
1358 * Completes with a [AdUnit].
1359 *
1360 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1361 * error.
1362 *
1363 * If the used [http.Client] completes with an error when making a REST call,
1364 * this method will complete with the same error.
1365 */
1366 async.Future<AdUnit> get(core.String adClientId, core.String adUnitId) {
1367 var _url = null;
1368 var _queryParams = new core.Map();
1369 var _uploadMedia = null;
1370 var _uploadOptions = null;
1371 var _downloadOptions = common.DownloadOptions.Metadata;
1372 var _body = null;
1373
1374 if (adClientId == null) {
1375 throw new core.ArgumentError("Parameter adClientId is required.");
1376 }
1377 if (adUnitId == null) {
1378 throw new core.ArgumentError("Parameter adUnitId is required.");
1379 }
1380
1381
1382 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/' + common_internal.Escaper.ecapeVariable('$adUnitId');
1383
1384 var _response = _requester.request(_url,
1385 "GET",
1386 body: _body,
1387 queryParams: _queryParams,
1388 uploadOptions: _uploadOptions,
1389 uploadMedia: _uploadMedia,
1390 downloadOptions: _downloadOptions);
1391 return _response.then((data) => new AdUnit.fromJson(data));
1392 }
1393
1394 /**
1395 * Get ad code for the specified ad unit.
1396 *
1397 * Request parameters:
1398 *
1399 * [adClientId] - Ad client with contains the ad unit.
1400 *
1401 * [adUnitId] - Ad unit to get the code for.
1402 *
1403 * Completes with a [AdCode].
1404 *
1405 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1406 * error.
1407 *
1408 * If the used [http.Client] completes with an error when making a REST call,
1409 * this method will complete with the same error.
1410 */
1411 async.Future<AdCode> getAdCode(core.String adClientId, core.String adUnitId) {
1412 var _url = null;
1413 var _queryParams = new core.Map();
1414 var _uploadMedia = null;
1415 var _uploadOptions = null;
1416 var _downloadOptions = common.DownloadOptions.Metadata;
1417 var _body = null;
1418
1419 if (adClientId == null) {
1420 throw new core.ArgumentError("Parameter adClientId is required.");
1421 }
1422 if (adUnitId == null) {
1423 throw new core.ArgumentError("Parameter adUnitId is required.");
1424 }
1425
1426
1427 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/' + common_internal.Escaper.ecapeVariable('$adUnitId') + '/adcode';
1428
1429 var _response = _requester.request(_url,
1430 "GET",
1431 body: _body,
1432 queryParams: _queryParams,
1433 uploadOptions: _uploadOptions,
1434 uploadMedia: _uploadMedia,
1435 downloadOptions: _downloadOptions);
1436 return _response.then((data) => new AdCode.fromJson(data));
1437 }
1438
1439 /**
1440 * List all ad units in the specified ad client for this AdSense account.
1441 *
1442 * Request parameters:
1443 *
1444 * [adClientId] - Ad client for which to list ad units.
1445 *
1446 * [includeInactive] - Whether to include inactive ad units. Default: true.
1447 *
1448 * [maxResults] - The maximum number of ad units to include in the response,
1449 * used for paging.
1450 * Value must be between "0" and "10000".
1451 *
1452 * [pageToken] - A continuation token, used to page through ad units. To
1453 * retrieve the next page, set this parameter to the value of "nextPageToken"
1454 * from the previous response.
1455 *
1456 * Completes with a [AdUnits].
1457 *
1458 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1459 * error.
1460 *
1461 * If the used [http.Client] completes with an error when making a REST call,
1462 * this method will complete with the same error.
1463 */
1464 async.Future<AdUnits> list(core.String adClientId, {core.bool includeInactive, core.int maxResults, core.String pageToken}) {
1465 var _url = null;
1466 var _queryParams = new core.Map();
1467 var _uploadMedia = null;
1468 var _uploadOptions = null;
1469 var _downloadOptions = common.DownloadOptions.Metadata;
1470 var _body = null;
1471
1472 if (adClientId == null) {
1473 throw new core.ArgumentError("Parameter adClientId is required.");
1474 }
1475 if (includeInactive != null) {
1476 _queryParams["includeInactive"] = ["${includeInactive}"];
1477 }
1478 if (maxResults != null) {
1479 _queryParams["maxResults"] = ["${maxResults}"];
1480 }
1481 if (pageToken != null) {
1482 _queryParams["pageToken"] = [pageToken];
1483 }
1484
1485
1486 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits';
1487
1488 var _response = _requester.request(_url,
1489 "GET",
1490 body: _body,
1491 queryParams: _queryParams,
1492 uploadOptions: _uploadOptions,
1493 uploadMedia: _uploadMedia,
1494 downloadOptions: _downloadOptions);
1495 return _response.then((data) => new AdUnits.fromJson(data));
1496 }
1497
1498 }
1499
1500
1501 /** Not documented yet. */
1502 class AdunitsCustomchannelsResourceApi {
1503 final common_internal.ApiRequester _requester;
1504
1505 AdunitsCustomchannelsResourceApi(common_internal.ApiRequester client) :
1506 _requester = client;
1507
1508 /**
1509 * List all custom channels which the specified ad unit belongs to.
1510 *
1511 * Request parameters:
1512 *
1513 * [adClientId] - Ad client which contains the ad unit.
1514 *
1515 * [adUnitId] - Ad unit for which to list custom channels.
1516 *
1517 * [maxResults] - The maximum number of custom channels to include in the
1518 * response, used for paging.
1519 * Value must be between "0" and "10000".
1520 *
1521 * [pageToken] - A continuation token, used to page through custom channels.
1522 * To retrieve the next page, set this parameter to the value of
1523 * "nextPageToken" from the previous response.
1524 *
1525 * Completes with a [CustomChannels].
1526 *
1527 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1528 * error.
1529 *
1530 * If the used [http.Client] completes with an error when making a REST call,
1531 * this method will complete with the same error.
1532 */
1533 async.Future<CustomChannels> list(core.String adClientId, core.String adUnitId , {core.int maxResults, core.String pageToken}) {
1534 var _url = null;
1535 var _queryParams = new core.Map();
1536 var _uploadMedia = null;
1537 var _uploadOptions = null;
1538 var _downloadOptions = common.DownloadOptions.Metadata;
1539 var _body = null;
1540
1541 if (adClientId == null) {
1542 throw new core.ArgumentError("Parameter adClientId is required.");
1543 }
1544 if (adUnitId == null) {
1545 throw new core.ArgumentError("Parameter adUnitId is required.");
1546 }
1547 if (maxResults != null) {
1548 _queryParams["maxResults"] = ["${maxResults}"];
1549 }
1550 if (pageToken != null) {
1551 _queryParams["pageToken"] = [pageToken];
1552 }
1553
1554
1555 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/' + common_internal.Escaper.ecapeVariable('$adUnitId') + '/customchan nels';
1556
1557 var _response = _requester.request(_url,
1558 "GET",
1559 body: _body,
1560 queryParams: _queryParams,
1561 uploadOptions: _uploadOptions,
1562 uploadMedia: _uploadMedia,
1563 downloadOptions: _downloadOptions);
1564 return _response.then((data) => new CustomChannels.fromJson(data));
1565 }
1566
1567 }
1568
1569
1570 /** Not documented yet. */
1571 class AlertsResourceApi {
1572 final common_internal.ApiRequester _requester;
1573
1574 AlertsResourceApi(common_internal.ApiRequester client) :
1575 _requester = client;
1576
1577 /**
1578 * Dismiss (delete) the specified alert from the publisher's AdSense account.
1579 *
1580 * Request parameters:
1581 *
1582 * [alertId] - Alert to delete.
1583 *
1584 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1585 * error.
1586 *
1587 * If the used [http.Client] completes with an error when making a REST call,
1588 * this method will complete with the same error.
1589 */
1590 async.Future delete(core.String alertId) {
1591 var _url = null;
1592 var _queryParams = new core.Map();
1593 var _uploadMedia = null;
1594 var _uploadOptions = null;
1595 var _downloadOptions = common.DownloadOptions.Metadata;
1596 var _body = null;
1597
1598 if (alertId == null) {
1599 throw new core.ArgumentError("Parameter alertId is required.");
1600 }
1601
1602 _downloadOptions = null;
1603
1604 _url = 'alerts/' + common_internal.Escaper.ecapeVariable('$alertId');
1605
1606 var _response = _requester.request(_url,
1607 "DELETE",
1608 body: _body,
1609 queryParams: _queryParams,
1610 uploadOptions: _uploadOptions,
1611 uploadMedia: _uploadMedia,
1612 downloadOptions: _downloadOptions);
1613 return _response.then((data) => null);
1614 }
1615
1616 /**
1617 * List the alerts for this AdSense account.
1618 *
1619 * Request parameters:
1620 *
1621 * [locale] - The locale to use for translating alert messages. The account
1622 * locale will be used if this is not supplied. The AdSense default (English)
1623 * will be used if the supplied locale is invalid or unsupported.
1624 *
1625 * Completes with a [Alerts].
1626 *
1627 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1628 * error.
1629 *
1630 * If the used [http.Client] completes with an error when making a REST call,
1631 * this method will complete with the same error.
1632 */
1633 async.Future<Alerts> list({core.String locale}) {
1634 var _url = null;
1635 var _queryParams = new core.Map();
1636 var _uploadMedia = null;
1637 var _uploadOptions = null;
1638 var _downloadOptions = common.DownloadOptions.Metadata;
1639 var _body = null;
1640
1641 if (locale != null) {
1642 _queryParams["locale"] = [locale];
1643 }
1644
1645
1646 _url = 'alerts';
1647
1648 var _response = _requester.request(_url,
1649 "GET",
1650 body: _body,
1651 queryParams: _queryParams,
1652 uploadOptions: _uploadOptions,
1653 uploadMedia: _uploadMedia,
1654 downloadOptions: _downloadOptions);
1655 return _response.then((data) => new Alerts.fromJson(data));
1656 }
1657
1658 }
1659
1660
1661 /** Not documented yet. */
1662 class CustomchannelsResourceApi {
1663 final common_internal.ApiRequester _requester;
1664
1665 CustomchannelsAdunitsResourceApi get adunits => new CustomchannelsAdunitsResou rceApi(_requester);
1666
1667 CustomchannelsResourceApi(common_internal.ApiRequester client) :
1668 _requester = client;
1669
1670 /**
1671 * Get the specified custom channel from the specified ad client.
1672 *
1673 * Request parameters:
1674 *
1675 * [adClientId] - Ad client which contains the custom channel.
1676 *
1677 * [customChannelId] - Custom channel to retrieve.
1678 *
1679 * Completes with a [CustomChannel].
1680 *
1681 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1682 * error.
1683 *
1684 * If the used [http.Client] completes with an error when making a REST call,
1685 * this method will complete with the same error.
1686 */
1687 async.Future<CustomChannel> get(core.String adClientId, core.String customChan nelId) {
1688 var _url = null;
1689 var _queryParams = new core.Map();
1690 var _uploadMedia = null;
1691 var _uploadOptions = null;
1692 var _downloadOptions = common.DownloadOptions.Metadata;
1693 var _body = null;
1694
1695 if (adClientId == null) {
1696 throw new core.ArgumentError("Parameter adClientId is required.");
1697 }
1698 if (customChannelId == null) {
1699 throw new core.ArgumentError("Parameter customChannelId is required.");
1700 }
1701
1702
1703 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels/' + common_internal.Escaper.ecapeVariable('$customChannelId');
1704
1705 var _response = _requester.request(_url,
1706 "GET",
1707 body: _body,
1708 queryParams: _queryParams,
1709 uploadOptions: _uploadOptions,
1710 uploadMedia: _uploadMedia,
1711 downloadOptions: _downloadOptions);
1712 return _response.then((data) => new CustomChannel.fromJson(data));
1713 }
1714
1715 /**
1716 * List all custom channels in the specified ad client for this AdSense
1717 * account.
1718 *
1719 * Request parameters:
1720 *
1721 * [adClientId] - Ad client for which to list custom channels.
1722 *
1723 * [maxResults] - The maximum number of custom channels to include in the
1724 * response, used for paging.
1725 * Value must be between "0" and "10000".
1726 *
1727 * [pageToken] - A continuation token, used to page through custom channels.
1728 * To retrieve the next page, set this parameter to the value of
1729 * "nextPageToken" from the previous response.
1730 *
1731 * Completes with a [CustomChannels].
1732 *
1733 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1734 * error.
1735 *
1736 * If the used [http.Client] completes with an error when making a REST call,
1737 * this method will complete with the same error.
1738 */
1739 async.Future<CustomChannels> list(core.String adClientId, {core.int maxResults , core.String pageToken}) {
1740 var _url = null;
1741 var _queryParams = new core.Map();
1742 var _uploadMedia = null;
1743 var _uploadOptions = null;
1744 var _downloadOptions = common.DownloadOptions.Metadata;
1745 var _body = null;
1746
1747 if (adClientId == null) {
1748 throw new core.ArgumentError("Parameter adClientId is required.");
1749 }
1750 if (maxResults != null) {
1751 _queryParams["maxResults"] = ["${maxResults}"];
1752 }
1753 if (pageToken != null) {
1754 _queryParams["pageToken"] = [pageToken];
1755 }
1756
1757
1758 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels';
1759
1760 var _response = _requester.request(_url,
1761 "GET",
1762 body: _body,
1763 queryParams: _queryParams,
1764 uploadOptions: _uploadOptions,
1765 uploadMedia: _uploadMedia,
1766 downloadOptions: _downloadOptions);
1767 return _response.then((data) => new CustomChannels.fromJson(data));
1768 }
1769
1770 }
1771
1772
1773 /** Not documented yet. */
1774 class CustomchannelsAdunitsResourceApi {
1775 final common_internal.ApiRequester _requester;
1776
1777 CustomchannelsAdunitsResourceApi(common_internal.ApiRequester client) :
1778 _requester = client;
1779
1780 /**
1781 * List all ad units in the specified custom channel.
1782 *
1783 * Request parameters:
1784 *
1785 * [adClientId] - Ad client which contains the custom channel.
1786 *
1787 * [customChannelId] - Custom channel for which to list ad units.
1788 *
1789 * [includeInactive] - Whether to include inactive ad units. Default: true.
1790 *
1791 * [maxResults] - The maximum number of ad units to include in the response,
1792 * used for paging.
1793 * Value must be between "0" and "10000".
1794 *
1795 * [pageToken] - A continuation token, used to page through ad units. To
1796 * retrieve the next page, set this parameter to the value of "nextPageToken"
1797 * from the previous response.
1798 *
1799 * Completes with a [AdUnits].
1800 *
1801 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1802 * error.
1803 *
1804 * If the used [http.Client] completes with an error when making a REST call,
1805 * this method will complete with the same error.
1806 */
1807 async.Future<AdUnits> list(core.String adClientId, core.String customChannelId , {core.bool includeInactive, core.int maxResults, core.String pageToken}) {
1808 var _url = null;
1809 var _queryParams = new core.Map();
1810 var _uploadMedia = null;
1811 var _uploadOptions = null;
1812 var _downloadOptions = common.DownloadOptions.Metadata;
1813 var _body = null;
1814
1815 if (adClientId == null) {
1816 throw new core.ArgumentError("Parameter adClientId is required.");
1817 }
1818 if (customChannelId == null) {
1819 throw new core.ArgumentError("Parameter customChannelId is required.");
1820 }
1821 if (includeInactive != null) {
1822 _queryParams["includeInactive"] = ["${includeInactive}"];
1823 }
1824 if (maxResults != null) {
1825 _queryParams["maxResults"] = ["${maxResults}"];
1826 }
1827 if (pageToken != null) {
1828 _queryParams["pageToken"] = [pageToken];
1829 }
1830
1831
1832 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels/' + common_internal.Escaper.ecapeVariable('$customChannelId') + '/adunits';
1833
1834 var _response = _requester.request(_url,
1835 "GET",
1836 body: _body,
1837 queryParams: _queryParams,
1838 uploadOptions: _uploadOptions,
1839 uploadMedia: _uploadMedia,
1840 downloadOptions: _downloadOptions);
1841 return _response.then((data) => new AdUnits.fromJson(data));
1842 }
1843
1844 }
1845
1846
1847 /** Not documented yet. */
1848 class MetadataResourceApi {
1849 final common_internal.ApiRequester _requester;
1850
1851 MetadataDimensionsResourceApi get dimensions => new MetadataDimensionsResource Api(_requester);
1852 MetadataMetricsResourceApi get metrics => new MetadataMetricsResourceApi(_requ ester);
1853
1854 MetadataResourceApi(common_internal.ApiRequester client) :
1855 _requester = client;
1856 }
1857
1858
1859 /** Not documented yet. */
1860 class MetadataDimensionsResourceApi {
1861 final common_internal.ApiRequester _requester;
1862
1863 MetadataDimensionsResourceApi(common_internal.ApiRequester client) :
1864 _requester = client;
1865
1866 /**
1867 * List the metadata for the dimensions available to this AdSense account.
1868 *
1869 * Request parameters:
1870 *
1871 * Completes with a [Metadata].
1872 *
1873 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1874 * error.
1875 *
1876 * If the used [http.Client] completes with an error when making a REST call,
1877 * this method will complete with the same error.
1878 */
1879 async.Future<Metadata> list() {
1880 var _url = null;
1881 var _queryParams = new core.Map();
1882 var _uploadMedia = null;
1883 var _uploadOptions = null;
1884 var _downloadOptions = common.DownloadOptions.Metadata;
1885 var _body = null;
1886
1887
1888
1889 _url = 'metadata/dimensions';
1890
1891 var _response = _requester.request(_url,
1892 "GET",
1893 body: _body,
1894 queryParams: _queryParams,
1895 uploadOptions: _uploadOptions,
1896 uploadMedia: _uploadMedia,
1897 downloadOptions: _downloadOptions);
1898 return _response.then((data) => new Metadata.fromJson(data));
1899 }
1900
1901 }
1902
1903
1904 /** Not documented yet. */
1905 class MetadataMetricsResourceApi {
1906 final common_internal.ApiRequester _requester;
1907
1908 MetadataMetricsResourceApi(common_internal.ApiRequester client) :
1909 _requester = client;
1910
1911 /**
1912 * List the metadata for the metrics available to this AdSense account.
1913 *
1914 * Request parameters:
1915 *
1916 * Completes with a [Metadata].
1917 *
1918 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1919 * error.
1920 *
1921 * If the used [http.Client] completes with an error when making a REST call,
1922 * this method will complete with the same error.
1923 */
1924 async.Future<Metadata> list() {
1925 var _url = null;
1926 var _queryParams = new core.Map();
1927 var _uploadMedia = null;
1928 var _uploadOptions = null;
1929 var _downloadOptions = common.DownloadOptions.Metadata;
1930 var _body = null;
1931
1932
1933
1934 _url = 'metadata/metrics';
1935
1936 var _response = _requester.request(_url,
1937 "GET",
1938 body: _body,
1939 queryParams: _queryParams,
1940 uploadOptions: _uploadOptions,
1941 uploadMedia: _uploadMedia,
1942 downloadOptions: _downloadOptions);
1943 return _response.then((data) => new Metadata.fromJson(data));
1944 }
1945
1946 }
1947
1948
1949 /** Not documented yet. */
1950 class PaymentsResourceApi {
1951 final common_internal.ApiRequester _requester;
1952
1953 PaymentsResourceApi(common_internal.ApiRequester client) :
1954 _requester = client;
1955
1956 /**
1957 * List the payments for this AdSense account.
1958 *
1959 * Request parameters:
1960 *
1961 * Completes with a [Payments].
1962 *
1963 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1964 * error.
1965 *
1966 * If the used [http.Client] completes with an error when making a REST call,
1967 * this method will complete with the same error.
1968 */
1969 async.Future<Payments> list() {
1970 var _url = null;
1971 var _queryParams = new core.Map();
1972 var _uploadMedia = null;
1973 var _uploadOptions = null;
1974 var _downloadOptions = common.DownloadOptions.Metadata;
1975 var _body = null;
1976
1977
1978
1979 _url = 'payments';
1980
1981 var _response = _requester.request(_url,
1982 "GET",
1983 body: _body,
1984 queryParams: _queryParams,
1985 uploadOptions: _uploadOptions,
1986 uploadMedia: _uploadMedia,
1987 downloadOptions: _downloadOptions);
1988 return _response.then((data) => new Payments.fromJson(data));
1989 }
1990
1991 }
1992
1993
1994 /** Not documented yet. */
1995 class ReportsResourceApi {
1996 final common_internal.ApiRequester _requester;
1997
1998 ReportsSavedResourceApi get saved => new ReportsSavedResourceApi(_requester);
1999
2000 ReportsResourceApi(common_internal.ApiRequester client) :
2001 _requester = client;
2002
2003 /**
2004 * Generate an AdSense report based on the report request sent in the query
2005 * parameters. Returns the result as JSON; to retrieve output in CSV format
2006 * specify "alt=csv" as a query parameter.
2007 *
2008 * Request parameters:
2009 *
2010 * [startDate] - Start of the date range to report on in "YYYY-MM-DD" format,
2011 * inclusive.
2012 * Value must have pattern
2013 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )|(latest-(\d{2})-(\d{2})(-\d+y)?)|(latest-latest-(\d{2})(-\d+m)?)".
2014 *
2015 * [endDate] - End of the date range to report on in "YYYY-MM-DD" format,
2016 * inclusive.
2017 * Value must have pattern
2018 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )|(latest-(\d{2})-(\d{2})(-\d+y)?)|(latest-latest-(\d{2})(-\d+m)?)".
2019 *
2020 * [accountId] - Accounts upon which to report.
2021 *
2022 * [currency] - Optional currency to use when reporting on monetary metrics.
2023 * Defaults to the account's currency if not set.
2024 * Value must have pattern "[a-zA-Z]+".
2025 *
2026 * [dimension] - Dimensions to base the report on.
2027 * Value must have pattern "[a-zA-Z_]+".
2028 *
2029 * [filter] - Filters to be run on the report.
2030 * Value must have pattern "[a-zA-Z_]+(==|=@).+".
2031 *
2032 * [locale] - Optional locale to use for translating report output to a local
2033 * language. Defaults to "en_US" if not specified.
2034 * Value must have pattern "[a-zA-Z_]+".
2035 *
2036 * [maxResults] - The maximum number of rows of report data to return.
2037 * Value must be between "0" and "50000".
2038 *
2039 * [metric] - Numeric columns to include in the report.
2040 * Value must have pattern "[a-zA-Z_]+".
2041 *
2042 * [sort] - The name of a dimension or metric to sort the resulting report on,
2043 * optionally prefixed with "+" to sort ascending or "-" to sort descending.
2044 * If no prefix is specified, the column is sorted ascending.
2045 * Value must have pattern "(\+|-)?[a-zA-Z_]+".
2046 *
2047 * [startIndex] - Index of the first row of report data to return.
2048 * Value must be between "0" and "5000".
2049 *
2050 * [useTimezoneReporting] - Whether the report should be generated in the
2051 * AdSense account's local timezone. If false default PST/PDT timezone will be
2052 * used.
2053 *
2054 * [downloadOptions] - Options for downloading. A download can be either a
2055 * Metadata (default) or Media download. Partial Media downloads are possible
2056 * as well.
2057 *
2058 * Completes with a
2059 *
2060 * - [AdsenseReportsGenerateResponse] for Metadata downloads (see
2061 * [downloadOptions]).
2062 *
2063 * - [common.Media] for Media downloads (see [downloadOptions]).
2064 *
2065 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2066 * error.
2067 *
2068 * If the used [http.Client] completes with an error when making a REST call,
2069 * this method will complete with the same error.
2070 */
2071 async.Future generate(core.String startDate, core.String endDate, {core.List<c ore.String> accountId, core.String currency, core.List<core.String> dimension, c ore.List<core.String> filter, core.String locale, core.int maxResults, core.List <core.String> metric, core.List<core.String> sort, core.int startIndex, core.boo l useTimezoneReporting, common.DownloadOptions downloadOptions: common.DownloadO ptions.Metadata}) {
2072 var _url = null;
2073 var _queryParams = new core.Map();
2074 var _uploadMedia = null;
2075 var _uploadOptions = null;
2076 var _downloadOptions = common.DownloadOptions.Metadata;
2077 var _body = null;
2078
2079 if (startDate == null) {
2080 throw new core.ArgumentError("Parameter startDate is required.");
2081 }
2082 _queryParams["startDate"] = [startDate];
2083 if (endDate == null) {
2084 throw new core.ArgumentError("Parameter endDate is required.");
2085 }
2086 _queryParams["endDate"] = [endDate];
2087 if (accountId != null) {
2088 _queryParams["accountId"] = accountId;
2089 }
2090 if (currency != null) {
2091 _queryParams["currency"] = [currency];
2092 }
2093 if (dimension != null) {
2094 _queryParams["dimension"] = dimension;
2095 }
2096 if (filter != null) {
2097 _queryParams["filter"] = filter;
2098 }
2099 if (locale != null) {
2100 _queryParams["locale"] = [locale];
2101 }
2102 if (maxResults != null) {
2103 _queryParams["maxResults"] = ["${maxResults}"];
2104 }
2105 if (metric != null) {
2106 _queryParams["metric"] = metric;
2107 }
2108 if (sort != null) {
2109 _queryParams["sort"] = sort;
2110 }
2111 if (startIndex != null) {
2112 _queryParams["startIndex"] = ["${startIndex}"];
2113 }
2114 if (useTimezoneReporting != null) {
2115 _queryParams["useTimezoneReporting"] = ["${useTimezoneReporting}"];
2116 }
2117
2118 _downloadOptions = downloadOptions;
2119
2120 _url = 'reports';
2121
2122 var _response = _requester.request(_url,
2123 "GET",
2124 body: _body,
2125 queryParams: _queryParams,
2126 uploadOptions: _uploadOptions,
2127 uploadMedia: _uploadMedia,
2128 downloadOptions: _downloadOptions);
2129 if (_downloadOptions == null ||
2130 _downloadOptions == common.DownloadOptions.Metadata) {
2131 return _response.then((data) => new AdsenseReportsGenerateResponse.fromJso n(data));
2132 } else {
2133 return _response;
2134 }
2135 }
2136
2137 }
2138
2139
2140 /** Not documented yet. */
2141 class ReportsSavedResourceApi {
2142 final common_internal.ApiRequester _requester;
2143
2144 ReportsSavedResourceApi(common_internal.ApiRequester client) :
2145 _requester = client;
2146
2147 /**
2148 * Generate an AdSense report based on the saved report ID sent in the query
2149 * parameters.
2150 *
2151 * Request parameters:
2152 *
2153 * [savedReportId] - The saved report to retrieve.
2154 *
2155 * [locale] - Optional locale to use for translating report output to a local
2156 * language. Defaults to "en_US" if not specified.
2157 * Value must have pattern "[a-zA-Z_]+".
2158 *
2159 * [maxResults] - The maximum number of rows of report data to return.
2160 * Value must be between "0" and "50000".
2161 *
2162 * [startIndex] - Index of the first row of report data to return.
2163 * Value must be between "0" and "5000".
2164 *
2165 * Completes with a [AdsenseReportsGenerateResponse].
2166 *
2167 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2168 * error.
2169 *
2170 * If the used [http.Client] completes with an error when making a REST call,
2171 * this method will complete with the same error.
2172 */
2173 async.Future<AdsenseReportsGenerateResponse> generate(core.String savedReportI d, {core.String locale, core.int maxResults, core.int startIndex}) {
2174 var _url = null;
2175 var _queryParams = new core.Map();
2176 var _uploadMedia = null;
2177 var _uploadOptions = null;
2178 var _downloadOptions = common.DownloadOptions.Metadata;
2179 var _body = null;
2180
2181 if (savedReportId == null) {
2182 throw new core.ArgumentError("Parameter savedReportId is required.");
2183 }
2184 if (locale != null) {
2185 _queryParams["locale"] = [locale];
2186 }
2187 if (maxResults != null) {
2188 _queryParams["maxResults"] = ["${maxResults}"];
2189 }
2190 if (startIndex != null) {
2191 _queryParams["startIndex"] = ["${startIndex}"];
2192 }
2193
2194
2195 _url = 'reports/' + common_internal.Escaper.ecapeVariable('$savedReportId');
2196
2197 var _response = _requester.request(_url,
2198 "GET",
2199 body: _body,
2200 queryParams: _queryParams,
2201 uploadOptions: _uploadOptions,
2202 uploadMedia: _uploadMedia,
2203 downloadOptions: _downloadOptions);
2204 return _response.then((data) => new AdsenseReportsGenerateResponse.fromJson( data));
2205 }
2206
2207 /**
2208 * List all saved reports in this AdSense account.
2209 *
2210 * Request parameters:
2211 *
2212 * [maxResults] - The maximum number of saved reports to include in the
2213 * response, used for paging.
2214 * Value must be between "0" and "100".
2215 *
2216 * [pageToken] - A continuation token, used to page through saved reports. To
2217 * retrieve the next page, set this parameter to the value of "nextPageToken"
2218 * from the previous response.
2219 *
2220 * Completes with a [SavedReports].
2221 *
2222 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2223 * error.
2224 *
2225 * If the used [http.Client] completes with an error when making a REST call,
2226 * this method will complete with the same error.
2227 */
2228 async.Future<SavedReports> list({core.int maxResults, core.String pageToken}) {
2229 var _url = null;
2230 var _queryParams = new core.Map();
2231 var _uploadMedia = null;
2232 var _uploadOptions = null;
2233 var _downloadOptions = common.DownloadOptions.Metadata;
2234 var _body = null;
2235
2236 if (maxResults != null) {
2237 _queryParams["maxResults"] = ["${maxResults}"];
2238 }
2239 if (pageToken != null) {
2240 _queryParams["pageToken"] = [pageToken];
2241 }
2242
2243
2244 _url = 'reports/saved';
2245
2246 var _response = _requester.request(_url,
2247 "GET",
2248 body: _body,
2249 queryParams: _queryParams,
2250 uploadOptions: _uploadOptions,
2251 uploadMedia: _uploadMedia,
2252 downloadOptions: _downloadOptions);
2253 return _response.then((data) => new SavedReports.fromJson(data));
2254 }
2255
2256 }
2257
2258
2259 /** Not documented yet. */
2260 class SavedadstylesResourceApi {
2261 final common_internal.ApiRequester _requester;
2262
2263 SavedadstylesResourceApi(common_internal.ApiRequester client) :
2264 _requester = client;
2265
2266 /**
2267 * Get a specific saved ad style from the user's account.
2268 *
2269 * Request parameters:
2270 *
2271 * [savedAdStyleId] - Saved ad style to retrieve.
2272 *
2273 * Completes with a [SavedAdStyle].
2274 *
2275 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2276 * error.
2277 *
2278 * If the used [http.Client] completes with an error when making a REST call,
2279 * this method will complete with the same error.
2280 */
2281 async.Future<SavedAdStyle> get(core.String savedAdStyleId) {
2282 var _url = null;
2283 var _queryParams = new core.Map();
2284 var _uploadMedia = null;
2285 var _uploadOptions = null;
2286 var _downloadOptions = common.DownloadOptions.Metadata;
2287 var _body = null;
2288
2289 if (savedAdStyleId == null) {
2290 throw new core.ArgumentError("Parameter savedAdStyleId is required.");
2291 }
2292
2293
2294 _url = 'savedadstyles/' + common_internal.Escaper.ecapeVariable('$savedAdSty leId');
2295
2296 var _response = _requester.request(_url,
2297 "GET",
2298 body: _body,
2299 queryParams: _queryParams,
2300 uploadOptions: _uploadOptions,
2301 uploadMedia: _uploadMedia,
2302 downloadOptions: _downloadOptions);
2303 return _response.then((data) => new SavedAdStyle.fromJson(data));
2304 }
2305
2306 /**
2307 * List all saved ad styles in the user's account.
2308 *
2309 * Request parameters:
2310 *
2311 * [maxResults] - The maximum number of saved ad styles to include in the
2312 * response, used for paging.
2313 * Value must be between "0" and "10000".
2314 *
2315 * [pageToken] - A continuation token, used to page through saved ad styles.
2316 * To retrieve the next page, set this parameter to the value of
2317 * "nextPageToken" from the previous response.
2318 *
2319 * Completes with a [SavedAdStyles].
2320 *
2321 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2322 * error.
2323 *
2324 * If the used [http.Client] completes with an error when making a REST call,
2325 * this method will complete with the same error.
2326 */
2327 async.Future<SavedAdStyles> list({core.int maxResults, core.String pageToken}) {
2328 var _url = null;
2329 var _queryParams = new core.Map();
2330 var _uploadMedia = null;
2331 var _uploadOptions = null;
2332 var _downloadOptions = common.DownloadOptions.Metadata;
2333 var _body = null;
2334
2335 if (maxResults != null) {
2336 _queryParams["maxResults"] = ["${maxResults}"];
2337 }
2338 if (pageToken != null) {
2339 _queryParams["pageToken"] = [pageToken];
2340 }
2341
2342
2343 _url = 'savedadstyles';
2344
2345 var _response = _requester.request(_url,
2346 "GET",
2347 body: _body,
2348 queryParams: _queryParams,
2349 uploadOptions: _uploadOptions,
2350 uploadMedia: _uploadMedia,
2351 downloadOptions: _downloadOptions);
2352 return _response.then((data) => new SavedAdStyles.fromJson(data));
2353 }
2354
2355 }
2356
2357
2358 /** Not documented yet. */
2359 class UrlchannelsResourceApi {
2360 final common_internal.ApiRequester _requester;
2361
2362 UrlchannelsResourceApi(common_internal.ApiRequester client) :
2363 _requester = client;
2364
2365 /**
2366 * List all URL channels in the specified ad client for this AdSense account.
2367 *
2368 * Request parameters:
2369 *
2370 * [adClientId] - Ad client for which to list URL channels.
2371 *
2372 * [maxResults] - The maximum number of URL channels to include in the
2373 * response, used for paging.
2374 * Value must be between "0" and "10000".
2375 *
2376 * [pageToken] - A continuation token, used to page through URL channels. To
2377 * retrieve the next page, set this parameter to the value of "nextPageToken"
2378 * from the previous response.
2379 *
2380 * Completes with a [UrlChannels].
2381 *
2382 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2383 * error.
2384 *
2385 * If the used [http.Client] completes with an error when making a REST call,
2386 * this method will complete with the same error.
2387 */
2388 async.Future<UrlChannels> list(core.String adClientId, {core.int maxResults, c ore.String pageToken}) {
2389 var _url = null;
2390 var _queryParams = new core.Map();
2391 var _uploadMedia = null;
2392 var _uploadOptions = null;
2393 var _downloadOptions = common.DownloadOptions.Metadata;
2394 var _body = null;
2395
2396 if (adClientId == null) {
2397 throw new core.ArgumentError("Parameter adClientId is required.");
2398 }
2399 if (maxResults != null) {
2400 _queryParams["maxResults"] = ["${maxResults}"];
2401 }
2402 if (pageToken != null) {
2403 _queryParams["pageToken"] = [pageToken];
2404 }
2405
2406
2407 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/urlchannels';
2408
2409 var _response = _requester.request(_url,
2410 "GET",
2411 body: _body,
2412 queryParams: _queryParams,
2413 uploadOptions: _uploadOptions,
2414 uploadMedia: _uploadMedia,
2415 downloadOptions: _downloadOptions);
2416 return _response.then((data) => new UrlChannels.fromJson(data));
2417 }
2418
2419 }
2420
2421
2422
2423 /** Not documented yet. */
2424 class Account {
2425 /** Unique identifier of this account. */
2426 core.String id;
2427
2428 /** Kind of resource this is, in this case adsense#account. */
2429 core.String kind;
2430
2431 /** Name of this account. */
2432 core.String name;
2433
2434 /** Whether this account is premium. */
2435 core.bool premium;
2436
2437 /** Sub accounts of the this account. */
2438 core.List<Account> subAccounts;
2439
2440 /** AdSense timezone of this account. */
2441 core.String timezone;
2442
2443
2444 Account();
2445
2446 Account.fromJson(core.Map _json) {
2447 if (_json.containsKey("id")) {
2448 id = _json["id"];
2449 }
2450 if (_json.containsKey("kind")) {
2451 kind = _json["kind"];
2452 }
2453 if (_json.containsKey("name")) {
2454 name = _json["name"];
2455 }
2456 if (_json.containsKey("premium")) {
2457 premium = _json["premium"];
2458 }
2459 if (_json.containsKey("subAccounts")) {
2460 subAccounts = _json["subAccounts"].map((value) => new Account.fromJson(val ue)).toList();
2461 }
2462 if (_json.containsKey("timezone")) {
2463 timezone = _json["timezone"];
2464 }
2465 }
2466
2467 core.Map toJson() {
2468 var _json = new core.Map();
2469 if (id != null) {
2470 _json["id"] = id;
2471 }
2472 if (kind != null) {
2473 _json["kind"] = kind;
2474 }
2475 if (name != null) {
2476 _json["name"] = name;
2477 }
2478 if (premium != null) {
2479 _json["premium"] = premium;
2480 }
2481 if (subAccounts != null) {
2482 _json["subAccounts"] = subAccounts.map((value) => (value).toJson()).toList ();
2483 }
2484 if (timezone != null) {
2485 _json["timezone"] = timezone;
2486 }
2487 return _json;
2488 }
2489 }
2490
2491
2492 /** Not documented yet. */
2493 class Accounts {
2494 /** ETag of this response for caching purposes. */
2495 core.String etag;
2496
2497 /** The accounts returned in this list response. */
2498 core.List<Account> items;
2499
2500 /** Kind of list this is, in this case adsense#accounts. */
2501 core.String kind;
2502
2503 /**
2504 * Continuation token used to page through accounts. To retrieve the next page
2505 * of results, set the next request's "pageToken" value to this.
2506 */
2507 core.String nextPageToken;
2508
2509
2510 Accounts();
2511
2512 Accounts.fromJson(core.Map _json) {
2513 if (_json.containsKey("etag")) {
2514 etag = _json["etag"];
2515 }
2516 if (_json.containsKey("items")) {
2517 items = _json["items"].map((value) => new Account.fromJson(value)).toList( );
2518 }
2519 if (_json.containsKey("kind")) {
2520 kind = _json["kind"];
2521 }
2522 if (_json.containsKey("nextPageToken")) {
2523 nextPageToken = _json["nextPageToken"];
2524 }
2525 }
2526
2527 core.Map toJson() {
2528 var _json = new core.Map();
2529 if (etag != null) {
2530 _json["etag"] = etag;
2531 }
2532 if (items != null) {
2533 _json["items"] = items.map((value) => (value).toJson()).toList();
2534 }
2535 if (kind != null) {
2536 _json["kind"] = kind;
2537 }
2538 if (nextPageToken != null) {
2539 _json["nextPageToken"] = nextPageToken;
2540 }
2541 return _json;
2542 }
2543 }
2544
2545
2546 /** Not documented yet. */
2547 class AdClient {
2548 /** Whether this ad client is opted in to ARC. */
2549 core.bool arcOptIn;
2550
2551 /**
2552 * ARC review mode this ad client is in. Empty if the client is not opted in
2553 * to ARC. Possible values: POST_REVIEW, AUTOMATIC_PRE_REVIEW.
2554 */
2555 core.String arcReviewMode;
2556
2557 /** Unique identifier of this ad client. */
2558 core.String id;
2559
2560 /** Kind of resource this is, in this case adsense#adClient. */
2561 core.String kind;
2562
2563 /**
2564 * This ad client's product code, which corresponds to the PRODUCT_CODE report
2565 * dimension.
2566 */
2567 core.String productCode;
2568
2569 /** Whether this ad client supports being reported on. */
2570 core.bool supportsReporting;
2571
2572
2573 AdClient();
2574
2575 AdClient.fromJson(core.Map _json) {
2576 if (_json.containsKey("arcOptIn")) {
2577 arcOptIn = _json["arcOptIn"];
2578 }
2579 if (_json.containsKey("arcReviewMode")) {
2580 arcReviewMode = _json["arcReviewMode"];
2581 }
2582 if (_json.containsKey("id")) {
2583 id = _json["id"];
2584 }
2585 if (_json.containsKey("kind")) {
2586 kind = _json["kind"];
2587 }
2588 if (_json.containsKey("productCode")) {
2589 productCode = _json["productCode"];
2590 }
2591 if (_json.containsKey("supportsReporting")) {
2592 supportsReporting = _json["supportsReporting"];
2593 }
2594 }
2595
2596 core.Map toJson() {
2597 var _json = new core.Map();
2598 if (arcOptIn != null) {
2599 _json["arcOptIn"] = arcOptIn;
2600 }
2601 if (arcReviewMode != null) {
2602 _json["arcReviewMode"] = arcReviewMode;
2603 }
2604 if (id != null) {
2605 _json["id"] = id;
2606 }
2607 if (kind != null) {
2608 _json["kind"] = kind;
2609 }
2610 if (productCode != null) {
2611 _json["productCode"] = productCode;
2612 }
2613 if (supportsReporting != null) {
2614 _json["supportsReporting"] = supportsReporting;
2615 }
2616 return _json;
2617 }
2618 }
2619
2620
2621 /** Not documented yet. */
2622 class AdClients {
2623 /** ETag of this response for caching purposes. */
2624 core.String etag;
2625
2626 /** The ad clients returned in this list response. */
2627 core.List<AdClient> items;
2628
2629 /** Kind of list this is, in this case adsense#adClients. */
2630 core.String kind;
2631
2632 /**
2633 * Continuation token used to page through ad clients. To retrieve the next
2634 * page of results, set the next request's "pageToken" value to this.
2635 */
2636 core.String nextPageToken;
2637
2638
2639 AdClients();
2640
2641 AdClients.fromJson(core.Map _json) {
2642 if (_json.containsKey("etag")) {
2643 etag = _json["etag"];
2644 }
2645 if (_json.containsKey("items")) {
2646 items = _json["items"].map((value) => new AdClient.fromJson(value)).toList ();
2647 }
2648 if (_json.containsKey("kind")) {
2649 kind = _json["kind"];
2650 }
2651 if (_json.containsKey("nextPageToken")) {
2652 nextPageToken = _json["nextPageToken"];
2653 }
2654 }
2655
2656 core.Map toJson() {
2657 var _json = new core.Map();
2658 if (etag != null) {
2659 _json["etag"] = etag;
2660 }
2661 if (items != null) {
2662 _json["items"] = items.map((value) => (value).toJson()).toList();
2663 }
2664 if (kind != null) {
2665 _json["kind"] = kind;
2666 }
2667 if (nextPageToken != null) {
2668 _json["nextPageToken"] = nextPageToken;
2669 }
2670 return _json;
2671 }
2672 }
2673
2674
2675 /** Not documented yet. */
2676 class AdCode {
2677 /** The ad code snippet. */
2678 core.String adCode;
2679
2680 /** Kind this is, in this case adsense#adCode. */
2681 core.String kind;
2682
2683
2684 AdCode();
2685
2686 AdCode.fromJson(core.Map _json) {
2687 if (_json.containsKey("adCode")) {
2688 adCode = _json["adCode"];
2689 }
2690 if (_json.containsKey("kind")) {
2691 kind = _json["kind"];
2692 }
2693 }
2694
2695 core.Map toJson() {
2696 var _json = new core.Map();
2697 if (adCode != null) {
2698 _json["adCode"] = adCode;
2699 }
2700 if (kind != null) {
2701 _json["kind"] = kind;
2702 }
2703 return _json;
2704 }
2705 }
2706
2707
2708 /**
2709 * The colors which are included in the style. These are represented as six
2710 * hexadecimal characters, similar to HTML color codes, but without the leading
2711 * hash.
2712 */
2713 class AdStyleColors {
2714 /** The color of the ad background. */
2715 core.String background;
2716
2717 /** The color of the ad border. */
2718 core.String border;
2719
2720 /** The color of the ad text. */
2721 core.String text;
2722
2723 /** The color of the ad title. */
2724 core.String title;
2725
2726 /** The color of the ad url. */
2727 core.String url;
2728
2729
2730 AdStyleColors();
2731
2732 AdStyleColors.fromJson(core.Map _json) {
2733 if (_json.containsKey("background")) {
2734 background = _json["background"];
2735 }
2736 if (_json.containsKey("border")) {
2737 border = _json["border"];
2738 }
2739 if (_json.containsKey("text")) {
2740 text = _json["text"];
2741 }
2742 if (_json.containsKey("title")) {
2743 title = _json["title"];
2744 }
2745 if (_json.containsKey("url")) {
2746 url = _json["url"];
2747 }
2748 }
2749
2750 core.Map toJson() {
2751 var _json = new core.Map();
2752 if (background != null) {
2753 _json["background"] = background;
2754 }
2755 if (border != null) {
2756 _json["border"] = border;
2757 }
2758 if (text != null) {
2759 _json["text"] = text;
2760 }
2761 if (title != null) {
2762 _json["title"] = title;
2763 }
2764 if (url != null) {
2765 _json["url"] = url;
2766 }
2767 return _json;
2768 }
2769 }
2770
2771
2772 /** The font which is included in the style. */
2773 class AdStyleFont {
2774 /** The family of the font. */
2775 core.String family;
2776
2777 /** The size of the font. */
2778 core.String size;
2779
2780
2781 AdStyleFont();
2782
2783 AdStyleFont.fromJson(core.Map _json) {
2784 if (_json.containsKey("family")) {
2785 family = _json["family"];
2786 }
2787 if (_json.containsKey("size")) {
2788 size = _json["size"];
2789 }
2790 }
2791
2792 core.Map toJson() {
2793 var _json = new core.Map();
2794 if (family != null) {
2795 _json["family"] = family;
2796 }
2797 if (size != null) {
2798 _json["size"] = size;
2799 }
2800 return _json;
2801 }
2802 }
2803
2804
2805 /** Not documented yet. */
2806 class AdStyle {
2807 /**
2808 * The colors which are included in the style. These are represented as six
2809 * hexadecimal characters, similar to HTML color codes, but without the
2810 * leading hash.
2811 */
2812 AdStyleColors colors;
2813
2814 /** The style of the corners in the ad. */
2815 core.String corners;
2816
2817 /** The font which is included in the style. */
2818 AdStyleFont font;
2819
2820 /** Kind this is, in this case adsense#adStyle. */
2821 core.String kind;
2822
2823
2824 AdStyle();
2825
2826 AdStyle.fromJson(core.Map _json) {
2827 if (_json.containsKey("colors")) {
2828 colors = new AdStyleColors.fromJson(_json["colors"]);
2829 }
2830 if (_json.containsKey("corners")) {
2831 corners = _json["corners"];
2832 }
2833 if (_json.containsKey("font")) {
2834 font = new AdStyleFont.fromJson(_json["font"]);
2835 }
2836 if (_json.containsKey("kind")) {
2837 kind = _json["kind"];
2838 }
2839 }
2840
2841 core.Map toJson() {
2842 var _json = new core.Map();
2843 if (colors != null) {
2844 _json["colors"] = (colors).toJson();
2845 }
2846 if (corners != null) {
2847 _json["corners"] = corners;
2848 }
2849 if (font != null) {
2850 _json["font"] = (font).toJson();
2851 }
2852 if (kind != null) {
2853 _json["kind"] = kind;
2854 }
2855 return _json;
2856 }
2857 }
2858
2859
2860 /** The backup option to be used in instances where no ad is available. */
2861 class AdUnitContentAdsSettingsBackupOption {
2862 /** Color to use when type is set to COLOR. */
2863 core.String color;
2864
2865 /** Type of the backup option. Possible values are BLANK, COLOR and URL. */
2866 core.String type;
2867
2868 /** URL to use when type is set to URL. */
2869 core.String url;
2870
2871
2872 AdUnitContentAdsSettingsBackupOption();
2873
2874 AdUnitContentAdsSettingsBackupOption.fromJson(core.Map _json) {
2875 if (_json.containsKey("color")) {
2876 color = _json["color"];
2877 }
2878 if (_json.containsKey("type")) {
2879 type = _json["type"];
2880 }
2881 if (_json.containsKey("url")) {
2882 url = _json["url"];
2883 }
2884 }
2885
2886 core.Map toJson() {
2887 var _json = new core.Map();
2888 if (color != null) {
2889 _json["color"] = color;
2890 }
2891 if (type != null) {
2892 _json["type"] = type;
2893 }
2894 if (url != null) {
2895 _json["url"] = url;
2896 }
2897 return _json;
2898 }
2899 }
2900
2901
2902 /**
2903 * Settings specific to content ads (AFC) and highend mobile content ads (AFMC).
2904 */
2905 class AdUnitContentAdsSettings {
2906 /** The backup option to be used in instances where no ad is available. */
2907 AdUnitContentAdsSettingsBackupOption backupOption;
2908
2909 /** Size of this ad unit. */
2910 core.String size;
2911
2912 /** Type of this ad unit. */
2913 core.String type;
2914
2915
2916 AdUnitContentAdsSettings();
2917
2918 AdUnitContentAdsSettings.fromJson(core.Map _json) {
2919 if (_json.containsKey("backupOption")) {
2920 backupOption = new AdUnitContentAdsSettingsBackupOption.fromJson(_json["ba ckupOption"]);
2921 }
2922 if (_json.containsKey("size")) {
2923 size = _json["size"];
2924 }
2925 if (_json.containsKey("type")) {
2926 type = _json["type"];
2927 }
2928 }
2929
2930 core.Map toJson() {
2931 var _json = new core.Map();
2932 if (backupOption != null) {
2933 _json["backupOption"] = (backupOption).toJson();
2934 }
2935 if (size != null) {
2936 _json["size"] = size;
2937 }
2938 if (type != null) {
2939 _json["type"] = type;
2940 }
2941 return _json;
2942 }
2943 }
2944
2945
2946 /** Settings specific to feed ads (AFF). */
2947 class AdUnitFeedAdsSettings {
2948 /** The position of the ads relative to the feed entries. */
2949 core.String adPosition;
2950
2951 /**
2952 * The frequency at which ads should appear in the feed (i.e. every N
2953 * entries).
2954 */
2955 core.int frequency;
2956
2957 /** The minimum length an entry should be in order to have attached ads. */
2958 core.int minimumWordCount;
2959
2960 /** The type of ads which should appear. */
2961 core.String type;
2962
2963
2964 AdUnitFeedAdsSettings();
2965
2966 AdUnitFeedAdsSettings.fromJson(core.Map _json) {
2967 if (_json.containsKey("adPosition")) {
2968 adPosition = _json["adPosition"];
2969 }
2970 if (_json.containsKey("frequency")) {
2971 frequency = _json["frequency"];
2972 }
2973 if (_json.containsKey("minimumWordCount")) {
2974 minimumWordCount = _json["minimumWordCount"];
2975 }
2976 if (_json.containsKey("type")) {
2977 type = _json["type"];
2978 }
2979 }
2980
2981 core.Map toJson() {
2982 var _json = new core.Map();
2983 if (adPosition != null) {
2984 _json["adPosition"] = adPosition;
2985 }
2986 if (frequency != null) {
2987 _json["frequency"] = frequency;
2988 }
2989 if (minimumWordCount != null) {
2990 _json["minimumWordCount"] = minimumWordCount;
2991 }
2992 if (type != null) {
2993 _json["type"] = type;
2994 }
2995 return _json;
2996 }
2997 }
2998
2999
3000 /** Settings specific to WAP mobile content ads (AFMC). */
3001 class AdUnitMobileContentAdsSettings {
3002 /** The markup language to use for this ad unit. */
3003 core.String markupLanguage;
3004
3005 /** The scripting language to use for this ad unit. */
3006 core.String scriptingLanguage;
3007
3008 /** Size of this ad unit. */
3009 core.String size;
3010
3011 /** Type of this ad unit. */
3012 core.String type;
3013
3014
3015 AdUnitMobileContentAdsSettings();
3016
3017 AdUnitMobileContentAdsSettings.fromJson(core.Map _json) {
3018 if (_json.containsKey("markupLanguage")) {
3019 markupLanguage = _json["markupLanguage"];
3020 }
3021 if (_json.containsKey("scriptingLanguage")) {
3022 scriptingLanguage = _json["scriptingLanguage"];
3023 }
3024 if (_json.containsKey("size")) {
3025 size = _json["size"];
3026 }
3027 if (_json.containsKey("type")) {
3028 type = _json["type"];
3029 }
3030 }
3031
3032 core.Map toJson() {
3033 var _json = new core.Map();
3034 if (markupLanguage != null) {
3035 _json["markupLanguage"] = markupLanguage;
3036 }
3037 if (scriptingLanguage != null) {
3038 _json["scriptingLanguage"] = scriptingLanguage;
3039 }
3040 if (size != null) {
3041 _json["size"] = size;
3042 }
3043 if (type != null) {
3044 _json["type"] = type;
3045 }
3046 return _json;
3047 }
3048 }
3049
3050
3051 /** Not documented yet. */
3052 class AdUnit {
3053 /**
3054 * Identity code of this ad unit, not necessarily unique across ad clients.
3055 */
3056 core.String code;
3057
3058 /**
3059 * Settings specific to content ads (AFC) and highend mobile content ads
3060 * (AFMC).
3061 */
3062 AdUnitContentAdsSettings contentAdsSettings;
3063
3064 /** Custom style information specific to this ad unit. */
3065 AdStyle customStyle;
3066
3067 /** Settings specific to feed ads (AFF). */
3068 AdUnitFeedAdsSettings feedAdsSettings;
3069
3070 /**
3071 * Unique identifier of this ad unit. This should be considered an opaque
3072 * identifier; it is not safe to rely on it being in any particular format.
3073 */
3074 core.String id;
3075
3076 /** Kind of resource this is, in this case adsense#adUnit. */
3077 core.String kind;
3078
3079 /** Settings specific to WAP mobile content ads (AFMC). */
3080 AdUnitMobileContentAdsSettings mobileContentAdsSettings;
3081
3082 /** Name of this ad unit. */
3083 core.String name;
3084
3085 /** ID of the saved ad style which holds this ad unit's style information. */
3086 core.String savedStyleId;
3087
3088 /**
3089 * Status of this ad unit. Possible values are:
3090 * NEW: Indicates that the ad unit was created within the last seven days and
3091 * does not yet have any activity associated with it.
3092 *
3093 * ACTIVE: Indicates that there has been activity on this ad unit in the last
3094 * seven days.
3095 *
3096 * INACTIVE: Indicates that there has been no activity on this ad unit in the
3097 * last seven days.
3098 */
3099 core.String status;
3100
3101
3102 AdUnit();
3103
3104 AdUnit.fromJson(core.Map _json) {
3105 if (_json.containsKey("code")) {
3106 code = _json["code"];
3107 }
3108 if (_json.containsKey("contentAdsSettings")) {
3109 contentAdsSettings = new AdUnitContentAdsSettings.fromJson(_json["contentA dsSettings"]);
3110 }
3111 if (_json.containsKey("customStyle")) {
3112 customStyle = new AdStyle.fromJson(_json["customStyle"]);
3113 }
3114 if (_json.containsKey("feedAdsSettings")) {
3115 feedAdsSettings = new AdUnitFeedAdsSettings.fromJson(_json["feedAdsSetting s"]);
3116 }
3117 if (_json.containsKey("id")) {
3118 id = _json["id"];
3119 }
3120 if (_json.containsKey("kind")) {
3121 kind = _json["kind"];
3122 }
3123 if (_json.containsKey("mobileContentAdsSettings")) {
3124 mobileContentAdsSettings = new AdUnitMobileContentAdsSettings.fromJson(_js on["mobileContentAdsSettings"]);
3125 }
3126 if (_json.containsKey("name")) {
3127 name = _json["name"];
3128 }
3129 if (_json.containsKey("savedStyleId")) {
3130 savedStyleId = _json["savedStyleId"];
3131 }
3132 if (_json.containsKey("status")) {
3133 status = _json["status"];
3134 }
3135 }
3136
3137 core.Map toJson() {
3138 var _json = new core.Map();
3139 if (code != null) {
3140 _json["code"] = code;
3141 }
3142 if (contentAdsSettings != null) {
3143 _json["contentAdsSettings"] = (contentAdsSettings).toJson();
3144 }
3145 if (customStyle != null) {
3146 _json["customStyle"] = (customStyle).toJson();
3147 }
3148 if (feedAdsSettings != null) {
3149 _json["feedAdsSettings"] = (feedAdsSettings).toJson();
3150 }
3151 if (id != null) {
3152 _json["id"] = id;
3153 }
3154 if (kind != null) {
3155 _json["kind"] = kind;
3156 }
3157 if (mobileContentAdsSettings != null) {
3158 _json["mobileContentAdsSettings"] = (mobileContentAdsSettings).toJson();
3159 }
3160 if (name != null) {
3161 _json["name"] = name;
3162 }
3163 if (savedStyleId != null) {
3164 _json["savedStyleId"] = savedStyleId;
3165 }
3166 if (status != null) {
3167 _json["status"] = status;
3168 }
3169 return _json;
3170 }
3171 }
3172
3173
3174 /** Not documented yet. */
3175 class AdUnits {
3176 /** ETag of this response for caching purposes. */
3177 core.String etag;
3178
3179 /** The ad units returned in this list response. */
3180 core.List<AdUnit> items;
3181
3182 /** Kind of list this is, in this case adsense#adUnits. */
3183 core.String kind;
3184
3185 /**
3186 * Continuation token used to page through ad units. To retrieve the next page
3187 * of results, set the next request's "pageToken" value to this.
3188 */
3189 core.String nextPageToken;
3190
3191
3192 AdUnits();
3193
3194 AdUnits.fromJson(core.Map _json) {
3195 if (_json.containsKey("etag")) {
3196 etag = _json["etag"];
3197 }
3198 if (_json.containsKey("items")) {
3199 items = _json["items"].map((value) => new AdUnit.fromJson(value)).toList() ;
3200 }
3201 if (_json.containsKey("kind")) {
3202 kind = _json["kind"];
3203 }
3204 if (_json.containsKey("nextPageToken")) {
3205 nextPageToken = _json["nextPageToken"];
3206 }
3207 }
3208
3209 core.Map toJson() {
3210 var _json = new core.Map();
3211 if (etag != null) {
3212 _json["etag"] = etag;
3213 }
3214 if (items != null) {
3215 _json["items"] = items.map((value) => (value).toJson()).toList();
3216 }
3217 if (kind != null) {
3218 _json["kind"] = kind;
3219 }
3220 if (nextPageToken != null) {
3221 _json["nextPageToken"] = nextPageToken;
3222 }
3223 return _json;
3224 }
3225 }
3226
3227
3228 /** Not documented yet. */
3229 class AdsenseReportsGenerateResponseHeaders {
3230 /**
3231 * The currency of this column. Only present if the header type is
3232 * METRIC_CURRENCY.
3233 */
3234 core.String currency;
3235
3236 /** The name of the header. */
3237 core.String name;
3238
3239 /**
3240 * The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or
3241 * METRIC_CURRENCY.
3242 */
3243 core.String type;
3244
3245
3246 AdsenseReportsGenerateResponseHeaders();
3247
3248 AdsenseReportsGenerateResponseHeaders.fromJson(core.Map _json) {
3249 if (_json.containsKey("currency")) {
3250 currency = _json["currency"];
3251 }
3252 if (_json.containsKey("name")) {
3253 name = _json["name"];
3254 }
3255 if (_json.containsKey("type")) {
3256 type = _json["type"];
3257 }
3258 }
3259
3260 core.Map toJson() {
3261 var _json = new core.Map();
3262 if (currency != null) {
3263 _json["currency"] = currency;
3264 }
3265 if (name != null) {
3266 _json["name"] = name;
3267 }
3268 if (type != null) {
3269 _json["type"] = type;
3270 }
3271 return _json;
3272 }
3273 }
3274
3275
3276 /** Not documented yet. */
3277 class AdsenseReportsGenerateResponse {
3278 /**
3279 * The averages of the report. This is the same length as any other row in the
3280 * report; cells corresponding to dimension columns are empty.
3281 */
3282 core.List<core.String> averages;
3283
3284 /** The requested end date in yyyy-mm-dd format. */
3285 core.String endDate;
3286
3287 /**
3288 * The header information of the columns requested in the report. This is a
3289 * list of headers; one for each dimension in the request, followed by one for
3290 * each metric in the request.
3291 */
3292 core.List<AdsenseReportsGenerateResponseHeaders> headers;
3293
3294 /** Kind this is, in this case adsense#report. */
3295 core.String kind;
3296
3297 /**
3298 * The output rows of the report. Each row is a list of cells; one for each
3299 * dimension in the request, followed by one for each metric in the request.
3300 * The dimension cells contain strings, and the metric cells contain numbers.
3301 */
3302 core.List<core.List<core.String>> rows;
3303
3304 /** The requested start date in yyyy-mm-dd format. */
3305 core.String startDate;
3306
3307 /**
3308 * The total number of rows matched by the report request. Fewer rows may be
3309 * returned in the response due to being limited by the row count requested or
3310 * the report row limit.
3311 */
3312 core.String totalMatchedRows;
3313
3314 /**
3315 * The totals of the report. This is the same length as any other row in the
3316 * report; cells corresponding to dimension columns are empty.
3317 */
3318 core.List<core.String> totals;
3319
3320 /** Any warnings associated with generation of the report. */
3321 core.List<core.String> warnings;
3322
3323
3324 AdsenseReportsGenerateResponse();
3325
3326 AdsenseReportsGenerateResponse.fromJson(core.Map _json) {
3327 if (_json.containsKey("averages")) {
3328 averages = _json["averages"];
3329 }
3330 if (_json.containsKey("endDate")) {
3331 endDate = _json["endDate"];
3332 }
3333 if (_json.containsKey("headers")) {
3334 headers = _json["headers"].map((value) => new AdsenseReportsGenerateRespon seHeaders.fromJson(value)).toList();
3335 }
3336 if (_json.containsKey("kind")) {
3337 kind = _json["kind"];
3338 }
3339 if (_json.containsKey("rows")) {
3340 rows = _json["rows"];
3341 }
3342 if (_json.containsKey("startDate")) {
3343 startDate = _json["startDate"];
3344 }
3345 if (_json.containsKey("totalMatchedRows")) {
3346 totalMatchedRows = _json["totalMatchedRows"];
3347 }
3348 if (_json.containsKey("totals")) {
3349 totals = _json["totals"];
3350 }
3351 if (_json.containsKey("warnings")) {
3352 warnings = _json["warnings"];
3353 }
3354 }
3355
3356 core.Map toJson() {
3357 var _json = new core.Map();
3358 if (averages != null) {
3359 _json["averages"] = averages;
3360 }
3361 if (endDate != null) {
3362 _json["endDate"] = endDate;
3363 }
3364 if (headers != null) {
3365 _json["headers"] = headers.map((value) => (value).toJson()).toList();
3366 }
3367 if (kind != null) {
3368 _json["kind"] = kind;
3369 }
3370 if (rows != null) {
3371 _json["rows"] = rows;
3372 }
3373 if (startDate != null) {
3374 _json["startDate"] = startDate;
3375 }
3376 if (totalMatchedRows != null) {
3377 _json["totalMatchedRows"] = totalMatchedRows;
3378 }
3379 if (totals != null) {
3380 _json["totals"] = totals;
3381 }
3382 if (warnings != null) {
3383 _json["warnings"] = warnings;
3384 }
3385 return _json;
3386 }
3387 }
3388
3389
3390 /** Not documented yet. */
3391 class Alert {
3392 /**
3393 * Unique identifier of this alert. This should be considered an opaque
3394 * identifier; it is not safe to rely on it being in any particular format.
3395 */
3396 core.String id;
3397
3398 /** Whether this alert can be dismissed. */
3399 core.bool isDismissible;
3400
3401 /** Kind of resource this is, in this case adsense#alert. */
3402 core.String kind;
3403
3404 /** The localized alert message. */
3405 core.String message;
3406
3407 /** Severity of this alert. Possible values: INFO, WARNING, SEVERE. */
3408 core.String severity;
3409
3410 /**
3411 * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3,
3412 * ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY,
3413 * GRAYLISTED_PUBLISHER, API_HOLD.
3414 */
3415 core.String type;
3416
3417
3418 Alert();
3419
3420 Alert.fromJson(core.Map _json) {
3421 if (_json.containsKey("id")) {
3422 id = _json["id"];
3423 }
3424 if (_json.containsKey("isDismissible")) {
3425 isDismissible = _json["isDismissible"];
3426 }
3427 if (_json.containsKey("kind")) {
3428 kind = _json["kind"];
3429 }
3430 if (_json.containsKey("message")) {
3431 message = _json["message"];
3432 }
3433 if (_json.containsKey("severity")) {
3434 severity = _json["severity"];
3435 }
3436 if (_json.containsKey("type")) {
3437 type = _json["type"];
3438 }
3439 }
3440
3441 core.Map toJson() {
3442 var _json = new core.Map();
3443 if (id != null) {
3444 _json["id"] = id;
3445 }
3446 if (isDismissible != null) {
3447 _json["isDismissible"] = isDismissible;
3448 }
3449 if (kind != null) {
3450 _json["kind"] = kind;
3451 }
3452 if (message != null) {
3453 _json["message"] = message;
3454 }
3455 if (severity != null) {
3456 _json["severity"] = severity;
3457 }
3458 if (type != null) {
3459 _json["type"] = type;
3460 }
3461 return _json;
3462 }
3463 }
3464
3465
3466 /** Not documented yet. */
3467 class Alerts {
3468 /** The alerts returned in this list response. */
3469 core.List<Alert> items;
3470
3471 /** Kind of list this is, in this case adsense#alerts. */
3472 core.String kind;
3473
3474
3475 Alerts();
3476
3477 Alerts.fromJson(core.Map _json) {
3478 if (_json.containsKey("items")) {
3479 items = _json["items"].map((value) => new Alert.fromJson(value)).toList();
3480 }
3481 if (_json.containsKey("kind")) {
3482 kind = _json["kind"];
3483 }
3484 }
3485
3486 core.Map toJson() {
3487 var _json = new core.Map();
3488 if (items != null) {
3489 _json["items"] = items.map((value) => (value).toJson()).toList();
3490 }
3491 if (kind != null) {
3492 _json["kind"] = kind;
3493 }
3494 return _json;
3495 }
3496 }
3497
3498
3499 /** The targeting information of this custom channel, if activated. */
3500 class CustomChannelTargetingInfo {
3501 /** The name used to describe this channel externally. */
3502 core.String adsAppearOn;
3503
3504 /** The external description of the channel. */
3505 core.String description;
3506
3507 /**
3508 * The locations in which ads appear. (Only valid for content and mobile
3509 * content ads). Acceptable values for content ads are: TOP_LEFT, TOP_CENTER,
3510 * TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT,
3511 * BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for
3512 * mobile content ads are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS.
3513 */
3514 core.String location;
3515
3516 /** The language of the sites ads will be displayed on. */
3517 core.String siteLanguage;
3518
3519
3520 CustomChannelTargetingInfo();
3521
3522 CustomChannelTargetingInfo.fromJson(core.Map _json) {
3523 if (_json.containsKey("adsAppearOn")) {
3524 adsAppearOn = _json["adsAppearOn"];
3525 }
3526 if (_json.containsKey("description")) {
3527 description = _json["description"];
3528 }
3529 if (_json.containsKey("location")) {
3530 location = _json["location"];
3531 }
3532 if (_json.containsKey("siteLanguage")) {
3533 siteLanguage = _json["siteLanguage"];
3534 }
3535 }
3536
3537 core.Map toJson() {
3538 var _json = new core.Map();
3539 if (adsAppearOn != null) {
3540 _json["adsAppearOn"] = adsAppearOn;
3541 }
3542 if (description != null) {
3543 _json["description"] = description;
3544 }
3545 if (location != null) {
3546 _json["location"] = location;
3547 }
3548 if (siteLanguage != null) {
3549 _json["siteLanguage"] = siteLanguage;
3550 }
3551 return _json;
3552 }
3553 }
3554
3555
3556 /** Not documented yet. */
3557 class CustomChannel {
3558 /** Code of this custom channel, not necessarily unique across ad clients. */
3559 core.String code;
3560
3561 /**
3562 * Unique identifier of this custom channel. This should be considered an
3563 * opaque identifier; it is not safe to rely on it being in any particular
3564 * format.
3565 */
3566 core.String id;
3567
3568 /** Kind of resource this is, in this case adsense#customChannel. */
3569 core.String kind;
3570
3571 /** Name of this custom channel. */
3572 core.String name;
3573
3574 /** The targeting information of this custom channel, if activated. */
3575 CustomChannelTargetingInfo targetingInfo;
3576
3577
3578 CustomChannel();
3579
3580 CustomChannel.fromJson(core.Map _json) {
3581 if (_json.containsKey("code")) {
3582 code = _json["code"];
3583 }
3584 if (_json.containsKey("id")) {
3585 id = _json["id"];
3586 }
3587 if (_json.containsKey("kind")) {
3588 kind = _json["kind"];
3589 }
3590 if (_json.containsKey("name")) {
3591 name = _json["name"];
3592 }
3593 if (_json.containsKey("targetingInfo")) {
3594 targetingInfo = new CustomChannelTargetingInfo.fromJson(_json["targetingIn fo"]);
3595 }
3596 }
3597
3598 core.Map toJson() {
3599 var _json = new core.Map();
3600 if (code != null) {
3601 _json["code"] = code;
3602 }
3603 if (id != null) {
3604 _json["id"] = id;
3605 }
3606 if (kind != null) {
3607 _json["kind"] = kind;
3608 }
3609 if (name != null) {
3610 _json["name"] = name;
3611 }
3612 if (targetingInfo != null) {
3613 _json["targetingInfo"] = (targetingInfo).toJson();
3614 }
3615 return _json;
3616 }
3617 }
3618
3619
3620 /** Not documented yet. */
3621 class CustomChannels {
3622 /** ETag of this response for caching purposes. */
3623 core.String etag;
3624
3625 /** The custom channels returned in this list response. */
3626 core.List<CustomChannel> items;
3627
3628 /** Kind of list this is, in this case adsense#customChannels. */
3629 core.String kind;
3630
3631 /**
3632 * Continuation token used to page through custom channels. To retrieve the
3633 * next page of results, set the next request's "pageToken" value to this.
3634 */
3635 core.String nextPageToken;
3636
3637
3638 CustomChannels();
3639
3640 CustomChannels.fromJson(core.Map _json) {
3641 if (_json.containsKey("etag")) {
3642 etag = _json["etag"];
3643 }
3644 if (_json.containsKey("items")) {
3645 items = _json["items"].map((value) => new CustomChannel.fromJson(value)).t oList();
3646 }
3647 if (_json.containsKey("kind")) {
3648 kind = _json["kind"];
3649 }
3650 if (_json.containsKey("nextPageToken")) {
3651 nextPageToken = _json["nextPageToken"];
3652 }
3653 }
3654
3655 core.Map toJson() {
3656 var _json = new core.Map();
3657 if (etag != null) {
3658 _json["etag"] = etag;
3659 }
3660 if (items != null) {
3661 _json["items"] = items.map((value) => (value).toJson()).toList();
3662 }
3663 if (kind != null) {
3664 _json["kind"] = kind;
3665 }
3666 if (nextPageToken != null) {
3667 _json["nextPageToken"] = nextPageToken;
3668 }
3669 return _json;
3670 }
3671 }
3672
3673
3674 /** Not documented yet. */
3675 class Metadata {
3676 /** Not documented yet. */
3677 core.List<ReportingMetadataEntry> items;
3678
3679 /** Kind of list this is, in this case adsense#metadata. */
3680 core.String kind;
3681
3682
3683 Metadata();
3684
3685 Metadata.fromJson(core.Map _json) {
3686 if (_json.containsKey("items")) {
3687 items = _json["items"].map((value) => new ReportingMetadataEntry.fromJson( value)).toList();
3688 }
3689 if (_json.containsKey("kind")) {
3690 kind = _json["kind"];
3691 }
3692 }
3693
3694 core.Map toJson() {
3695 var _json = new core.Map();
3696 if (items != null) {
3697 _json["items"] = items.map((value) => (value).toJson()).toList();
3698 }
3699 if (kind != null) {
3700 _json["kind"] = kind;
3701 }
3702 return _json;
3703 }
3704 }
3705
3706
3707 /** Not documented yet. */
3708 class Payment {
3709 /** Unique identifier of this Payment. */
3710 core.String id;
3711
3712 /** Kind of resource this is, in this case adsense#payment. */
3713 core.String kind;
3714
3715 /** The amount to be paid. */
3716 core.String paymentAmount;
3717
3718 /** The currency code for the amount to be paid. */
3719 core.String paymentAmountCurrencyCode;
3720
3721 /**
3722 * The date this payment was/will be credited to the user, or none if the
3723 * payment threshold has not been met.
3724 */
3725 core.String paymentDate;
3726
3727
3728 Payment();
3729
3730 Payment.fromJson(core.Map _json) {
3731 if (_json.containsKey("id")) {
3732 id = _json["id"];
3733 }
3734 if (_json.containsKey("kind")) {
3735 kind = _json["kind"];
3736 }
3737 if (_json.containsKey("paymentAmount")) {
3738 paymentAmount = _json["paymentAmount"];
3739 }
3740 if (_json.containsKey("paymentAmountCurrencyCode")) {
3741 paymentAmountCurrencyCode = _json["paymentAmountCurrencyCode"];
3742 }
3743 if (_json.containsKey("paymentDate")) {
3744 paymentDate = _json["paymentDate"];
3745 }
3746 }
3747
3748 core.Map toJson() {
3749 var _json = new core.Map();
3750 if (id != null) {
3751 _json["id"] = id;
3752 }
3753 if (kind != null) {
3754 _json["kind"] = kind;
3755 }
3756 if (paymentAmount != null) {
3757 _json["paymentAmount"] = paymentAmount;
3758 }
3759 if (paymentAmountCurrencyCode != null) {
3760 _json["paymentAmountCurrencyCode"] = paymentAmountCurrencyCode;
3761 }
3762 if (paymentDate != null) {
3763 _json["paymentDate"] = paymentDate;
3764 }
3765 return _json;
3766 }
3767 }
3768
3769
3770 /** Not documented yet. */
3771 class Payments {
3772 /**
3773 * The list of Payments for the account. One or both of a) the account's most
3774 * recent payment; and b) the account's upcoming payment.
3775 */
3776 core.List<Payment> items;
3777
3778 /** Kind of list this is, in this case adsense#payments. */
3779 core.String kind;
3780
3781
3782 Payments();
3783
3784 Payments.fromJson(core.Map _json) {
3785 if (_json.containsKey("items")) {
3786 items = _json["items"].map((value) => new Payment.fromJson(value)).toList( );
3787 }
3788 if (_json.containsKey("kind")) {
3789 kind = _json["kind"];
3790 }
3791 }
3792
3793 core.Map toJson() {
3794 var _json = new core.Map();
3795 if (items != null) {
3796 _json["items"] = items.map((value) => (value).toJson()).toList();
3797 }
3798 if (kind != null) {
3799 _json["kind"] = kind;
3800 }
3801 return _json;
3802 }
3803 }
3804
3805
3806 /** Not documented yet. */
3807 class ReportingMetadataEntry {
3808 /**
3809 * For metrics this is a list of dimension IDs which the metric is compatible
3810 * with, for dimensions it is a list of compatibility groups the dimension
3811 * belongs to.
3812 */
3813 core.List<core.String> compatibleDimensions;
3814
3815 /**
3816 * The names of the metrics the dimension or metric this reporting metadata
3817 * entry describes is compatible with.
3818 */
3819 core.List<core.String> compatibleMetrics;
3820
3821 /**
3822 * Unique identifier of this reporting metadata entry, corresponding to the
3823 * name of the appropriate dimension or metric.
3824 */
3825 core.String id;
3826
3827 /** Kind of resource this is, in this case adsense#reportingMetadataEntry. */
3828 core.String kind;
3829
3830 /**
3831 * The names of the dimensions which the dimension or metric this reporting
3832 * metadata entry describes requires to also be present in order for the
3833 * report to be valid. Omitting these will not cause an error or warning, but
3834 * may result in data which cannot be correctly interpreted.
3835 */
3836 core.List<core.String> requiredDimensions;
3837
3838 /**
3839 * The names of the metrics which the dimension or metric this reporting
3840 * metadata entry describes requires to also be present in order for the
3841 * report to be valid. Omitting these will not cause an error or warning, but
3842 * may result in data which cannot be correctly interpreted.
3843 */
3844 core.List<core.String> requiredMetrics;
3845
3846 /**
3847 * The codes of the projects supported by the dimension or metric this
3848 * reporting metadata entry describes.
3849 */
3850 core.List<core.String> supportedProducts;
3851
3852
3853 ReportingMetadataEntry();
3854
3855 ReportingMetadataEntry.fromJson(core.Map _json) {
3856 if (_json.containsKey("compatibleDimensions")) {
3857 compatibleDimensions = _json["compatibleDimensions"];
3858 }
3859 if (_json.containsKey("compatibleMetrics")) {
3860 compatibleMetrics = _json["compatibleMetrics"];
3861 }
3862 if (_json.containsKey("id")) {
3863 id = _json["id"];
3864 }
3865 if (_json.containsKey("kind")) {
3866 kind = _json["kind"];
3867 }
3868 if (_json.containsKey("requiredDimensions")) {
3869 requiredDimensions = _json["requiredDimensions"];
3870 }
3871 if (_json.containsKey("requiredMetrics")) {
3872 requiredMetrics = _json["requiredMetrics"];
3873 }
3874 if (_json.containsKey("supportedProducts")) {
3875 supportedProducts = _json["supportedProducts"];
3876 }
3877 }
3878
3879 core.Map toJson() {
3880 var _json = new core.Map();
3881 if (compatibleDimensions != null) {
3882 _json["compatibleDimensions"] = compatibleDimensions;
3883 }
3884 if (compatibleMetrics != null) {
3885 _json["compatibleMetrics"] = compatibleMetrics;
3886 }
3887 if (id != null) {
3888 _json["id"] = id;
3889 }
3890 if (kind != null) {
3891 _json["kind"] = kind;
3892 }
3893 if (requiredDimensions != null) {
3894 _json["requiredDimensions"] = requiredDimensions;
3895 }
3896 if (requiredMetrics != null) {
3897 _json["requiredMetrics"] = requiredMetrics;
3898 }
3899 if (supportedProducts != null) {
3900 _json["supportedProducts"] = supportedProducts;
3901 }
3902 return _json;
3903 }
3904 }
3905
3906
3907 /** Not documented yet. */
3908 class SavedAdStyle {
3909 /** The AdStyle itself. */
3910 AdStyle adStyle;
3911
3912 /**
3913 * Unique identifier of this saved ad style. This should be considered an
3914 * opaque identifier; it is not safe to rely on it being in any particular
3915 * format.
3916 */
3917 core.String id;
3918
3919 /** Kind of resource this is, in this case adsense#savedAdStyle. */
3920 core.String kind;
3921
3922 /** The user selected name of this SavedAdStyle. */
3923 core.String name;
3924
3925
3926 SavedAdStyle();
3927
3928 SavedAdStyle.fromJson(core.Map _json) {
3929 if (_json.containsKey("adStyle")) {
3930 adStyle = new AdStyle.fromJson(_json["adStyle"]);
3931 }
3932 if (_json.containsKey("id")) {
3933 id = _json["id"];
3934 }
3935 if (_json.containsKey("kind")) {
3936 kind = _json["kind"];
3937 }
3938 if (_json.containsKey("name")) {
3939 name = _json["name"];
3940 }
3941 }
3942
3943 core.Map toJson() {
3944 var _json = new core.Map();
3945 if (adStyle != null) {
3946 _json["adStyle"] = (adStyle).toJson();
3947 }
3948 if (id != null) {
3949 _json["id"] = id;
3950 }
3951 if (kind != null) {
3952 _json["kind"] = kind;
3953 }
3954 if (name != null) {
3955 _json["name"] = name;
3956 }
3957 return _json;
3958 }
3959 }
3960
3961
3962 /** Not documented yet. */
3963 class SavedAdStyles {
3964 /** ETag of this response for caching purposes. */
3965 core.String etag;
3966
3967 /** The saved ad styles returned in this list response. */
3968 core.List<SavedAdStyle> items;
3969
3970 /** Kind of list this is, in this case adsense#savedAdStyles. */
3971 core.String kind;
3972
3973 /**
3974 * Continuation token used to page through ad units. To retrieve the next page
3975 * of results, set the next request's "pageToken" value to this.
3976 */
3977 core.String nextPageToken;
3978
3979
3980 SavedAdStyles();
3981
3982 SavedAdStyles.fromJson(core.Map _json) {
3983 if (_json.containsKey("etag")) {
3984 etag = _json["etag"];
3985 }
3986 if (_json.containsKey("items")) {
3987 items = _json["items"].map((value) => new SavedAdStyle.fromJson(value)).to List();
3988 }
3989 if (_json.containsKey("kind")) {
3990 kind = _json["kind"];
3991 }
3992 if (_json.containsKey("nextPageToken")) {
3993 nextPageToken = _json["nextPageToken"];
3994 }
3995 }
3996
3997 core.Map toJson() {
3998 var _json = new core.Map();
3999 if (etag != null) {
4000 _json["etag"] = etag;
4001 }
4002 if (items != null) {
4003 _json["items"] = items.map((value) => (value).toJson()).toList();
4004 }
4005 if (kind != null) {
4006 _json["kind"] = kind;
4007 }
4008 if (nextPageToken != null) {
4009 _json["nextPageToken"] = nextPageToken;
4010 }
4011 return _json;
4012 }
4013 }
4014
4015
4016 /** Not documented yet. */
4017 class SavedReport {
4018 /** Unique identifier of this saved report. */
4019 core.String id;
4020
4021 /** Kind of resource this is, in this case adsense#savedReport. */
4022 core.String kind;
4023
4024 /** This saved report's name. */
4025 core.String name;
4026
4027
4028 SavedReport();
4029
4030 SavedReport.fromJson(core.Map _json) {
4031 if (_json.containsKey("id")) {
4032 id = _json["id"];
4033 }
4034 if (_json.containsKey("kind")) {
4035 kind = _json["kind"];
4036 }
4037 if (_json.containsKey("name")) {
4038 name = _json["name"];
4039 }
4040 }
4041
4042 core.Map toJson() {
4043 var _json = new core.Map();
4044 if (id != null) {
4045 _json["id"] = id;
4046 }
4047 if (kind != null) {
4048 _json["kind"] = kind;
4049 }
4050 if (name != null) {
4051 _json["name"] = name;
4052 }
4053 return _json;
4054 }
4055 }
4056
4057
4058 /** Not documented yet. */
4059 class SavedReports {
4060 /** ETag of this response for caching purposes. */
4061 core.String etag;
4062
4063 /** The saved reports returned in this list response. */
4064 core.List<SavedReport> items;
4065
4066 /** Kind of list this is, in this case adsense#savedReports. */
4067 core.String kind;
4068
4069 /**
4070 * Continuation token used to page through saved reports. To retrieve the next
4071 * page of results, set the next request's "pageToken" value to this.
4072 */
4073 core.String nextPageToken;
4074
4075
4076 SavedReports();
4077
4078 SavedReports.fromJson(core.Map _json) {
4079 if (_json.containsKey("etag")) {
4080 etag = _json["etag"];
4081 }
4082 if (_json.containsKey("items")) {
4083 items = _json["items"].map((value) => new SavedReport.fromJson(value)).toL ist();
4084 }
4085 if (_json.containsKey("kind")) {
4086 kind = _json["kind"];
4087 }
4088 if (_json.containsKey("nextPageToken")) {
4089 nextPageToken = _json["nextPageToken"];
4090 }
4091 }
4092
4093 core.Map toJson() {
4094 var _json = new core.Map();
4095 if (etag != null) {
4096 _json["etag"] = etag;
4097 }
4098 if (items != null) {
4099 _json["items"] = items.map((value) => (value).toJson()).toList();
4100 }
4101 if (kind != null) {
4102 _json["kind"] = kind;
4103 }
4104 if (nextPageToken != null) {
4105 _json["nextPageToken"] = nextPageToken;
4106 }
4107 return _json;
4108 }
4109 }
4110
4111
4112 /** Not documented yet. */
4113 class UrlChannel {
4114 /**
4115 * Unique identifier of this URL channel. This should be considered an opaque
4116 * identifier; it is not safe to rely on it being in any particular format.
4117 */
4118 core.String id;
4119
4120 /** Kind of resource this is, in this case adsense#urlChannel. */
4121 core.String kind;
4122
4123 /**
4124 * URL Pattern of this URL channel. Does not include "http://" or "https://".
4125 * Example: www.example.com/home
4126 */
4127 core.String urlPattern;
4128
4129
4130 UrlChannel();
4131
4132 UrlChannel.fromJson(core.Map _json) {
4133 if (_json.containsKey("id")) {
4134 id = _json["id"];
4135 }
4136 if (_json.containsKey("kind")) {
4137 kind = _json["kind"];
4138 }
4139 if (_json.containsKey("urlPattern")) {
4140 urlPattern = _json["urlPattern"];
4141 }
4142 }
4143
4144 core.Map toJson() {
4145 var _json = new core.Map();
4146 if (id != null) {
4147 _json["id"] = id;
4148 }
4149 if (kind != null) {
4150 _json["kind"] = kind;
4151 }
4152 if (urlPattern != null) {
4153 _json["urlPattern"] = urlPattern;
4154 }
4155 return _json;
4156 }
4157 }
4158
4159
4160 /** Not documented yet. */
4161 class UrlChannels {
4162 /** ETag of this response for caching purposes. */
4163 core.String etag;
4164
4165 /** The URL channels returned in this list response. */
4166 core.List<UrlChannel> items;
4167
4168 /** Kind of list this is, in this case adsense#urlChannels. */
4169 core.String kind;
4170
4171 /**
4172 * Continuation token used to page through URL channels. To retrieve the next
4173 * page of results, set the next request's "pageToken" value to this.
4174 */
4175 core.String nextPageToken;
4176
4177
4178 UrlChannels();
4179
4180 UrlChannels.fromJson(core.Map _json) {
4181 if (_json.containsKey("etag")) {
4182 etag = _json["etag"];
4183 }
4184 if (_json.containsKey("items")) {
4185 items = _json["items"].map((value) => new UrlChannel.fromJson(value)).toLi st();
4186 }
4187 if (_json.containsKey("kind")) {
4188 kind = _json["kind"];
4189 }
4190 if (_json.containsKey("nextPageToken")) {
4191 nextPageToken = _json["nextPageToken"];
4192 }
4193 }
4194
4195 core.Map toJson() {
4196 var _json = new core.Map();
4197 if (etag != null) {
4198 _json["etag"] = etag;
4199 }
4200 if (items != null) {
4201 _json["items"] = items.map((value) => (value).toJson()).toList();
4202 }
4203 if (kind != null) {
4204 _json["kind"] = kind;
4205 }
4206 if (nextPageToken != null) {
4207 _json["nextPageToken"] = nextPageToken;
4208 }
4209 return _json;
4210 }
4211 }
4212
4213
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698