/
v1.4.ts
4585 lines (4334 loc) · 157 KB
/
v1.4.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
} from 'google-auth-library';
import {
GoogleConfigurable,
createAPIRequest,
MethodOptions,
GlobalOptions,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {GaxiosPromise} from 'gaxios';
// tslint:disable: no-any
// tslint:disable: class-name
// tslint:disable: variable-name
// tslint:disable: jsdoc-format
// tslint:disable: no-namespace
export namespace adsense_v1_4 {
export interface Options extends GlobalOptions {
version: 'v1.4';
}
interface StandardParameters {
/**
* Data format for the response.
*/
alt?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
*/
quotaUser?: string;
/**
* Deprecated. Please use quotaUser instead.
*/
userIp?: string;
}
/**
* AdSense Management API
*
* Accesses AdSense publishers' inventory and generates performance reports.
*
* @example
* const {google} = require('googleapis');
* const adsense = google.adsense('v1.4');
*
* @namespace adsense
* @type {Function}
* @version v1.4
* @variation v1.4
* @param {object=} options Options for Adsense
*/
export class Adsense {
context: APIRequestContext;
accounts: Resource$Accounts;
adclients: Resource$Adclients;
adunits: Resource$Adunits;
alerts: Resource$Alerts;
customchannels: Resource$Customchannels;
metadata: Resource$Metadata;
payments: Resource$Payments;
reports: Resource$Reports;
savedadstyles: Resource$Savedadstyles;
urlchannels: Resource$Urlchannels;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.accounts = new Resource$Accounts(this.context);
this.adclients = new Resource$Adclients(this.context);
this.adunits = new Resource$Adunits(this.context);
this.alerts = new Resource$Alerts(this.context);
this.customchannels = new Resource$Customchannels(this.context);
this.metadata = new Resource$Metadata(this.context);
this.payments = new Resource$Payments(this.context);
this.reports = new Resource$Reports(this.context);
this.savedadstyles = new Resource$Savedadstyles(this.context);
this.urlchannels = new Resource$Urlchannels(this.context);
}
}
export interface Schema$Account {
creation_time?: string;
/**
* Unique identifier of this account.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#account.
*/
kind?: string;
/**
* Name of this account.
*/
name?: string;
/**
* Whether this account is premium.
*/
premium?: boolean;
/**
* Sub accounts of the this account.
*/
subAccounts?: Schema$Account[];
/**
* AdSense timezone of this account.
*/
timezone?: string;
}
export interface Schema$Accounts {
/**
* ETag of this response for caching purposes.
*/
etag?: string;
/**
* The accounts returned in this list response.
*/
items?: Schema$Account[];
/**
* Kind of list this is, in this case adsense#accounts.
*/
kind?: string;
/**
* Continuation token used to page through accounts. To retrieve the next page of results, set the next request's "pageToken" value to this.
*/
nextPageToken?: string;
}
export interface Schema$AdClient {
/**
* Whether this ad client is opted in to ARC.
*/
arcOptIn?: boolean;
/**
* Unique identifier of this ad client.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#adClient.
*/
kind?: string;
/**
* This ad client's product code, which corresponds to the PRODUCT_CODE report dimension.
*/
productCode?: string;
/**
* Whether this ad client supports being reported on.
*/
supportsReporting?: boolean;
}
export interface Schema$AdClients {
/**
* ETag of this response for caching purposes.
*/
etag?: string;
/**
* The ad clients returned in this list response.
*/
items?: Schema$AdClient[];
/**
* Kind of list this is, in this case adsense#adClients.
*/
kind?: string;
/**
* Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this.
*/
nextPageToken?: string;
}
export interface Schema$AdCode {
/**
* The Auto ad code snippet. The ad code snippet.
*/
adCode?: string;
/**
* The AMP Auto ad code snippet that goes in the body of an AMP page.
*/
ampBody?: string;
/**
* The AMP Auto ad code snippet that goes in the head of an AMP page.
*/
ampHead?: string;
/**
* Kind this is, in this case adsense#adCode.
*/
kind?: string;
}
export interface Schema$AdsenseReportsGenerateResponse {
/**
* The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.
*/
averages?: string[];
/**
* The requested end date in yyyy-mm-dd format.
*/
endDate?: string;
/**
* The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for each metric in the request.
*/
headers?: Array<{currency?: string; name?: string; type?: string}>;
/**
* Kind this is, in this case adsense#report.
*/
kind?: string;
/**
* The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The dimension cells contain strings, and the metric cells contain numbers.
*/
rows?: string[][];
/**
* The requested start date in yyyy-mm-dd format.
*/
startDate?: string;
/**
* The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or the report row limit.
*/
totalMatchedRows?: string;
/**
* The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.
*/
totals?: string[];
/**
* Any warnings associated with generation of the report.
*/
warnings?: string[];
}
export interface Schema$AdStyle {
/**
* The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash.
*/
colors?: {
background?: string;
border?: string;
text?: string;
title?: string;
url?: string;
};
/**
* The style of the corners in the ad (deprecated: never populated, ignored).
*/
corners?: string;
/**
* The font which is included in the style.
*/
font?: {family?: string; size?: string};
/**
* Kind this is, in this case adsense#adStyle.
*/
kind?: string;
}
export interface Schema$AdUnit {
/**
* Identity code of this ad unit, not necessarily unique across ad clients.
*/
code?: string;
/**
* Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated).
*/
contentAdsSettings?: {
backupOption?: {color?: string; type?: string; url?: string};
size?: string;
type?: string;
};
/**
* Custom style information specific to this ad unit.
*/
customStyle?: Schema$AdStyle;
/**
* Settings specific to feed ads (AFF) - deprecated.
*/
feedAdsSettings?: {
adPosition?: string;
frequency?: number;
minimumWordCount?: number;
type?: string;
};
/**
* Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#adUnit.
*/
kind?: string;
/**
* Settings specific to WAP mobile content ads (AFMC) - deprecated.
*/
mobileContentAdsSettings?: {
markupLanguage?: string;
scriptingLanguage?: string;
size?: string;
type?: string;
};
/**
* Name of this ad unit.
*/
name?: string;
/**
* ID of the saved ad style which holds this ad unit's style information.
*/
savedStyleId?: string;
/**
* Status of this ad unit. Possible values are: NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it. ACTIVE: Indicates that there has been activity on this ad unit in the last seven days. INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days.
*/
status?: string;
}
export interface Schema$AdUnits {
/**
* ETag of this response for caching purposes.
*/
etag?: string;
/**
* The ad units returned in this list response.
*/
items?: Schema$AdUnit[];
/**
* Kind of list this is, in this case adsense#adUnits.
*/
kind?: string;
/**
* Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this.
*/
nextPageToken?: string;
}
export interface Schema$Alert {
/**
* Unique identifier of this alert. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.
*/
id?: string;
/**
* Whether this alert can be dismissed.
*/
isDismissible?: boolean;
/**
* Kind of resource this is, in this case adsense#alert.
*/
kind?: string;
/**
* The localized alert message.
*/
message?: string;
/**
* Severity of this alert. Possible values: INFO, WARNING, SEVERE.
*/
severity?: string;
/**
* Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER, API_HOLD.
*/
type?: string;
}
export interface Schema$Alerts {
/**
* The alerts returned in this list response.
*/
items?: Schema$Alert[];
/**
* Kind of list this is, in this case adsense#alerts.
*/
kind?: string;
}
export interface Schema$CustomChannel {
/**
* Code of this custom channel, not necessarily unique across ad clients.
*/
code?: string;
/**
* Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#customChannel.
*/
kind?: string;
/**
* Name of this custom channel.
*/
name?: string;
/**
* The targeting information of this custom channel, if activated.
*/
targetingInfo?: {
adsAppearOn?: string;
description?: string;
location?: string;
siteLanguage?: string;
};
}
export interface Schema$CustomChannels {
/**
* ETag of this response for caching purposes.
*/
etag?: string;
/**
* The custom channels returned in this list response.
*/
items?: Schema$CustomChannel[];
/**
* Kind of list this is, in this case adsense#customChannels.
*/
kind?: string;
/**
* Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this.
*/
nextPageToken?: string;
}
export interface Schema$Metadata {
items?: Schema$ReportingMetadataEntry[];
/**
* Kind of list this is, in this case adsense#metadata.
*/
kind?: string;
}
export interface Schema$Payment {
/**
* Unique identifier of this Payment.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#payment.
*/
kind?: string;
/**
* The amount to be paid.
*/
paymentAmount?: string;
/**
* The currency code for the amount to be paid.
*/
paymentAmountCurrencyCode?: string;
/**
* The date this payment was/will be credited to the user, or none if the payment threshold has not been met.
*/
paymentDate?: string;
}
export interface Schema$Payments {
/**
* The list of Payments for the account. One or both of a) the account's most recent payment; and b) the account's upcoming payment.
*/
items?: Schema$Payment[];
/**
* Kind of list this is, in this case adsense#payments.
*/
kind?: string;
}
export interface Schema$ReportingMetadataEntry {
/**
* For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension belongs to.
*/
compatibleDimensions?: string[];
/**
* The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with.
*/
compatibleMetrics?: string[];
/**
* Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#reportingMetadataEntry.
*/
kind?: string;
/**
* The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.
*/
requiredDimensions?: string[];
/**
* The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.
*/
requiredMetrics?: string[];
/**
* The codes of the projects supported by the dimension or metric this reporting metadata entry describes.
*/
supportedProducts?: string[];
}
export interface Schema$SavedAdStyle {
/**
* The AdStyle itself.
*/
adStyle?: Schema$AdStyle;
/**
* Unique identifier of this saved ad style. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#savedAdStyle.
*/
kind?: string;
/**
* The user selected name of this SavedAdStyle.
*/
name?: string;
}
export interface Schema$SavedAdStyles {
/**
* ETag of this response for caching purposes.
*/
etag?: string;
/**
* The saved ad styles returned in this list response.
*/
items?: Schema$SavedAdStyle[];
/**
* Kind of list this is, in this case adsense#savedAdStyles.
*/
kind?: string;
/**
* Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this.
*/
nextPageToken?: string;
}
export interface Schema$SavedReport {
/**
* Unique identifier of this saved report.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#savedReport.
*/
kind?: string;
/**
* This saved report's name.
*/
name?: string;
}
export interface Schema$SavedReports {
/**
* ETag of this response for caching purposes.
*/
etag?: string;
/**
* The saved reports returned in this list response.
*/
items?: Schema$SavedReport[];
/**
* Kind of list this is, in this case adsense#savedReports.
*/
kind?: string;
/**
* Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's "pageToken" value to this.
*/
nextPageToken?: string;
}
export interface Schema$UrlChannel {
/**
* Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.
*/
id?: string;
/**
* Kind of resource this is, in this case adsense#urlChannel.
*/
kind?: string;
/**
* URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home
*/
urlPattern?: string;
}
export interface Schema$UrlChannels {
/**
* ETag of this response for caching purposes.
*/
etag?: string;
/**
* The URL channels returned in this list response.
*/
items?: Schema$UrlChannel[];
/**
* Kind of list this is, in this case adsense#urlChannels.
*/
kind?: string;
/**
* Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this.
*/
nextPageToken?: string;
}
export class Resource$Accounts {
context: APIRequestContext;
adclients: Resource$Accounts$Adclients;
adunits: Resource$Accounts$Adunits;
alerts: Resource$Accounts$Alerts;
customchannels: Resource$Accounts$Customchannels;
payments: Resource$Accounts$Payments;
reports: Resource$Accounts$Reports;
savedadstyles: Resource$Accounts$Savedadstyles;
urlchannels: Resource$Accounts$Urlchannels;
constructor(context: APIRequestContext) {
this.context = context;
this.adclients = new Resource$Accounts$Adclients(this.context);
this.adunits = new Resource$Accounts$Adunits(this.context);
this.alerts = new Resource$Accounts$Alerts(this.context);
this.customchannels = new Resource$Accounts$Customchannels(this.context);
this.payments = new Resource$Accounts$Payments(this.context);
this.reports = new Resource$Accounts$Reports(this.context);
this.savedadstyles = new Resource$Accounts$Savedadstyles(this.context);
this.urlchannels = new Resource$Accounts$Urlchannels(this.context);
}
/**
* adsense.accounts.get
* @desc Get information about the selected AdSense account.
* @alias adsense.accounts.get
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.accountId Account to get information about.
* @param {boolean=} params.tree Whether the tree of sub accounts should be returned.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get(
params?: Params$Resource$Accounts$Get,
options?: MethodOptions
): GaxiosPromise<Schema$Account>;
get(
params: Params$Resource$Accounts$Get,
options: MethodOptions | BodyResponseCallback<Schema$Account>,
callback: BodyResponseCallback<Schema$Account>
): void;
get(
params: Params$Resource$Accounts$Get,
callback: BodyResponseCallback<Schema$Account>
): void;
get(callback: BodyResponseCallback<Schema$Account>): void;
get(
paramsOrCallback?:
| Params$Resource$Accounts$Get
| BodyResponseCallback<Schema$Account>,
optionsOrCallback?: MethodOptions | BodyResponseCallback<Schema$Account>,
callback?: BodyResponseCallback<Schema$Account>
): void | GaxiosPromise<Schema$Account> {
let params = (paramsOrCallback || {}) as Params$Resource$Accounts$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Accounts$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/adsense/v1.4/accounts/{accountId}').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['accountId'],
pathParams: ['accountId'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Account>(parameters, callback);
} else {
return createAPIRequest<Schema$Account>(parameters);
}
}
/**
* adsense.accounts.list
* @desc List all accounts available to this AdSense account.
* @alias adsense.accounts.list
* @memberOf! ()
*
* @param {object=} params Parameters for request
* @param {integer=} params.maxResults The maximum number of accounts to include in the response, used for paging.
* @param {string=} params.pageToken A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list(
params?: Params$Resource$Accounts$List,
options?: MethodOptions
): GaxiosPromise<Schema$Accounts>;
list(
params: Params$Resource$Accounts$List,
options: MethodOptions | BodyResponseCallback<Schema$Accounts>,
callback: BodyResponseCallback<Schema$Accounts>
): void;
list(
params: Params$Resource$Accounts$List,
callback: BodyResponseCallback<Schema$Accounts>
): void;
list(callback: BodyResponseCallback<Schema$Accounts>): void;
list(
paramsOrCallback?:
| Params$Resource$Accounts$List
| BodyResponseCallback<Schema$Accounts>,
optionsOrCallback?: MethodOptions | BodyResponseCallback<Schema$Accounts>,
callback?: BodyResponseCallback<Schema$Accounts>
): void | GaxiosPromise<Schema$Accounts> {
let params = (paramsOrCallback || {}) as Params$Resource$Accounts$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Accounts$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/adsense/v1.4/accounts').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Accounts>(parameters, callback);
} else {
return createAPIRequest<Schema$Accounts>(parameters);
}
}
}
export interface Params$Resource$Accounts$Get extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* Account to get information about.
*/
accountId?: string;
/**
* Whether the tree of sub accounts should be returned.
*/
tree?: boolean;
}
export interface Params$Resource$Accounts$List extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* The maximum number of accounts to include in the response, used for paging.
*/
maxResults?: number;
/**
* A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
*/
pageToken?: string;
}
export class Resource$Accounts$Adclients {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
/**
* adsense.accounts.adclients.getAdCode
* @desc Get Auto ad code for a given ad client.
* @alias adsense.accounts.adclients.getAdCode
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.accountId Account which contains the ad client.
* @param {string} params.adClientId Ad client to get the code for.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getAdCode(
params?: Params$Resource$Accounts$Adclients$Getadcode,
options?: MethodOptions
): GaxiosPromise<Schema$AdCode>;
getAdCode(
params: Params$Resource$Accounts$Adclients$Getadcode,
options: MethodOptions | BodyResponseCallback<Schema$AdCode>,
callback: BodyResponseCallback<Schema$AdCode>
): void;
getAdCode(
params: Params$Resource$Accounts$Adclients$Getadcode,
callback: BodyResponseCallback<Schema$AdCode>
): void;
getAdCode(callback: BodyResponseCallback<Schema$AdCode>): void;
getAdCode(
paramsOrCallback?:
| Params$Resource$Accounts$Adclients$Getadcode
| BodyResponseCallback<Schema$AdCode>,
optionsOrCallback?: MethodOptions | BodyResponseCallback<Schema$AdCode>,
callback?: BodyResponseCallback<Schema$AdCode>
): void | GaxiosPromise<Schema$AdCode> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Accounts$Adclients$Getadcode;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Accounts$Adclients$Getadcode;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (
rootUrl +
'/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adcode'
).replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['accountId', 'adClientId'],
pathParams: ['accountId', 'adClientId'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$AdCode>(parameters, callback);
} else {
return createAPIRequest<Schema$AdCode>(parameters);
}
}
/**
* adsense.accounts.adclients.list
* @desc List all ad clients in the specified account.
* @alias adsense.accounts.adclients.list
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.accountId Account for which to list ad clients.
* @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging.
* @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list(
params?: Params$Resource$Accounts$Adclients$List,
options?: MethodOptions
): GaxiosPromise<Schema$AdClients>;
list(
params: Params$Resource$Accounts$Adclients$List,
options: MethodOptions | BodyResponseCallback<Schema$AdClients>,
callback: BodyResponseCallback<Schema$AdClients>
): void;
list(
params: Params$Resource$Accounts$Adclients$List,
callback: BodyResponseCallback<Schema$AdClients>
): void;
list(callback: BodyResponseCallback<Schema$AdClients>): void;
list(
paramsOrCallback?:
| Params$Resource$Accounts$Adclients$List
| BodyResponseCallback<Schema$AdClients>,
optionsOrCallback?:
| MethodOptions
| BodyResponseCallback<Schema$AdClients>,
callback?: BodyResponseCallback<Schema$AdClients>
): void | GaxiosPromise<Schema$AdClients> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Accounts$Adclients$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Accounts$Adclients$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (
rootUrl + '/adsense/v1.4/accounts/{accountId}/adclients'
).replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['accountId'],
pathParams: ['accountId'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$AdClients>(parameters, callback);
} else {
return createAPIRequest<Schema$AdClients>(parameters);
}
}
}
export interface Params$Resource$Accounts$Adclients$Getadcode
extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* Account which contains the ad client.
*/
accountId?: string;
/**
* Ad client to get the code for.
*/
adClientId?: string;
}
export interface Params$Resource$Accounts$Adclients$List
extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* Account for which to list ad clients.
*/
accountId?: string;
/**
* The maximum number of ad clients to include in the response, used for paging.
*/
maxResults?: number;
/**
* A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
*/
pageToken?: string;
}