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

Side by Side Diff: generated/googleapis/lib/adsensehost/v4_1.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.adsensehost.v4_1;
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 Hosts access to report generation, ad code generation, and
18 * publisher management capabilities.
19 */
20 class AdsensehostApi {
21 /** View and manage your AdSense host data and associated accounts */
22 static const AdsensehostScope = "https://www.googleapis.com/auth/adsensehost";
23
24
25 final common_internal.ApiRequester _requester;
26
27 AccountsResourceApi get accounts => new AccountsResourceApi(_requester);
28 AdclientsResourceApi get adclients => new AdclientsResourceApi(_requester);
29 AssociationsessionsResourceApi get associationsessions => new Associationsessi onsResourceApi(_requester);
30 CustomchannelsResourceApi get customchannels => new CustomchannelsResourceApi( _requester);
31 ReportsResourceApi get reports => new ReportsResourceApi(_requester);
32 UrlchannelsResourceApi get urlchannels => new UrlchannelsResourceApi(_requeste r);
33
34 AdsensehostApi(http.Client client) :
35 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/adsensehost/v4.1/");
36 }
37
38
39 /** Not documented yet. */
40 class AccountsResourceApi {
41 final common_internal.ApiRequester _requester;
42
43 AccountsAdclientsResourceApi get adclients => new AccountsAdclientsResourceApi (_requester);
44 AccountsAdunitsResourceApi get adunits => new AccountsAdunitsResourceApi(_requ ester);
45 AccountsReportsResourceApi get reports => new AccountsReportsResourceApi(_requ ester);
46
47 AccountsResourceApi(common_internal.ApiRequester client) :
48 _requester = client;
49
50 /**
51 * Get information about the selected associated AdSense account.
52 *
53 * Request parameters:
54 *
55 * [accountId] - Account to get information about.
56 *
57 * Completes with a [Account].
58 *
59 * Completes with a [common.ApiRequestError] if the API endpoint returned an
60 * error.
61 *
62 * If the used [http.Client] completes with an error when making a REST call,
63 * this method will complete with the same error.
64 */
65 async.Future<Account> get(core.String accountId) {
66 var _url = null;
67 var _queryParams = new core.Map();
68 var _uploadMedia = null;
69 var _uploadOptions = null;
70 var _downloadOptions = common.DownloadOptions.Metadata;
71 var _body = null;
72
73 if (accountId == null) {
74 throw new core.ArgumentError("Parameter accountId is required.");
75 }
76
77
78 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId');
79
80 var _response = _requester.request(_url,
81 "GET",
82 body: _body,
83 queryParams: _queryParams,
84 uploadOptions: _uploadOptions,
85 uploadMedia: _uploadMedia,
86 downloadOptions: _downloadOptions);
87 return _response.then((data) => new Account.fromJson(data));
88 }
89
90 /**
91 * List hosted accounts associated with this AdSense account by ad client id.
92 *
93 * Request parameters:
94 *
95 * [filterAdClientId] - Ad clients to list accounts for.
96 *
97 * Completes with a [Accounts].
98 *
99 * Completes with a [common.ApiRequestError] if the API endpoint returned an
100 * error.
101 *
102 * If the used [http.Client] completes with an error when making a REST call,
103 * this method will complete with the same error.
104 */
105 async.Future<Accounts> list(core.List<core.String> filterAdClientId) {
106 var _url = null;
107 var _queryParams = new core.Map();
108 var _uploadMedia = null;
109 var _uploadOptions = null;
110 var _downloadOptions = common.DownloadOptions.Metadata;
111 var _body = null;
112
113 if (filterAdClientId == null || filterAdClientId.isEmpty) {
114 throw new core.ArgumentError("Parameter filterAdClientId is required.");
115 }
116 _queryParams["filterAdClientId"] = filterAdClientId;
117
118
119 _url = 'accounts';
120
121 var _response = _requester.request(_url,
122 "GET",
123 body: _body,
124 queryParams: _queryParams,
125 uploadOptions: _uploadOptions,
126 uploadMedia: _uploadMedia,
127 downloadOptions: _downloadOptions);
128 return _response.then((data) => new Accounts.fromJson(data));
129 }
130
131 }
132
133
134 /** Not documented yet. */
135 class AccountsAdclientsResourceApi {
136 final common_internal.ApiRequester _requester;
137
138 AccountsAdclientsResourceApi(common_internal.ApiRequester client) :
139 _requester = client;
140
141 /**
142 * Get information about one of the ad clients in the specified publisher's
143 * AdSense account.
144 *
145 * Request parameters:
146 *
147 * [accountId] - Account which contains the ad client.
148 *
149 * [adClientId] - Ad client to get.
150 *
151 * Completes with a [AdClient].
152 *
153 * Completes with a [common.ApiRequestError] if the API endpoint returned an
154 * error.
155 *
156 * If the used [http.Client] completes with an error when making a REST call,
157 * this method will complete with the same error.
158 */
159 async.Future<AdClient> get(core.String accountId, core.String adClientId) {
160 var _url = null;
161 var _queryParams = new core.Map();
162 var _uploadMedia = null;
163 var _uploadOptions = null;
164 var _downloadOptions = common.DownloadOptions.Metadata;
165 var _body = null;
166
167 if (accountId == null) {
168 throw new core.ArgumentError("Parameter accountId is required.");
169 }
170 if (adClientId == null) {
171 throw new core.ArgumentError("Parameter adClientId is required.");
172 }
173
174
175 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId');
176
177 var _response = _requester.request(_url,
178 "GET",
179 body: _body,
180 queryParams: _queryParams,
181 uploadOptions: _uploadOptions,
182 uploadMedia: _uploadMedia,
183 downloadOptions: _downloadOptions);
184 return _response.then((data) => new AdClient.fromJson(data));
185 }
186
187 /**
188 * List all hosted ad clients in the specified hosted account.
189 *
190 * Request parameters:
191 *
192 * [accountId] - Account for which to list ad clients.
193 *
194 * [maxResults] - The maximum number of ad clients to include in the response,
195 * used for paging.
196 * Value must be between "0" and "10000".
197 *
198 * [pageToken] - A continuation token, used to page through ad clients. To
199 * retrieve the next page, set this parameter to the value of "nextPageToken"
200 * from the previous response.
201 *
202 * Completes with a [AdClients].
203 *
204 * Completes with a [common.ApiRequestError] if the API endpoint returned an
205 * error.
206 *
207 * If the used [http.Client] completes with an error when making a REST call,
208 * this method will complete with the same error.
209 */
210 async.Future<AdClients> list(core.String accountId, {core.int maxResults, core .String pageToken}) {
211 var _url = null;
212 var _queryParams = new core.Map();
213 var _uploadMedia = null;
214 var _uploadOptions = null;
215 var _downloadOptions = common.DownloadOptions.Metadata;
216 var _body = null;
217
218 if (accountId == null) {
219 throw new core.ArgumentError("Parameter accountId is required.");
220 }
221 if (maxResults != null) {
222 _queryParams["maxResults"] = ["${maxResults}"];
223 }
224 if (pageToken != null) {
225 _queryParams["pageToken"] = [pageToken];
226 }
227
228
229 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients';
230
231 var _response = _requester.request(_url,
232 "GET",
233 body: _body,
234 queryParams: _queryParams,
235 uploadOptions: _uploadOptions,
236 uploadMedia: _uploadMedia,
237 downloadOptions: _downloadOptions);
238 return _response.then((data) => new AdClients.fromJson(data));
239 }
240
241 }
242
243
244 /** Not documented yet. */
245 class AccountsAdunitsResourceApi {
246 final common_internal.ApiRequester _requester;
247
248 AccountsAdunitsResourceApi(common_internal.ApiRequester client) :
249 _requester = client;
250
251 /**
252 * Delete the specified ad unit from the specified publisher AdSense account.
253 *
254 * Request parameters:
255 *
256 * [accountId] - Account which contains the ad unit.
257 *
258 * [adClientId] - Ad client for which to get ad unit.
259 *
260 * [adUnitId] - Ad unit to delete.
261 *
262 * Completes with a [AdUnit].
263 *
264 * Completes with a [common.ApiRequestError] if the API endpoint returned an
265 * error.
266 *
267 * If the used [http.Client] completes with an error when making a REST call,
268 * this method will complete with the same error.
269 */
270 async.Future<AdUnit> delete(core.String accountId, core.String adClientId, cor e.String adUnitId) {
271 var _url = null;
272 var _queryParams = new core.Map();
273 var _uploadMedia = null;
274 var _uploadOptions = null;
275 var _downloadOptions = common.DownloadOptions.Metadata;
276 var _body = null;
277
278 if (accountId == null) {
279 throw new core.ArgumentError("Parameter accountId is required.");
280 }
281 if (adClientId == null) {
282 throw new core.ArgumentError("Parameter adClientId is required.");
283 }
284 if (adUnitId == null) {
285 throw new core.ArgumentError("Parameter adUnitId is required.");
286 }
287
288
289 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/ ' + common_internal.Escaper.ecapeVariable('$adUnitId');
290
291 var _response = _requester.request(_url,
292 "DELETE",
293 body: _body,
294 queryParams: _queryParams,
295 uploadOptions: _uploadOptions,
296 uploadMedia: _uploadMedia,
297 downloadOptions: _downloadOptions);
298 return _response.then((data) => new AdUnit.fromJson(data));
299 }
300
301 /**
302 * Get the specified host ad unit in this AdSense account.
303 *
304 * Request parameters:
305 *
306 * [accountId] - Account which contains the ad unit.
307 *
308 * [adClientId] - Ad client for which to get ad unit.
309 *
310 * [adUnitId] - Ad unit to get.
311 *
312 * Completes with a [AdUnit].
313 *
314 * Completes with a [common.ApiRequestError] if the API endpoint returned an
315 * error.
316 *
317 * If the used [http.Client] completes with an error when making a REST call,
318 * this method will complete with the same error.
319 */
320 async.Future<AdUnit> get(core.String accountId, core.String adClientId, core.S tring adUnitId) {
321 var _url = null;
322 var _queryParams = new core.Map();
323 var _uploadMedia = null;
324 var _uploadOptions = null;
325 var _downloadOptions = common.DownloadOptions.Metadata;
326 var _body = null;
327
328 if (accountId == null) {
329 throw new core.ArgumentError("Parameter accountId is required.");
330 }
331 if (adClientId == null) {
332 throw new core.ArgumentError("Parameter adClientId is required.");
333 }
334 if (adUnitId == null) {
335 throw new core.ArgumentError("Parameter adUnitId is required.");
336 }
337
338
339 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/ ' + common_internal.Escaper.ecapeVariable('$adUnitId');
340
341 var _response = _requester.request(_url,
342 "GET",
343 body: _body,
344 queryParams: _queryParams,
345 uploadOptions: _uploadOptions,
346 uploadMedia: _uploadMedia,
347 downloadOptions: _downloadOptions);
348 return _response.then((data) => new AdUnit.fromJson(data));
349 }
350
351 /**
352 * Get ad code for the specified ad unit, attaching the specified host custom
353 * channels.
354 *
355 * Request parameters:
356 *
357 * [accountId] - Account which contains the ad client.
358 *
359 * [adClientId] - Ad client with contains the ad unit.
360 *
361 * [adUnitId] - Ad unit to get the code for.
362 *
363 * [hostCustomChannelId] - Host custom channel to attach to the ad code.
364 *
365 * Completes with a [AdCode].
366 *
367 * Completes with a [common.ApiRequestError] if the API endpoint returned an
368 * error.
369 *
370 * If the used [http.Client] completes with an error when making a REST call,
371 * this method will complete with the same error.
372 */
373 async.Future<AdCode> getAdCode(core.String accountId, core.String adClientId, core.String adUnitId, {core.List<core.String> hostCustomChannelId}) {
374 var _url = null;
375 var _queryParams = new core.Map();
376 var _uploadMedia = null;
377 var _uploadOptions = null;
378 var _downloadOptions = common.DownloadOptions.Metadata;
379 var _body = null;
380
381 if (accountId == null) {
382 throw new core.ArgumentError("Parameter accountId is required.");
383 }
384 if (adClientId == null) {
385 throw new core.ArgumentError("Parameter adClientId is required.");
386 }
387 if (adUnitId == null) {
388 throw new core.ArgumentError("Parameter adUnitId is required.");
389 }
390 if (hostCustomChannelId != null) {
391 _queryParams["hostCustomChannelId"] = hostCustomChannelId;
392 }
393
394
395 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/ ' + common_internal.Escaper.ecapeVariable('$adUnitId') + '/adcode';
396
397 var _response = _requester.request(_url,
398 "GET",
399 body: _body,
400 queryParams: _queryParams,
401 uploadOptions: _uploadOptions,
402 uploadMedia: _uploadMedia,
403 downloadOptions: _downloadOptions);
404 return _response.then((data) => new AdCode.fromJson(data));
405 }
406
407 /**
408 * Insert the supplied ad unit into the specified publisher AdSense account.
409 *
410 * [request] - The metadata request object.
411 *
412 * Request parameters:
413 *
414 * [accountId] - Account which will contain the ad unit.
415 *
416 * [adClientId] - Ad client into which to insert the ad unit.
417 *
418 * Completes with a [AdUnit].
419 *
420 * Completes with a [common.ApiRequestError] if the API endpoint returned an
421 * error.
422 *
423 * If the used [http.Client] completes with an error when making a REST call,
424 * this method will complete with the same error.
425 */
426 async.Future<AdUnit> insert(AdUnit request, core.String accountId, core.String adClientId) {
427 var _url = null;
428 var _queryParams = new core.Map();
429 var _uploadMedia = null;
430 var _uploadOptions = null;
431 var _downloadOptions = common.DownloadOptions.Metadata;
432 var _body = null;
433
434 if (request != null) {
435 _body = convert.JSON.encode((request).toJson());
436 }
437 if (accountId == null) {
438 throw new core.ArgumentError("Parameter accountId is required.");
439 }
440 if (adClientId == null) {
441 throw new core.ArgumentError("Parameter adClientId is required.");
442 }
443
444
445 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits' ;
446
447 var _response = _requester.request(_url,
448 "POST",
449 body: _body,
450 queryParams: _queryParams,
451 uploadOptions: _uploadOptions,
452 uploadMedia: _uploadMedia,
453 downloadOptions: _downloadOptions);
454 return _response.then((data) => new AdUnit.fromJson(data));
455 }
456
457 /**
458 * List all ad units in the specified publisher's AdSense account.
459 *
460 * Request parameters:
461 *
462 * [accountId] - Account which contains the ad client.
463 *
464 * [adClientId] - Ad client for which to list ad units.
465 *
466 * [includeInactive] - Whether to include inactive ad units. Default: true.
467 *
468 * [maxResults] - The maximum number of ad units to include in the response,
469 * used for paging.
470 * Value must be between "0" and "10000".
471 *
472 * [pageToken] - A continuation token, used to page through ad units. To
473 * retrieve the next page, set this parameter to the value of "nextPageToken"
474 * from the previous response.
475 *
476 * Completes with a [AdUnits].
477 *
478 * Completes with a [common.ApiRequestError] if the API endpoint returned an
479 * error.
480 *
481 * If the used [http.Client] completes with an error when making a REST call,
482 * this method will complete with the same error.
483 */
484 async.Future<AdUnits> list(core.String accountId, core.String adClientId, {cor e.bool includeInactive, core.int maxResults, core.String pageToken}) {
485 var _url = null;
486 var _queryParams = new core.Map();
487 var _uploadMedia = null;
488 var _uploadOptions = null;
489 var _downloadOptions = common.DownloadOptions.Metadata;
490 var _body = null;
491
492 if (accountId == null) {
493 throw new core.ArgumentError("Parameter accountId is required.");
494 }
495 if (adClientId == null) {
496 throw new core.ArgumentError("Parameter adClientId is required.");
497 }
498 if (includeInactive != null) {
499 _queryParams["includeInactive"] = ["${includeInactive}"];
500 }
501 if (maxResults != null) {
502 _queryParams["maxResults"] = ["${maxResults}"];
503 }
504 if (pageToken != null) {
505 _queryParams["pageToken"] = [pageToken];
506 }
507
508
509 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits' ;
510
511 var _response = _requester.request(_url,
512 "GET",
513 body: _body,
514 queryParams: _queryParams,
515 uploadOptions: _uploadOptions,
516 uploadMedia: _uploadMedia,
517 downloadOptions: _downloadOptions);
518 return _response.then((data) => new AdUnits.fromJson(data));
519 }
520
521 /**
522 * Update the supplied ad unit in the specified publisher AdSense account.
523 * This method supports patch semantics.
524 *
525 * [request] - The metadata request object.
526 *
527 * Request parameters:
528 *
529 * [accountId] - Account which contains the ad client.
530 *
531 * [adClientId] - Ad client which contains the ad unit.
532 *
533 * [adUnitId] - Ad unit to get.
534 *
535 * Completes with a [AdUnit].
536 *
537 * Completes with a [common.ApiRequestError] if the API endpoint returned an
538 * error.
539 *
540 * If the used [http.Client] completes with an error when making a REST call,
541 * this method will complete with the same error.
542 */
543 async.Future<AdUnit> patch(AdUnit request, core.String accountId, core.String adClientId, core.String adUnitId) {
544 var _url = null;
545 var _queryParams = new core.Map();
546 var _uploadMedia = null;
547 var _uploadOptions = null;
548 var _downloadOptions = common.DownloadOptions.Metadata;
549 var _body = null;
550
551 if (request != null) {
552 _body = convert.JSON.encode((request).toJson());
553 }
554 if (accountId == null) {
555 throw new core.ArgumentError("Parameter accountId is required.");
556 }
557 if (adClientId == null) {
558 throw new core.ArgumentError("Parameter adClientId is required.");
559 }
560 if (adUnitId == null) {
561 throw new core.ArgumentError("Parameter adUnitId is required.");
562 }
563 _queryParams["adUnitId"] = [adUnitId];
564
565
566 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits' ;
567
568 var _response = _requester.request(_url,
569 "PATCH",
570 body: _body,
571 queryParams: _queryParams,
572 uploadOptions: _uploadOptions,
573 uploadMedia: _uploadMedia,
574 downloadOptions: _downloadOptions);
575 return _response.then((data) => new AdUnit.fromJson(data));
576 }
577
578 /**
579 * Update the supplied ad unit in the specified publisher AdSense account.
580 *
581 * [request] - The metadata request object.
582 *
583 * Request parameters:
584 *
585 * [accountId] - Account which contains the ad client.
586 *
587 * [adClientId] - Ad client which contains the ad unit.
588 *
589 * Completes with a [AdUnit].
590 *
591 * Completes with a [common.ApiRequestError] if the API endpoint returned an
592 * error.
593 *
594 * If the used [http.Client] completes with an error when making a REST call,
595 * this method will complete with the same error.
596 */
597 async.Future<AdUnit> update(AdUnit request, core.String accountId, core.String adClientId) {
598 var _url = null;
599 var _queryParams = new core.Map();
600 var _uploadMedia = null;
601 var _uploadOptions = null;
602 var _downloadOptions = common.DownloadOptions.Metadata;
603 var _body = null;
604
605 if (request != null) {
606 _body = convert.JSON.encode((request).toJson());
607 }
608 if (accountId == null) {
609 throw new core.ArgumentError("Parameter accountId is required.");
610 }
611 if (adClientId == null) {
612 throw new core.ArgumentError("Parameter adClientId is required.");
613 }
614
615
616 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits' ;
617
618 var _response = _requester.request(_url,
619 "PUT",
620 body: _body,
621 queryParams: _queryParams,
622 uploadOptions: _uploadOptions,
623 uploadMedia: _uploadMedia,
624 downloadOptions: _downloadOptions);
625 return _response.then((data) => new AdUnit.fromJson(data));
626 }
627
628 }
629
630
631 /** Not documented yet. */
632 class AccountsReportsResourceApi {
633 final common_internal.ApiRequester _requester;
634
635 AccountsReportsResourceApi(common_internal.ApiRequester client) :
636 _requester = client;
637
638 /**
639 * Generate an AdSense report based on the report request sent in the query
640 * parameters. Returns the result as JSON; to retrieve output in CSV format
641 * specify "alt=csv" as a query parameter.
642 *
643 * Request parameters:
644 *
645 * [accountId] - Hosted account upon which to report.
646 *
647 * [startDate] - Start of the date range to report on in "YYYY-MM-DD" format,
648 * inclusive.
649 * Value must have pattern
650 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )".
651 *
652 * [endDate] - End of the date range to report on in "YYYY-MM-DD" format,
653 * inclusive.
654 * Value must have pattern
655 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )".
656 *
657 * [dimension] - Dimensions to base the report on.
658 * Value must have pattern "[a-zA-Z_]+".
659 *
660 * [filter] - Filters to be run on the report.
661 * Value must have pattern "[a-zA-Z_]+(==|=@).+".
662 *
663 * [locale] - Optional locale to use for translating report output to a local
664 * language. Defaults to "en_US" if not specified.
665 * Value must have pattern "[a-zA-Z_]+".
666 *
667 * [maxResults] - The maximum number of rows of report data to return.
668 * Value must be between "0" and "50000".
669 *
670 * [metric] - Numeric columns to include in the report.
671 * Value must have pattern "[a-zA-Z_]+".
672 *
673 * [sort] - The name of a dimension or metric to sort the resulting report on,
674 * optionally prefixed with "+" to sort ascending or "-" to sort descending.
675 * If no prefix is specified, the column is sorted ascending.
676 * Value must have pattern "(\+|-)?[a-zA-Z_]+".
677 *
678 * [startIndex] - Index of the first row of report data to return.
679 * Value must be between "0" and "5000".
680 *
681 * Completes with a [Report].
682 *
683 * Completes with a [common.ApiRequestError] if the API endpoint returned an
684 * error.
685 *
686 * If the used [http.Client] completes with an error when making a REST call,
687 * this method will complete with the same error.
688 */
689 async.Future<Report> generate(core.String accountId, core.String startDate, co re.String endDate, {core.List<core.String> dimension, core.List<core.String> fil ter, core.String locale, core.int maxResults, core.List<core.String> metric, cor e.List<core.String> sort, core.int startIndex}) {
690 var _url = null;
691 var _queryParams = new core.Map();
692 var _uploadMedia = null;
693 var _uploadOptions = null;
694 var _downloadOptions = common.DownloadOptions.Metadata;
695 var _body = null;
696
697 if (accountId == null) {
698 throw new core.ArgumentError("Parameter accountId is required.");
699 }
700 if (startDate == null) {
701 throw new core.ArgumentError("Parameter startDate is required.");
702 }
703 _queryParams["startDate"] = [startDate];
704 if (endDate == null) {
705 throw new core.ArgumentError("Parameter endDate is required.");
706 }
707 _queryParams["endDate"] = [endDate];
708 if (dimension != null) {
709 _queryParams["dimension"] = dimension;
710 }
711 if (filter != null) {
712 _queryParams["filter"] = filter;
713 }
714 if (locale != null) {
715 _queryParams["locale"] = [locale];
716 }
717 if (maxResults != null) {
718 _queryParams["maxResults"] = ["${maxResults}"];
719 }
720 if (metric != null) {
721 _queryParams["metric"] = metric;
722 }
723 if (sort != null) {
724 _queryParams["sort"] = sort;
725 }
726 if (startIndex != null) {
727 _queryParams["startIndex"] = ["${startIndex}"];
728 }
729
730
731 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + ' /reports';
732
733 var _response = _requester.request(_url,
734 "GET",
735 body: _body,
736 queryParams: _queryParams,
737 uploadOptions: _uploadOptions,
738 uploadMedia: _uploadMedia,
739 downloadOptions: _downloadOptions);
740 return _response.then((data) => new Report.fromJson(data));
741 }
742
743 }
744
745
746 /** Not documented yet. */
747 class AdclientsResourceApi {
748 final common_internal.ApiRequester _requester;
749
750 AdclientsResourceApi(common_internal.ApiRequester client) :
751 _requester = client;
752
753 /**
754 * Get information about one of the ad clients in the Host AdSense account.
755 *
756 * Request parameters:
757 *
758 * [adClientId] - Ad client to get.
759 *
760 * Completes with a [AdClient].
761 *
762 * Completes with a [common.ApiRequestError] if the API endpoint returned an
763 * error.
764 *
765 * If the used [http.Client] completes with an error when making a REST call,
766 * this method will complete with the same error.
767 */
768 async.Future<AdClient> get(core.String adClientId) {
769 var _url = null;
770 var _queryParams = new core.Map();
771 var _uploadMedia = null;
772 var _uploadOptions = null;
773 var _downloadOptions = common.DownloadOptions.Metadata;
774 var _body = null;
775
776 if (adClientId == null) {
777 throw new core.ArgumentError("Parameter adClientId is required.");
778 }
779
780
781 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId');
782
783 var _response = _requester.request(_url,
784 "GET",
785 body: _body,
786 queryParams: _queryParams,
787 uploadOptions: _uploadOptions,
788 uploadMedia: _uploadMedia,
789 downloadOptions: _downloadOptions);
790 return _response.then((data) => new AdClient.fromJson(data));
791 }
792
793 /**
794 * List all host ad clients in this AdSense account.
795 *
796 * Request parameters:
797 *
798 * [maxResults] - The maximum number of ad clients to include in the response,
799 * used for paging.
800 * Value must be between "0" and "10000".
801 *
802 * [pageToken] - A continuation token, used to page through ad clients. To
803 * retrieve the next page, set this parameter to the value of "nextPageToken"
804 * from the previous response.
805 *
806 * Completes with a [AdClients].
807 *
808 * Completes with a [common.ApiRequestError] if the API endpoint returned an
809 * error.
810 *
811 * If the used [http.Client] completes with an error when making a REST call,
812 * this method will complete with the same error.
813 */
814 async.Future<AdClients> list({core.int maxResults, core.String pageToken}) {
815 var _url = null;
816 var _queryParams = new core.Map();
817 var _uploadMedia = null;
818 var _uploadOptions = null;
819 var _downloadOptions = common.DownloadOptions.Metadata;
820 var _body = null;
821
822 if (maxResults != null) {
823 _queryParams["maxResults"] = ["${maxResults}"];
824 }
825 if (pageToken != null) {
826 _queryParams["pageToken"] = [pageToken];
827 }
828
829
830 _url = 'adclients';
831
832 var _response = _requester.request(_url,
833 "GET",
834 body: _body,
835 queryParams: _queryParams,
836 uploadOptions: _uploadOptions,
837 uploadMedia: _uploadMedia,
838 downloadOptions: _downloadOptions);
839 return _response.then((data) => new AdClients.fromJson(data));
840 }
841
842 }
843
844
845 /** Not documented yet. */
846 class AssociationsessionsResourceApi {
847 final common_internal.ApiRequester _requester;
848
849 AssociationsessionsResourceApi(common_internal.ApiRequester client) :
850 _requester = client;
851
852 /**
853 * Create an association session for initiating an association with an AdSense
854 * user.
855 *
856 * Request parameters:
857 *
858 * [productCode] - Products to associate with the user.
859 *
860 * [websiteUrl] - The URL of the user's hosted website.
861 *
862 * [userLocale] - The preferred locale of the user.
863 *
864 * [websiteLocale] - The locale of the user's hosted website.
865 *
866 * Completes with a [AssociationSession].
867 *
868 * Completes with a [common.ApiRequestError] if the API endpoint returned an
869 * error.
870 *
871 * If the used [http.Client] completes with an error when making a REST call,
872 * this method will complete with the same error.
873 */
874 async.Future<AssociationSession> start(core.List<core.String> productCode, cor e.String websiteUrl, {core.String userLocale, core.String websiteLocale}) {
875 var _url = null;
876 var _queryParams = new core.Map();
877 var _uploadMedia = null;
878 var _uploadOptions = null;
879 var _downloadOptions = common.DownloadOptions.Metadata;
880 var _body = null;
881
882 if (productCode == null || productCode.isEmpty) {
883 throw new core.ArgumentError("Parameter productCode is required.");
884 }
885 _queryParams["productCode"] = productCode;
886 if (websiteUrl == null) {
887 throw new core.ArgumentError("Parameter websiteUrl is required.");
888 }
889 _queryParams["websiteUrl"] = [websiteUrl];
890 if (userLocale != null) {
891 _queryParams["userLocale"] = [userLocale];
892 }
893 if (websiteLocale != null) {
894 _queryParams["websiteLocale"] = [websiteLocale];
895 }
896
897
898 _url = 'associationsessions/start';
899
900 var _response = _requester.request(_url,
901 "GET",
902 body: _body,
903 queryParams: _queryParams,
904 uploadOptions: _uploadOptions,
905 uploadMedia: _uploadMedia,
906 downloadOptions: _downloadOptions);
907 return _response.then((data) => new AssociationSession.fromJson(data));
908 }
909
910 /**
911 * Verify an association session after the association callback returns from
912 * AdSense signup.
913 *
914 * Request parameters:
915 *
916 * [token] - The token returned to the association callback URL.
917 *
918 * Completes with a [AssociationSession].
919 *
920 * Completes with a [common.ApiRequestError] if the API endpoint returned an
921 * error.
922 *
923 * If the used [http.Client] completes with an error when making a REST call,
924 * this method will complete with the same error.
925 */
926 async.Future<AssociationSession> verify(core.String token) {
927 var _url = null;
928 var _queryParams = new core.Map();
929 var _uploadMedia = null;
930 var _uploadOptions = null;
931 var _downloadOptions = common.DownloadOptions.Metadata;
932 var _body = null;
933
934 if (token == null) {
935 throw new core.ArgumentError("Parameter token is required.");
936 }
937 _queryParams["token"] = [token];
938
939
940 _url = 'associationsessions/verify';
941
942 var _response = _requester.request(_url,
943 "GET",
944 body: _body,
945 queryParams: _queryParams,
946 uploadOptions: _uploadOptions,
947 uploadMedia: _uploadMedia,
948 downloadOptions: _downloadOptions);
949 return _response.then((data) => new AssociationSession.fromJson(data));
950 }
951
952 }
953
954
955 /** Not documented yet. */
956 class CustomchannelsResourceApi {
957 final common_internal.ApiRequester _requester;
958
959 CustomchannelsResourceApi(common_internal.ApiRequester client) :
960 _requester = client;
961
962 /**
963 * Delete a specific custom channel from the host AdSense account.
964 *
965 * Request parameters:
966 *
967 * [adClientId] - Ad client from which to delete the custom channel.
968 *
969 * [customChannelId] - Custom channel to delete.
970 *
971 * Completes with a [CustomChannel].
972 *
973 * Completes with a [common.ApiRequestError] if the API endpoint returned an
974 * error.
975 *
976 * If the used [http.Client] completes with an error when making a REST call,
977 * this method will complete with the same error.
978 */
979 async.Future<CustomChannel> delete(core.String adClientId, core.String customC hannelId) {
980 var _url = null;
981 var _queryParams = new core.Map();
982 var _uploadMedia = null;
983 var _uploadOptions = null;
984 var _downloadOptions = common.DownloadOptions.Metadata;
985 var _body = null;
986
987 if (adClientId == null) {
988 throw new core.ArgumentError("Parameter adClientId is required.");
989 }
990 if (customChannelId == null) {
991 throw new core.ArgumentError("Parameter customChannelId is required.");
992 }
993
994
995 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels/' + common_internal.Escaper.ecapeVariable('$customChannelId');
996
997 var _response = _requester.request(_url,
998 "DELETE",
999 body: _body,
1000 queryParams: _queryParams,
1001 uploadOptions: _uploadOptions,
1002 uploadMedia: _uploadMedia,
1003 downloadOptions: _downloadOptions);
1004 return _response.then((data) => new CustomChannel.fromJson(data));
1005 }
1006
1007 /**
1008 * Get a specific custom channel from the host AdSense account.
1009 *
1010 * Request parameters:
1011 *
1012 * [adClientId] - Ad client from which to get the custom channel.
1013 *
1014 * [customChannelId] - Custom channel to get.
1015 *
1016 * Completes with a [CustomChannel].
1017 *
1018 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1019 * error.
1020 *
1021 * If the used [http.Client] completes with an error when making a REST call,
1022 * this method will complete with the same error.
1023 */
1024 async.Future<CustomChannel> get(core.String adClientId, core.String customChan nelId) {
1025 var _url = null;
1026 var _queryParams = new core.Map();
1027 var _uploadMedia = null;
1028 var _uploadOptions = null;
1029 var _downloadOptions = common.DownloadOptions.Metadata;
1030 var _body = null;
1031
1032 if (adClientId == null) {
1033 throw new core.ArgumentError("Parameter adClientId is required.");
1034 }
1035 if (customChannelId == null) {
1036 throw new core.ArgumentError("Parameter customChannelId is required.");
1037 }
1038
1039
1040 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels/' + common_internal.Escaper.ecapeVariable('$customChannelId');
1041
1042 var _response = _requester.request(_url,
1043 "GET",
1044 body: _body,
1045 queryParams: _queryParams,
1046 uploadOptions: _uploadOptions,
1047 uploadMedia: _uploadMedia,
1048 downloadOptions: _downloadOptions);
1049 return _response.then((data) => new CustomChannel.fromJson(data));
1050 }
1051
1052 /**
1053 * Add a new custom channel to the host AdSense account.
1054 *
1055 * [request] - The metadata request object.
1056 *
1057 * Request parameters:
1058 *
1059 * [adClientId] - Ad client to which the new custom channel will be added.
1060 *
1061 * Completes with a [CustomChannel].
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<CustomChannel> insert(CustomChannel request, core.String adClient Id) {
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 (request != null) {
1078 _body = convert.JSON.encode((request).toJson());
1079 }
1080 if (adClientId == null) {
1081 throw new core.ArgumentError("Parameter adClientId is required.");
1082 }
1083
1084
1085 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels';
1086
1087 var _response = _requester.request(_url,
1088 "POST",
1089 body: _body,
1090 queryParams: _queryParams,
1091 uploadOptions: _uploadOptions,
1092 uploadMedia: _uploadMedia,
1093 downloadOptions: _downloadOptions);
1094 return _response.then((data) => new CustomChannel.fromJson(data));
1095 }
1096
1097 /**
1098 * List all host custom channels in this AdSense account.
1099 *
1100 * Request parameters:
1101 *
1102 * [adClientId] - Ad client for which to list custom channels.
1103 *
1104 * [maxResults] - The maximum number of custom channels to include in the
1105 * response, used for paging.
1106 * Value must be between "0" and "10000".
1107 *
1108 * [pageToken] - A continuation token, used to page through custom channels.
1109 * To retrieve the next page, set this parameter to the value of
1110 * "nextPageToken" from the previous response.
1111 *
1112 * Completes with a [CustomChannels].
1113 *
1114 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1115 * error.
1116 *
1117 * If the used [http.Client] completes with an error when making a REST call,
1118 * this method will complete with the same error.
1119 */
1120 async.Future<CustomChannels> list(core.String adClientId, {core.int maxResults , core.String pageToken}) {
1121 var _url = null;
1122 var _queryParams = new core.Map();
1123 var _uploadMedia = null;
1124 var _uploadOptions = null;
1125 var _downloadOptions = common.DownloadOptions.Metadata;
1126 var _body = null;
1127
1128 if (adClientId == null) {
1129 throw new core.ArgumentError("Parameter adClientId is required.");
1130 }
1131 if (maxResults != null) {
1132 _queryParams["maxResults"] = ["${maxResults}"];
1133 }
1134 if (pageToken != null) {
1135 _queryParams["pageToken"] = [pageToken];
1136 }
1137
1138
1139 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels';
1140
1141 var _response = _requester.request(_url,
1142 "GET",
1143 body: _body,
1144 queryParams: _queryParams,
1145 uploadOptions: _uploadOptions,
1146 uploadMedia: _uploadMedia,
1147 downloadOptions: _downloadOptions);
1148 return _response.then((data) => new CustomChannels.fromJson(data));
1149 }
1150
1151 /**
1152 * Update a custom channel in the host AdSense account. This method supports
1153 * patch semantics.
1154 *
1155 * [request] - The metadata request object.
1156 *
1157 * Request parameters:
1158 *
1159 * [adClientId] - Ad client in which the custom channel will be updated.
1160 *
1161 * [customChannelId] - Custom channel to get.
1162 *
1163 * Completes with a [CustomChannel].
1164 *
1165 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1166 * error.
1167 *
1168 * If the used [http.Client] completes with an error when making a REST call,
1169 * this method will complete with the same error.
1170 */
1171 async.Future<CustomChannel> patch(CustomChannel request, core.String adClientI d, core.String customChannelId) {
1172 var _url = null;
1173 var _queryParams = new core.Map();
1174 var _uploadMedia = null;
1175 var _uploadOptions = null;
1176 var _downloadOptions = common.DownloadOptions.Metadata;
1177 var _body = null;
1178
1179 if (request != null) {
1180 _body = convert.JSON.encode((request).toJson());
1181 }
1182 if (adClientId == null) {
1183 throw new core.ArgumentError("Parameter adClientId is required.");
1184 }
1185 if (customChannelId == null) {
1186 throw new core.ArgumentError("Parameter customChannelId is required.");
1187 }
1188 _queryParams["customChannelId"] = [customChannelId];
1189
1190
1191 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels';
1192
1193 var _response = _requester.request(_url,
1194 "PATCH",
1195 body: _body,
1196 queryParams: _queryParams,
1197 uploadOptions: _uploadOptions,
1198 uploadMedia: _uploadMedia,
1199 downloadOptions: _downloadOptions);
1200 return _response.then((data) => new CustomChannel.fromJson(data));
1201 }
1202
1203 /**
1204 * Update a custom channel in the host AdSense account.
1205 *
1206 * [request] - The metadata request object.
1207 *
1208 * Request parameters:
1209 *
1210 * [adClientId] - Ad client in which the custom channel will be updated.
1211 *
1212 * Completes with a [CustomChannel].
1213 *
1214 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1215 * error.
1216 *
1217 * If the used [http.Client] completes with an error when making a REST call,
1218 * this method will complete with the same error.
1219 */
1220 async.Future<CustomChannel> update(CustomChannel request, core.String adClient Id) {
1221 var _url = null;
1222 var _queryParams = new core.Map();
1223 var _uploadMedia = null;
1224 var _uploadOptions = null;
1225 var _downloadOptions = common.DownloadOptions.Metadata;
1226 var _body = null;
1227
1228 if (request != null) {
1229 _body = convert.JSON.encode((request).toJson());
1230 }
1231 if (adClientId == null) {
1232 throw new core.ArgumentError("Parameter adClientId is required.");
1233 }
1234
1235
1236 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/customchannels';
1237
1238 var _response = _requester.request(_url,
1239 "PUT",
1240 body: _body,
1241 queryParams: _queryParams,
1242 uploadOptions: _uploadOptions,
1243 uploadMedia: _uploadMedia,
1244 downloadOptions: _downloadOptions);
1245 return _response.then((data) => new CustomChannel.fromJson(data));
1246 }
1247
1248 }
1249
1250
1251 /** Not documented yet. */
1252 class ReportsResourceApi {
1253 final common_internal.ApiRequester _requester;
1254
1255 ReportsResourceApi(common_internal.ApiRequester client) :
1256 _requester = client;
1257
1258 /**
1259 * Generate an AdSense report based on the report request sent in the query
1260 * parameters. Returns the result as JSON; to retrieve output in CSV format
1261 * specify "alt=csv" as a query parameter.
1262 *
1263 * Request parameters:
1264 *
1265 * [startDate] - Start of the date range to report on in "YYYY-MM-DD" format,
1266 * inclusive.
1267 * Value must have pattern
1268 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )".
1269 *
1270 * [endDate] - End of the date range to report on in "YYYY-MM-DD" format,
1271 * inclusive.
1272 * Value must have pattern
1273 * "\d{4}-\d{2}-\d{2}|(today|startOfMonth|startOfYear)(([\-\+]\d+[dwmy]){0,3}? )".
1274 *
1275 * [dimension] - Dimensions to base the report on.
1276 * Value must have pattern "[a-zA-Z_]+".
1277 *
1278 * [filter] - Filters to be run on the report.
1279 * Value must have pattern "[a-zA-Z_]+(==|=@).+".
1280 *
1281 * [locale] - Optional locale to use for translating report output to a local
1282 * language. Defaults to "en_US" if not specified.
1283 * Value must have pattern "[a-zA-Z_]+".
1284 *
1285 * [maxResults] - The maximum number of rows of report data to return.
1286 * Value must be between "0" and "50000".
1287 *
1288 * [metric] - Numeric columns to include in the report.
1289 * Value must have pattern "[a-zA-Z_]+".
1290 *
1291 * [sort] - The name of a dimension or metric to sort the resulting report on,
1292 * optionally prefixed with "+" to sort ascending or "-" to sort descending.
1293 * If no prefix is specified, the column is sorted ascending.
1294 * Value must have pattern "(\+|-)?[a-zA-Z_]+".
1295 *
1296 * [startIndex] - Index of the first row of report data to return.
1297 * Value must be between "0" and "5000".
1298 *
1299 * Completes with a [Report].
1300 *
1301 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1302 * error.
1303 *
1304 * If the used [http.Client] completes with an error when making a REST call,
1305 * this method will complete with the same error.
1306 */
1307 async.Future<Report> generate(core.String startDate, core.String endDate, {cor e.List<core.String> dimension, core.List<core.String> filter, core.String locale , core.int maxResults, core.List<core.String> metric, core.List<core.String> sor t, core.int startIndex}) {
1308 var _url = null;
1309 var _queryParams = new core.Map();
1310 var _uploadMedia = null;
1311 var _uploadOptions = null;
1312 var _downloadOptions = common.DownloadOptions.Metadata;
1313 var _body = null;
1314
1315 if (startDate == null) {
1316 throw new core.ArgumentError("Parameter startDate is required.");
1317 }
1318 _queryParams["startDate"] = [startDate];
1319 if (endDate == null) {
1320 throw new core.ArgumentError("Parameter endDate is required.");
1321 }
1322 _queryParams["endDate"] = [endDate];
1323 if (dimension != null) {
1324 _queryParams["dimension"] = dimension;
1325 }
1326 if (filter != null) {
1327 _queryParams["filter"] = filter;
1328 }
1329 if (locale != null) {
1330 _queryParams["locale"] = [locale];
1331 }
1332 if (maxResults != null) {
1333 _queryParams["maxResults"] = ["${maxResults}"];
1334 }
1335 if (metric != null) {
1336 _queryParams["metric"] = metric;
1337 }
1338 if (sort != null) {
1339 _queryParams["sort"] = sort;
1340 }
1341 if (startIndex != null) {
1342 _queryParams["startIndex"] = ["${startIndex}"];
1343 }
1344
1345
1346 _url = 'reports';
1347
1348 var _response = _requester.request(_url,
1349 "GET",
1350 body: _body,
1351 queryParams: _queryParams,
1352 uploadOptions: _uploadOptions,
1353 uploadMedia: _uploadMedia,
1354 downloadOptions: _downloadOptions);
1355 return _response.then((data) => new Report.fromJson(data));
1356 }
1357
1358 }
1359
1360
1361 /** Not documented yet. */
1362 class UrlchannelsResourceApi {
1363 final common_internal.ApiRequester _requester;
1364
1365 UrlchannelsResourceApi(common_internal.ApiRequester client) :
1366 _requester = client;
1367
1368 /**
1369 * Delete a URL channel from the host AdSense account.
1370 *
1371 * Request parameters:
1372 *
1373 * [adClientId] - Ad client from which to delete the URL channel.
1374 *
1375 * [urlChannelId] - URL channel to delete.
1376 *
1377 * Completes with a [UrlChannel].
1378 *
1379 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1380 * error.
1381 *
1382 * If the used [http.Client] completes with an error when making a REST call,
1383 * this method will complete with the same error.
1384 */
1385 async.Future<UrlChannel> delete(core.String adClientId, core.String urlChannel Id) {
1386 var _url = null;
1387 var _queryParams = new core.Map();
1388 var _uploadMedia = null;
1389 var _uploadOptions = null;
1390 var _downloadOptions = common.DownloadOptions.Metadata;
1391 var _body = null;
1392
1393 if (adClientId == null) {
1394 throw new core.ArgumentError("Parameter adClientId is required.");
1395 }
1396 if (urlChannelId == null) {
1397 throw new core.ArgumentError("Parameter urlChannelId is required.");
1398 }
1399
1400
1401 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/urlchannels/' + common_internal.Escaper.ecapeVariable('$urlChannelId');
1402
1403 var _response = _requester.request(_url,
1404 "DELETE",
1405 body: _body,
1406 queryParams: _queryParams,
1407 uploadOptions: _uploadOptions,
1408 uploadMedia: _uploadMedia,
1409 downloadOptions: _downloadOptions);
1410 return _response.then((data) => new UrlChannel.fromJson(data));
1411 }
1412
1413 /**
1414 * Add a new URL channel to the host AdSense account.
1415 *
1416 * [request] - The metadata request object.
1417 *
1418 * Request parameters:
1419 *
1420 * [adClientId] - Ad client to which the new URL channel will be added.
1421 *
1422 * Completes with a [UrlChannel].
1423 *
1424 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1425 * error.
1426 *
1427 * If the used [http.Client] completes with an error when making a REST call,
1428 * this method will complete with the same error.
1429 */
1430 async.Future<UrlChannel> insert(UrlChannel request, core.String adClientId) {
1431 var _url = null;
1432 var _queryParams = new core.Map();
1433 var _uploadMedia = null;
1434 var _uploadOptions = null;
1435 var _downloadOptions = common.DownloadOptions.Metadata;
1436 var _body = null;
1437
1438 if (request != null) {
1439 _body = convert.JSON.encode((request).toJson());
1440 }
1441 if (adClientId == null) {
1442 throw new core.ArgumentError("Parameter adClientId is required.");
1443 }
1444
1445
1446 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/urlchannels';
1447
1448 var _response = _requester.request(_url,
1449 "POST",
1450 body: _body,
1451 queryParams: _queryParams,
1452 uploadOptions: _uploadOptions,
1453 uploadMedia: _uploadMedia,
1454 downloadOptions: _downloadOptions);
1455 return _response.then((data) => new UrlChannel.fromJson(data));
1456 }
1457
1458 /**
1459 * List all host URL channels in the host AdSense account.
1460 *
1461 * Request parameters:
1462 *
1463 * [adClientId] - Ad client for which to list URL channels.
1464 *
1465 * [maxResults] - The maximum number of URL channels to include in the
1466 * response, used for paging.
1467 * Value must be between "0" and "10000".
1468 *
1469 * [pageToken] - A continuation token, used to page through URL channels. To
1470 * retrieve the next page, set this parameter to the value of "nextPageToken"
1471 * from the previous response.
1472 *
1473 * Completes with a [UrlChannels].
1474 *
1475 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1476 * error.
1477 *
1478 * If the used [http.Client] completes with an error when making a REST call,
1479 * this method will complete with the same error.
1480 */
1481 async.Future<UrlChannels> list(core.String adClientId, {core.int maxResults, c ore.String pageToken}) {
1482 var _url = null;
1483 var _queryParams = new core.Map();
1484 var _uploadMedia = null;
1485 var _uploadOptions = null;
1486 var _downloadOptions = common.DownloadOptions.Metadata;
1487 var _body = null;
1488
1489 if (adClientId == null) {
1490 throw new core.ArgumentError("Parameter adClientId is required.");
1491 }
1492 if (maxResults != null) {
1493 _queryParams["maxResults"] = ["${maxResults}"];
1494 }
1495 if (pageToken != null) {
1496 _queryParams["pageToken"] = [pageToken];
1497 }
1498
1499
1500 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/urlchannels';
1501
1502 var _response = _requester.request(_url,
1503 "GET",
1504 body: _body,
1505 queryParams: _queryParams,
1506 uploadOptions: _uploadOptions,
1507 uploadMedia: _uploadMedia,
1508 downloadOptions: _downloadOptions);
1509 return _response.then((data) => new UrlChannels.fromJson(data));
1510 }
1511
1512 }
1513
1514
1515
1516 /** Not documented yet. */
1517 class Account {
1518 /** Unique identifier of this account. */
1519 core.String id;
1520
1521 /** Kind of resource this is, in this case adsensehost#account. */
1522 core.String kind;
1523
1524 /** Name of this account. */
1525 core.String name;
1526
1527 /** Approval status of this account. One of: PENDING, APPROVED, DISABLED. */
1528 core.String status;
1529
1530
1531 Account();
1532
1533 Account.fromJson(core.Map _json) {
1534 if (_json.containsKey("id")) {
1535 id = _json["id"];
1536 }
1537 if (_json.containsKey("kind")) {
1538 kind = _json["kind"];
1539 }
1540 if (_json.containsKey("name")) {
1541 name = _json["name"];
1542 }
1543 if (_json.containsKey("status")) {
1544 status = _json["status"];
1545 }
1546 }
1547
1548 core.Map toJson() {
1549 var _json = new core.Map();
1550 if (id != null) {
1551 _json["id"] = id;
1552 }
1553 if (kind != null) {
1554 _json["kind"] = kind;
1555 }
1556 if (name != null) {
1557 _json["name"] = name;
1558 }
1559 if (status != null) {
1560 _json["status"] = status;
1561 }
1562 return _json;
1563 }
1564 }
1565
1566
1567 /** Not documented yet. */
1568 class Accounts {
1569 /** ETag of this response for caching purposes. */
1570 core.String etag;
1571
1572 /** The accounts returned in this list response. */
1573 core.List<Account> items;
1574
1575 /** Kind of list this is, in this case adsensehost#accounts. */
1576 core.String kind;
1577
1578
1579 Accounts();
1580
1581 Accounts.fromJson(core.Map _json) {
1582 if (_json.containsKey("etag")) {
1583 etag = _json["etag"];
1584 }
1585 if (_json.containsKey("items")) {
1586 items = _json["items"].map((value) => new Account.fromJson(value)).toList( );
1587 }
1588 if (_json.containsKey("kind")) {
1589 kind = _json["kind"];
1590 }
1591 }
1592
1593 core.Map toJson() {
1594 var _json = new core.Map();
1595 if (etag != null) {
1596 _json["etag"] = etag;
1597 }
1598 if (items != null) {
1599 _json["items"] = items.map((value) => (value).toJson()).toList();
1600 }
1601 if (kind != null) {
1602 _json["kind"] = kind;
1603 }
1604 return _json;
1605 }
1606 }
1607
1608
1609 /** Not documented yet. */
1610 class AdClient {
1611 /** Whether this ad client is opted in to ARC. */
1612 core.bool arcOptIn;
1613
1614 /** Unique identifier of this ad client. */
1615 core.String id;
1616
1617 /** Kind of resource this is, in this case adsensehost#adClient. */
1618 core.String kind;
1619
1620 /**
1621 * This ad client's product code, which corresponds to the PRODUCT_CODE report
1622 * dimension.
1623 */
1624 core.String productCode;
1625
1626 /** Whether this ad client supports being reported on. */
1627 core.bool supportsReporting;
1628
1629
1630 AdClient();
1631
1632 AdClient.fromJson(core.Map _json) {
1633 if (_json.containsKey("arcOptIn")) {
1634 arcOptIn = _json["arcOptIn"];
1635 }
1636 if (_json.containsKey("id")) {
1637 id = _json["id"];
1638 }
1639 if (_json.containsKey("kind")) {
1640 kind = _json["kind"];
1641 }
1642 if (_json.containsKey("productCode")) {
1643 productCode = _json["productCode"];
1644 }
1645 if (_json.containsKey("supportsReporting")) {
1646 supportsReporting = _json["supportsReporting"];
1647 }
1648 }
1649
1650 core.Map toJson() {
1651 var _json = new core.Map();
1652 if (arcOptIn != null) {
1653 _json["arcOptIn"] = arcOptIn;
1654 }
1655 if (id != null) {
1656 _json["id"] = id;
1657 }
1658 if (kind != null) {
1659 _json["kind"] = kind;
1660 }
1661 if (productCode != null) {
1662 _json["productCode"] = productCode;
1663 }
1664 if (supportsReporting != null) {
1665 _json["supportsReporting"] = supportsReporting;
1666 }
1667 return _json;
1668 }
1669 }
1670
1671
1672 /** Not documented yet. */
1673 class AdClients {
1674 /** ETag of this response for caching purposes. */
1675 core.String etag;
1676
1677 /** The ad clients returned in this list response. */
1678 core.List<AdClient> items;
1679
1680 /** Kind of list this is, in this case adsensehost#adClients. */
1681 core.String kind;
1682
1683 /**
1684 * Continuation token used to page through ad clients. To retrieve the next
1685 * page of results, set the next request's "pageToken" value to this.
1686 */
1687 core.String nextPageToken;
1688
1689
1690 AdClients();
1691
1692 AdClients.fromJson(core.Map _json) {
1693 if (_json.containsKey("etag")) {
1694 etag = _json["etag"];
1695 }
1696 if (_json.containsKey("items")) {
1697 items = _json["items"].map((value) => new AdClient.fromJson(value)).toList ();
1698 }
1699 if (_json.containsKey("kind")) {
1700 kind = _json["kind"];
1701 }
1702 if (_json.containsKey("nextPageToken")) {
1703 nextPageToken = _json["nextPageToken"];
1704 }
1705 }
1706
1707 core.Map toJson() {
1708 var _json = new core.Map();
1709 if (etag != null) {
1710 _json["etag"] = etag;
1711 }
1712 if (items != null) {
1713 _json["items"] = items.map((value) => (value).toJson()).toList();
1714 }
1715 if (kind != null) {
1716 _json["kind"] = kind;
1717 }
1718 if (nextPageToken != null) {
1719 _json["nextPageToken"] = nextPageToken;
1720 }
1721 return _json;
1722 }
1723 }
1724
1725
1726 /** Not documented yet. */
1727 class AdCode {
1728 /** The ad code snippet. */
1729 core.String adCode;
1730
1731 /** Kind this is, in this case adsensehost#adCode. */
1732 core.String kind;
1733
1734
1735 AdCode();
1736
1737 AdCode.fromJson(core.Map _json) {
1738 if (_json.containsKey("adCode")) {
1739 adCode = _json["adCode"];
1740 }
1741 if (_json.containsKey("kind")) {
1742 kind = _json["kind"];
1743 }
1744 }
1745
1746 core.Map toJson() {
1747 var _json = new core.Map();
1748 if (adCode != null) {
1749 _json["adCode"] = adCode;
1750 }
1751 if (kind != null) {
1752 _json["kind"] = kind;
1753 }
1754 return _json;
1755 }
1756 }
1757
1758
1759 /**
1760 * The colors included in the style. These are represented as six hexadecimal
1761 * characters, similar to HTML color codes, but without the leading hash.
1762 */
1763 class AdStyleColors {
1764 /** The color of the ad background. */
1765 core.String background;
1766
1767 /** The color of the ad border. */
1768 core.String border;
1769
1770 /** The color of the ad text. */
1771 core.String text;
1772
1773 /** The color of the ad title. */
1774 core.String title;
1775
1776 /** The color of the ad url. */
1777 core.String url;
1778
1779
1780 AdStyleColors();
1781
1782 AdStyleColors.fromJson(core.Map _json) {
1783 if (_json.containsKey("background")) {
1784 background = _json["background"];
1785 }
1786 if (_json.containsKey("border")) {
1787 border = _json["border"];
1788 }
1789 if (_json.containsKey("text")) {
1790 text = _json["text"];
1791 }
1792 if (_json.containsKey("title")) {
1793 title = _json["title"];
1794 }
1795 if (_json.containsKey("url")) {
1796 url = _json["url"];
1797 }
1798 }
1799
1800 core.Map toJson() {
1801 var _json = new core.Map();
1802 if (background != null) {
1803 _json["background"] = background;
1804 }
1805 if (border != null) {
1806 _json["border"] = border;
1807 }
1808 if (text != null) {
1809 _json["text"] = text;
1810 }
1811 if (title != null) {
1812 _json["title"] = title;
1813 }
1814 if (url != null) {
1815 _json["url"] = url;
1816 }
1817 return _json;
1818 }
1819 }
1820
1821
1822 /** The font which is included in the style. */
1823 class AdStyleFont {
1824 /**
1825 * The family of the font. Possible values are: ACCOUNT_DEFAULT_FAMILY,
1826 * ADSENSE_DEFAULT_FAMILY, ARIAL, TIMES and VERDANA.
1827 */
1828 core.String family;
1829
1830 /**
1831 * The size of the font. Possible values are: ACCOUNT_DEFAULT_SIZE,
1832 * ADSENSE_DEFAULT_SIZE, SMALL, MEDIUM and LARGE.
1833 */
1834 core.String size;
1835
1836
1837 AdStyleFont();
1838
1839 AdStyleFont.fromJson(core.Map _json) {
1840 if (_json.containsKey("family")) {
1841 family = _json["family"];
1842 }
1843 if (_json.containsKey("size")) {
1844 size = _json["size"];
1845 }
1846 }
1847
1848 core.Map toJson() {
1849 var _json = new core.Map();
1850 if (family != null) {
1851 _json["family"] = family;
1852 }
1853 if (size != null) {
1854 _json["size"] = size;
1855 }
1856 return _json;
1857 }
1858 }
1859
1860
1861 /** Not documented yet. */
1862 class AdStyle {
1863 /**
1864 * The colors included in the style. These are represented as six hexadecimal
1865 * characters, similar to HTML color codes, but without the leading hash.
1866 */
1867 AdStyleColors colors;
1868
1869 /**
1870 * The style of the corners in the ad. Possible values are SQUARE,
1871 * SLIGHTLY_ROUNDED and VERY_ROUNDED.
1872 */
1873 core.String corners;
1874
1875 /** The font which is included in the style. */
1876 AdStyleFont font;
1877
1878 /** Kind this is, in this case adsensehost#adStyle. */
1879 core.String kind;
1880
1881
1882 AdStyle();
1883
1884 AdStyle.fromJson(core.Map _json) {
1885 if (_json.containsKey("colors")) {
1886 colors = new AdStyleColors.fromJson(_json["colors"]);
1887 }
1888 if (_json.containsKey("corners")) {
1889 corners = _json["corners"];
1890 }
1891 if (_json.containsKey("font")) {
1892 font = new AdStyleFont.fromJson(_json["font"]);
1893 }
1894 if (_json.containsKey("kind")) {
1895 kind = _json["kind"];
1896 }
1897 }
1898
1899 core.Map toJson() {
1900 var _json = new core.Map();
1901 if (colors != null) {
1902 _json["colors"] = (colors).toJson();
1903 }
1904 if (corners != null) {
1905 _json["corners"] = corners;
1906 }
1907 if (font != null) {
1908 _json["font"] = (font).toJson();
1909 }
1910 if (kind != null) {
1911 _json["kind"] = kind;
1912 }
1913 return _json;
1914 }
1915 }
1916
1917
1918 /** The backup option to be used in instances where no ad is available. */
1919 class AdUnitContentAdsSettingsBackupOption {
1920 /**
1921 * Color to use when type is set to COLOR. These are represented as six
1922 * hexadecimal characters, similar to HTML color codes, but without the
1923 * leading hash.
1924 */
1925 core.String color;
1926
1927 /** Type of the backup option. Possible values are BLANK, COLOR and URL. */
1928 core.String type;
1929
1930 /** URL to use when type is set to URL. */
1931 core.String url;
1932
1933
1934 AdUnitContentAdsSettingsBackupOption();
1935
1936 AdUnitContentAdsSettingsBackupOption.fromJson(core.Map _json) {
1937 if (_json.containsKey("color")) {
1938 color = _json["color"];
1939 }
1940 if (_json.containsKey("type")) {
1941 type = _json["type"];
1942 }
1943 if (_json.containsKey("url")) {
1944 url = _json["url"];
1945 }
1946 }
1947
1948 core.Map toJson() {
1949 var _json = new core.Map();
1950 if (color != null) {
1951 _json["color"] = color;
1952 }
1953 if (type != null) {
1954 _json["type"] = type;
1955 }
1956 if (url != null) {
1957 _json["url"] = url;
1958 }
1959 return _json;
1960 }
1961 }
1962
1963
1964 /**
1965 * Settings specific to content ads (AFC) and highend mobile content ads (AFMC).
1966 */
1967 class AdUnitContentAdsSettings {
1968 /** The backup option to be used in instances where no ad is available. */
1969 AdUnitContentAdsSettingsBackupOption backupOption;
1970
1971 /**
1972 * Size of this ad unit. Size values are in the form SIZE_{width}_{height}.
1973 */
1974 core.String size;
1975
1976 /**
1977 * Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, IMAGE and LINK.
1978 */
1979 core.String type;
1980
1981
1982 AdUnitContentAdsSettings();
1983
1984 AdUnitContentAdsSettings.fromJson(core.Map _json) {
1985 if (_json.containsKey("backupOption")) {
1986 backupOption = new AdUnitContentAdsSettingsBackupOption.fromJson(_json["ba ckupOption"]);
1987 }
1988 if (_json.containsKey("size")) {
1989 size = _json["size"];
1990 }
1991 if (_json.containsKey("type")) {
1992 type = _json["type"];
1993 }
1994 }
1995
1996 core.Map toJson() {
1997 var _json = new core.Map();
1998 if (backupOption != null) {
1999 _json["backupOption"] = (backupOption).toJson();
2000 }
2001 if (size != null) {
2002 _json["size"] = size;
2003 }
2004 if (type != null) {
2005 _json["type"] = type;
2006 }
2007 return _json;
2008 }
2009 }
2010
2011
2012 /** Settings specific to WAP mobile content ads (AFMC). */
2013 class AdUnitMobileContentAdsSettings {
2014 /** The markup language to use for this ad unit. */
2015 core.String markupLanguage;
2016
2017 /** The scripting language to use for this ad unit. */
2018 core.String scriptingLanguage;
2019
2020 /** Size of this ad unit. */
2021 core.String size;
2022
2023 /** Type of this ad unit. */
2024 core.String type;
2025
2026
2027 AdUnitMobileContentAdsSettings();
2028
2029 AdUnitMobileContentAdsSettings.fromJson(core.Map _json) {
2030 if (_json.containsKey("markupLanguage")) {
2031 markupLanguage = _json["markupLanguage"];
2032 }
2033 if (_json.containsKey("scriptingLanguage")) {
2034 scriptingLanguage = _json["scriptingLanguage"];
2035 }
2036 if (_json.containsKey("size")) {
2037 size = _json["size"];
2038 }
2039 if (_json.containsKey("type")) {
2040 type = _json["type"];
2041 }
2042 }
2043
2044 core.Map toJson() {
2045 var _json = new core.Map();
2046 if (markupLanguage != null) {
2047 _json["markupLanguage"] = markupLanguage;
2048 }
2049 if (scriptingLanguage != null) {
2050 _json["scriptingLanguage"] = scriptingLanguage;
2051 }
2052 if (size != null) {
2053 _json["size"] = size;
2054 }
2055 if (type != null) {
2056 _json["type"] = type;
2057 }
2058 return _json;
2059 }
2060 }
2061
2062
2063 /** Not documented yet. */
2064 class AdUnit {
2065 /**
2066 * Identity code of this ad unit, not necessarily unique across ad clients.
2067 */
2068 core.String code;
2069
2070 /**
2071 * Settings specific to content ads (AFC) and highend mobile content ads
2072 * (AFMC).
2073 */
2074 AdUnitContentAdsSettings contentAdsSettings;
2075
2076 /** Custom style information specific to this ad unit. */
2077 AdStyle customStyle;
2078
2079 /**
2080 * Unique identifier of this ad unit. This should be considered an opaque
2081 * identifier; it is not safe to rely on it being in any particular format.
2082 */
2083 core.String id;
2084
2085 /** Kind of resource this is, in this case adsensehost#adUnit. */
2086 core.String kind;
2087
2088 /** Settings specific to WAP mobile content ads (AFMC). */
2089 AdUnitMobileContentAdsSettings mobileContentAdsSettings;
2090
2091 /** Name of this ad unit. */
2092 core.String name;
2093
2094 /**
2095 * Status of this ad unit. Possible values are:
2096 * NEW: Indicates that the ad unit was created within the last seven days and
2097 * does not yet have any activity associated with it.
2098 *
2099 * ACTIVE: Indicates that there has been activity on this ad unit in the last
2100 * seven days.
2101 *
2102 * INACTIVE: Indicates that there has been no activity on this ad unit in the
2103 * last seven days.
2104 */
2105 core.String status;
2106
2107
2108 AdUnit();
2109
2110 AdUnit.fromJson(core.Map _json) {
2111 if (_json.containsKey("code")) {
2112 code = _json["code"];
2113 }
2114 if (_json.containsKey("contentAdsSettings")) {
2115 contentAdsSettings = new AdUnitContentAdsSettings.fromJson(_json["contentA dsSettings"]);
2116 }
2117 if (_json.containsKey("customStyle")) {
2118 customStyle = new AdStyle.fromJson(_json["customStyle"]);
2119 }
2120 if (_json.containsKey("id")) {
2121 id = _json["id"];
2122 }
2123 if (_json.containsKey("kind")) {
2124 kind = _json["kind"];
2125 }
2126 if (_json.containsKey("mobileContentAdsSettings")) {
2127 mobileContentAdsSettings = new AdUnitMobileContentAdsSettings.fromJson(_js on["mobileContentAdsSettings"]);
2128 }
2129 if (_json.containsKey("name")) {
2130 name = _json["name"];
2131 }
2132 if (_json.containsKey("status")) {
2133 status = _json["status"];
2134 }
2135 }
2136
2137 core.Map toJson() {
2138 var _json = new core.Map();
2139 if (code != null) {
2140 _json["code"] = code;
2141 }
2142 if (contentAdsSettings != null) {
2143 _json["contentAdsSettings"] = (contentAdsSettings).toJson();
2144 }
2145 if (customStyle != null) {
2146 _json["customStyle"] = (customStyle).toJson();
2147 }
2148 if (id != null) {
2149 _json["id"] = id;
2150 }
2151 if (kind != null) {
2152 _json["kind"] = kind;
2153 }
2154 if (mobileContentAdsSettings != null) {
2155 _json["mobileContentAdsSettings"] = (mobileContentAdsSettings).toJson();
2156 }
2157 if (name != null) {
2158 _json["name"] = name;
2159 }
2160 if (status != null) {
2161 _json["status"] = status;
2162 }
2163 return _json;
2164 }
2165 }
2166
2167
2168 /** Not documented yet. */
2169 class AdUnits {
2170 /** ETag of this response for caching purposes. */
2171 core.String etag;
2172
2173 /** The ad units returned in this list response. */
2174 core.List<AdUnit> items;
2175
2176 /** Kind of list this is, in this case adsensehost#adUnits. */
2177 core.String kind;
2178
2179 /**
2180 * Continuation token used to page through ad units. To retrieve the next page
2181 * of results, set the next request's "pageToken" value to this.
2182 */
2183 core.String nextPageToken;
2184
2185
2186 AdUnits();
2187
2188 AdUnits.fromJson(core.Map _json) {
2189 if (_json.containsKey("etag")) {
2190 etag = _json["etag"];
2191 }
2192 if (_json.containsKey("items")) {
2193 items = _json["items"].map((value) => new AdUnit.fromJson(value)).toList() ;
2194 }
2195 if (_json.containsKey("kind")) {
2196 kind = _json["kind"];
2197 }
2198 if (_json.containsKey("nextPageToken")) {
2199 nextPageToken = _json["nextPageToken"];
2200 }
2201 }
2202
2203 core.Map toJson() {
2204 var _json = new core.Map();
2205 if (etag != null) {
2206 _json["etag"] = etag;
2207 }
2208 if (items != null) {
2209 _json["items"] = items.map((value) => (value).toJson()).toList();
2210 }
2211 if (kind != null) {
2212 _json["kind"] = kind;
2213 }
2214 if (nextPageToken != null) {
2215 _json["nextPageToken"] = nextPageToken;
2216 }
2217 return _json;
2218 }
2219 }
2220
2221
2222 /** Not documented yet. */
2223 class AssociationSession {
2224 /**
2225 * Hosted account id of the associated publisher after association. Present if
2226 * status is ACCEPTED.
2227 */
2228 core.String accountId;
2229
2230 /** Unique identifier of this association session. */
2231 core.String id;
2232
2233 /** Kind of resource this is, in this case adsensehost#associationSession. */
2234 core.String kind;
2235
2236 /** The products to associate with the user. Options: AFC, AFF, AFS, AFMC */
2237 core.List<core.String> productCodes;
2238
2239 /**
2240 * Redirect URL of this association session. Used to redirect users into the
2241 * AdSense association flow.
2242 */
2243 core.String redirectUrl;
2244
2245 /**
2246 * Status of the completed association, available once the association
2247 * callback token has been verified. One of ACCEPTED, REJECTED, or ERROR.
2248 */
2249 core.String status;
2250
2251 /**
2252 * The preferred locale of the user themselves when going through the AdSense
2253 * association flow.
2254 */
2255 core.String userLocale;
2256
2257 /** The locale of the user's hosted website. */
2258 core.String websiteLocale;
2259
2260 /** The URL of the user's hosted website. */
2261 core.String websiteUrl;
2262
2263
2264 AssociationSession();
2265
2266 AssociationSession.fromJson(core.Map _json) {
2267 if (_json.containsKey("accountId")) {
2268 accountId = _json["accountId"];
2269 }
2270 if (_json.containsKey("id")) {
2271 id = _json["id"];
2272 }
2273 if (_json.containsKey("kind")) {
2274 kind = _json["kind"];
2275 }
2276 if (_json.containsKey("productCodes")) {
2277 productCodes = _json["productCodes"];
2278 }
2279 if (_json.containsKey("redirectUrl")) {
2280 redirectUrl = _json["redirectUrl"];
2281 }
2282 if (_json.containsKey("status")) {
2283 status = _json["status"];
2284 }
2285 if (_json.containsKey("userLocale")) {
2286 userLocale = _json["userLocale"];
2287 }
2288 if (_json.containsKey("websiteLocale")) {
2289 websiteLocale = _json["websiteLocale"];
2290 }
2291 if (_json.containsKey("websiteUrl")) {
2292 websiteUrl = _json["websiteUrl"];
2293 }
2294 }
2295
2296 core.Map toJson() {
2297 var _json = new core.Map();
2298 if (accountId != null) {
2299 _json["accountId"] = accountId;
2300 }
2301 if (id != null) {
2302 _json["id"] = id;
2303 }
2304 if (kind != null) {
2305 _json["kind"] = kind;
2306 }
2307 if (productCodes != null) {
2308 _json["productCodes"] = productCodes;
2309 }
2310 if (redirectUrl != null) {
2311 _json["redirectUrl"] = redirectUrl;
2312 }
2313 if (status != null) {
2314 _json["status"] = status;
2315 }
2316 if (userLocale != null) {
2317 _json["userLocale"] = userLocale;
2318 }
2319 if (websiteLocale != null) {
2320 _json["websiteLocale"] = websiteLocale;
2321 }
2322 if (websiteUrl != null) {
2323 _json["websiteUrl"] = websiteUrl;
2324 }
2325 return _json;
2326 }
2327 }
2328
2329
2330 /** Not documented yet. */
2331 class CustomChannel {
2332 /** Code of this custom channel, not necessarily unique across ad clients. */
2333 core.String code;
2334
2335 /**
2336 * Unique identifier of this custom channel. This should be considered an
2337 * opaque identifier; it is not safe to rely on it being in any particular
2338 * format.
2339 */
2340 core.String id;
2341
2342 /** Kind of resource this is, in this case adsensehost#customChannel. */
2343 core.String kind;
2344
2345 /** Name of this custom channel. */
2346 core.String name;
2347
2348
2349 CustomChannel();
2350
2351 CustomChannel.fromJson(core.Map _json) {
2352 if (_json.containsKey("code")) {
2353 code = _json["code"];
2354 }
2355 if (_json.containsKey("id")) {
2356 id = _json["id"];
2357 }
2358 if (_json.containsKey("kind")) {
2359 kind = _json["kind"];
2360 }
2361 if (_json.containsKey("name")) {
2362 name = _json["name"];
2363 }
2364 }
2365
2366 core.Map toJson() {
2367 var _json = new core.Map();
2368 if (code != null) {
2369 _json["code"] = code;
2370 }
2371 if (id != null) {
2372 _json["id"] = id;
2373 }
2374 if (kind != null) {
2375 _json["kind"] = kind;
2376 }
2377 if (name != null) {
2378 _json["name"] = name;
2379 }
2380 return _json;
2381 }
2382 }
2383
2384
2385 /** Not documented yet. */
2386 class CustomChannels {
2387 /** ETag of this response for caching purposes. */
2388 core.String etag;
2389
2390 /** The custom channels returned in this list response. */
2391 core.List<CustomChannel> items;
2392
2393 /** Kind of list this is, in this case adsensehost#customChannels. */
2394 core.String kind;
2395
2396 /**
2397 * Continuation token used to page through custom channels. To retrieve the
2398 * next page of results, set the next request's "pageToken" value to this.
2399 */
2400 core.String nextPageToken;
2401
2402
2403 CustomChannels();
2404
2405 CustomChannels.fromJson(core.Map _json) {
2406 if (_json.containsKey("etag")) {
2407 etag = _json["etag"];
2408 }
2409 if (_json.containsKey("items")) {
2410 items = _json["items"].map((value) => new CustomChannel.fromJson(value)).t oList();
2411 }
2412 if (_json.containsKey("kind")) {
2413 kind = _json["kind"];
2414 }
2415 if (_json.containsKey("nextPageToken")) {
2416 nextPageToken = _json["nextPageToken"];
2417 }
2418 }
2419
2420 core.Map toJson() {
2421 var _json = new core.Map();
2422 if (etag != null) {
2423 _json["etag"] = etag;
2424 }
2425 if (items != null) {
2426 _json["items"] = items.map((value) => (value).toJson()).toList();
2427 }
2428 if (kind != null) {
2429 _json["kind"] = kind;
2430 }
2431 if (nextPageToken != null) {
2432 _json["nextPageToken"] = nextPageToken;
2433 }
2434 return _json;
2435 }
2436 }
2437
2438
2439 /** Not documented yet. */
2440 class ReportHeaders {
2441 /**
2442 * The currency of this column. Only present if the header type is
2443 * METRIC_CURRENCY.
2444 */
2445 core.String currency;
2446
2447 /** The name of the header. */
2448 core.String name;
2449
2450 /**
2451 * The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or
2452 * METRIC_CURRENCY.
2453 */
2454 core.String type;
2455
2456
2457 ReportHeaders();
2458
2459 ReportHeaders.fromJson(core.Map _json) {
2460 if (_json.containsKey("currency")) {
2461 currency = _json["currency"];
2462 }
2463 if (_json.containsKey("name")) {
2464 name = _json["name"];
2465 }
2466 if (_json.containsKey("type")) {
2467 type = _json["type"];
2468 }
2469 }
2470
2471 core.Map toJson() {
2472 var _json = new core.Map();
2473 if (currency != null) {
2474 _json["currency"] = currency;
2475 }
2476 if (name != null) {
2477 _json["name"] = name;
2478 }
2479 if (type != null) {
2480 _json["type"] = type;
2481 }
2482 return _json;
2483 }
2484 }
2485
2486
2487 /** Not documented yet. */
2488 class Report {
2489 /**
2490 * The averages of the report. This is the same length as any other row in the
2491 * report; cells corresponding to dimension columns are empty.
2492 */
2493 core.List<core.String> averages;
2494
2495 /**
2496 * The header information of the columns requested in the report. This is a
2497 * list of headers; one for each dimension in the request, followed by one for
2498 * each metric in the request.
2499 */
2500 core.List<ReportHeaders> headers;
2501
2502 /** Kind this is, in this case adsensehost#report. */
2503 core.String kind;
2504
2505 /**
2506 * The output rows of the report. Each row is a list of cells; one for each
2507 * dimension in the request, followed by one for each metric in the request.
2508 * The dimension cells contain strings, and the metric cells contain numbers.
2509 */
2510 core.List<core.List<core.String>> rows;
2511
2512 /**
2513 * The total number of rows matched by the report request. Fewer rows may be
2514 * returned in the response due to being limited by the row count requested or
2515 * the report row limit.
2516 */
2517 core.String totalMatchedRows;
2518
2519 /**
2520 * The totals of the report. This is the same length as any other row in the
2521 * report; cells corresponding to dimension columns are empty.
2522 */
2523 core.List<core.String> totals;
2524
2525 /** Any warnings associated with generation of the report. */
2526 core.List<core.String> warnings;
2527
2528
2529 Report();
2530
2531 Report.fromJson(core.Map _json) {
2532 if (_json.containsKey("averages")) {
2533 averages = _json["averages"];
2534 }
2535 if (_json.containsKey("headers")) {
2536 headers = _json["headers"].map((value) => new ReportHeaders.fromJson(value )).toList();
2537 }
2538 if (_json.containsKey("kind")) {
2539 kind = _json["kind"];
2540 }
2541 if (_json.containsKey("rows")) {
2542 rows = _json["rows"];
2543 }
2544 if (_json.containsKey("totalMatchedRows")) {
2545 totalMatchedRows = _json["totalMatchedRows"];
2546 }
2547 if (_json.containsKey("totals")) {
2548 totals = _json["totals"];
2549 }
2550 if (_json.containsKey("warnings")) {
2551 warnings = _json["warnings"];
2552 }
2553 }
2554
2555 core.Map toJson() {
2556 var _json = new core.Map();
2557 if (averages != null) {
2558 _json["averages"] = averages;
2559 }
2560 if (headers != null) {
2561 _json["headers"] = headers.map((value) => (value).toJson()).toList();
2562 }
2563 if (kind != null) {
2564 _json["kind"] = kind;
2565 }
2566 if (rows != null) {
2567 _json["rows"] = rows;
2568 }
2569 if (totalMatchedRows != null) {
2570 _json["totalMatchedRows"] = totalMatchedRows;
2571 }
2572 if (totals != null) {
2573 _json["totals"] = totals;
2574 }
2575 if (warnings != null) {
2576 _json["warnings"] = warnings;
2577 }
2578 return _json;
2579 }
2580 }
2581
2582
2583 /** Not documented yet. */
2584 class UrlChannel {
2585 /**
2586 * Unique identifier of this URL channel. This should be considered an opaque
2587 * identifier; it is not safe to rely on it being in any particular format.
2588 */
2589 core.String id;
2590
2591 /** Kind of resource this is, in this case adsensehost#urlChannel. */
2592 core.String kind;
2593
2594 /**
2595 * URL Pattern of this URL channel. Does not include "http://" or "https://".
2596 * Example: www.example.com/home
2597 */
2598 core.String urlPattern;
2599
2600
2601 UrlChannel();
2602
2603 UrlChannel.fromJson(core.Map _json) {
2604 if (_json.containsKey("id")) {
2605 id = _json["id"];
2606 }
2607 if (_json.containsKey("kind")) {
2608 kind = _json["kind"];
2609 }
2610 if (_json.containsKey("urlPattern")) {
2611 urlPattern = _json["urlPattern"];
2612 }
2613 }
2614
2615 core.Map toJson() {
2616 var _json = new core.Map();
2617 if (id != null) {
2618 _json["id"] = id;
2619 }
2620 if (kind != null) {
2621 _json["kind"] = kind;
2622 }
2623 if (urlPattern != null) {
2624 _json["urlPattern"] = urlPattern;
2625 }
2626 return _json;
2627 }
2628 }
2629
2630
2631 /** Not documented yet. */
2632 class UrlChannels {
2633 /** ETag of this response for caching purposes. */
2634 core.String etag;
2635
2636 /** The URL channels returned in this list response. */
2637 core.List<UrlChannel> items;
2638
2639 /** Kind of list this is, in this case adsensehost#urlChannels. */
2640 core.String kind;
2641
2642 /**
2643 * Continuation token used to page through URL channels. To retrieve the next
2644 * page of results, set the next request's "pageToken" value to this.
2645 */
2646 core.String nextPageToken;
2647
2648
2649 UrlChannels();
2650
2651 UrlChannels.fromJson(core.Map _json) {
2652 if (_json.containsKey("etag")) {
2653 etag = _json["etag"];
2654 }
2655 if (_json.containsKey("items")) {
2656 items = _json["items"].map((value) => new UrlChannel.fromJson(value)).toLi st();
2657 }
2658 if (_json.containsKey("kind")) {
2659 kind = _json["kind"];
2660 }
2661 if (_json.containsKey("nextPageToken")) {
2662 nextPageToken = _json["nextPageToken"];
2663 }
2664 }
2665
2666 core.Map toJson() {
2667 var _json = new core.Map();
2668 if (etag != null) {
2669 _json["etag"] = etag;
2670 }
2671 if (items != null) {
2672 _json["items"] = items.map((value) => (value).toJson()).toList();
2673 }
2674 if (kind != null) {
2675 _json["kind"] = kind;
2676 }
2677 if (nextPageToken != null) {
2678 _json["nextPageToken"] = nextPageToken;
2679 }
2680 return _json;
2681 }
2682 }
2683
2684
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698