@maxim_mazurok/gapi.client.adsenseplatform-v1alpha 0.0.20240709

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +562 -0
  2. package/package.json +20 -0
  3. package/readme.md +75 -0
package/index.d.ts ADDED
@@ -0,0 +1,562 @@
1
+ /* Type definitions for non-npm package AdSense Platform API v1alpha 0.0 */
2
+ // Project: https://developers.google.com/adsense/platforms/
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+
8
+ // IMPORTANT
9
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
+ // Generated from: https://adsenseplatform.googleapis.com/$discovery/rest?version=v1alpha
12
+ // Revision: 20240709
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load AdSense Platform API v1alpha */
18
+ function load(
19
+ urlOrObject: 'https://adsenseplatform.googleapis.com/$discovery/rest?version=v1alpha'
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'adsenseplatform', version: 'v1alpha'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'adsenseplatform',
26
+ version: 'v1alpha',
27
+ callback: () => any
28
+ ): void;
29
+
30
+ namespace adsenseplatform {
31
+ interface Account {
32
+ /** Output only. Creation time of the account. */
33
+ createTime?: string;
34
+ /** Required. An opaque token that uniquely identifies the account among all the platform's accounts. This string may contain at most 64 non-whitespace ASCII characters, but otherwise has no predefined structure. However, it is expected to be a platform-specific identifier for the user creating the account, so that only a single account can be created for any given user. This field must not contain any information that is recognizable as personally identifiable information. e.g. it should not be an email address or login name. Once an account has been created, a second attempt to create an account using the same creation_request_id will result in an ALREADY_EXISTS error. */
35
+ creationRequestId?: string;
36
+ /** Display name of this account. */
37
+ displayName?: string;
38
+ /** Output only. Resource name of the account. Format: platforms/pub-[0-9]+/accounts/pub-[0-9]+ */
39
+ name?: string;
40
+ /** Required. Input only. CLDR region code of the country/region of the address. Set this to country code of the child account if known, otherwise to your own country code. */
41
+ regionCode?: string;
42
+ /** Output only. Approval state of the account. */
43
+ state?: string;
44
+ /** Required. The IANA TZ timezone code of this account. For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. This field is used for reporting. It is recommended to set it to the same value for all child accounts. */
45
+ timeZone?: TimeZone;
46
+ }
47
+ interface Address {
48
+ /** First line of address. Max length 64 bytes or 30 characters. */
49
+ address1?: string;
50
+ /** Second line of address. Max length 64 bytes or 30 characters. */
51
+ address2?: string;
52
+ /** City. Max length 60 bytes or 30 characters. */
53
+ city?: string;
54
+ /** Name of the company. Max length 255 bytes or 34 characters. */
55
+ company?: string;
56
+ /** Contact name of the company. Max length 128 bytes or 34 characters. */
57
+ contact?: string;
58
+ /** Fax number with international code (i.e. +441234567890). */
59
+ fax?: string;
60
+ /** Phone number with international code (i.e. +441234567890). */
61
+ phone?: string;
62
+ /** Country/Region code. The region is specified as a CLDR region code (e.g. "US", "FR"). */
63
+ regionCode?: string;
64
+ /** State. Max length 60 bytes or 30 characters. */
65
+ state?: string;
66
+ /** Zip/post code. Max length 10 bytes or 10 characters. */
67
+ zip?: string;
68
+ }
69
+ interface CloseAccountRequest {}
70
+ interface CloseAccountResponse {}
71
+ interface Empty {}
72
+ interface Event {
73
+ /** Required. Information associated with the event. */
74
+ eventInfo?: EventInfo;
75
+ /** Required. Event timestamp. */
76
+ eventTime?: string;
77
+ /** Required. Event type. */
78
+ eventType?: string;
79
+ }
80
+ interface EventInfo {
81
+ /** The billing address of the publisher associated with this event, if available. */
82
+ billingAddress?: Address;
83
+ /** Required. The email address that is associated with the publisher when performing the event. */
84
+ email?: string;
85
+ }
86
+ interface ListAccountsResponse {
87
+ /** The Accounts returned in the list response. Represented by a partial view of the Account resource, populating `name` and `creation_request_id`. */
88
+ accounts?: Account[];
89
+ /** Continuation token used to page through accounts. To retrieve the next page of the results, set the next request's "page_token" value to this. */
90
+ nextPageToken?: string;
91
+ }
92
+ interface ListSitesResponse {
93
+ /** Continuation token used to page through sites. To retrieve the next page of the results, set the next request's "page_token" value to this. */
94
+ nextPageToken?: string;
95
+ /** The sites returned in this list response. */
96
+ sites?: Site[];
97
+ }
98
+ interface LookupAccountResponse {
99
+ /** The name of the Account Format: platforms/{platform}/accounts/{account_id} */
100
+ name?: string;
101
+ }
102
+ interface RequestSiteReviewResponse {}
103
+ interface Site {
104
+ /** Domain/sub-domain of the site. Must be a valid domain complying with [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt) and formatted as punycode [RFC 3492](https://www.ietf.org/rfc/rfc3492.txt) in case the domain contains unicode characters. */
105
+ domain?: string;
106
+ /** Output only. Resource name of a site. Format: platforms/{platform}/accounts/{account}/sites/{site} */
107
+ name?: string;
108
+ /** Output only. State of a site. */
109
+ state?: string;
110
+ }
111
+ interface TimeZone {
112
+ /** IANA Time Zone Database time zone, e.g. "America/New_York". */
113
+ id?: string;
114
+ /** Optional. IANA Time Zone Database version number, e.g. "2019a". */
115
+ version?: string;
116
+ }
117
+ interface EventsResource {
118
+ /** Creates an account event. */
119
+ create(request: {
120
+ /** V1 error format. */
121
+ '$.xgafv'?: string;
122
+ /** OAuth access token. */
123
+ access_token?: string;
124
+ /** Data format for response. */
125
+ alt?: string;
126
+ /** JSONP */
127
+ callback?: string;
128
+ /** Selector specifying which fields to include in a partial response. */
129
+ fields?: string;
130
+ /** 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. */
131
+ key?: string;
132
+ /** OAuth 2.0 token for the current user. */
133
+ oauth_token?: string;
134
+ /** Required. Account to log events about. Format: platforms/{platform}/accounts/{account} */
135
+ parent: string;
136
+ /** Returns response with indentations and line breaks. */
137
+ prettyPrint?: boolean;
138
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
139
+ quotaUser?: string;
140
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
141
+ upload_protocol?: string;
142
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
143
+ uploadType?: string;
144
+ /** Request body */
145
+ resource: Event;
146
+ }): Request<Event>;
147
+ create(
148
+ request: {
149
+ /** V1 error format. */
150
+ '$.xgafv'?: string;
151
+ /** OAuth access token. */
152
+ access_token?: string;
153
+ /** Data format for response. */
154
+ alt?: string;
155
+ /** JSONP */
156
+ callback?: string;
157
+ /** Selector specifying which fields to include in a partial response. */
158
+ fields?: string;
159
+ /** 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. */
160
+ key?: string;
161
+ /** OAuth 2.0 token for the current user. */
162
+ oauth_token?: string;
163
+ /** Required. Account to log events about. Format: platforms/{platform}/accounts/{account} */
164
+ parent: string;
165
+ /** Returns response with indentations and line breaks. */
166
+ prettyPrint?: boolean;
167
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
168
+ quotaUser?: string;
169
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
170
+ upload_protocol?: string;
171
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
172
+ uploadType?: string;
173
+ },
174
+ body: Event
175
+ ): Request<Event>;
176
+ }
177
+ interface SitesResource {
178
+ /** Creates a site for a specified account. */
179
+ create(request: {
180
+ /** V1 error format. */
181
+ '$.xgafv'?: string;
182
+ /** OAuth access token. */
183
+ access_token?: string;
184
+ /** Data format for response. */
185
+ alt?: string;
186
+ /** JSONP */
187
+ callback?: string;
188
+ /** Selector specifying which fields to include in a partial response. */
189
+ fields?: string;
190
+ /** 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. */
191
+ key?: string;
192
+ /** OAuth 2.0 token for the current user. */
193
+ oauth_token?: string;
194
+ /** Required. Account to create site. Format: platforms/{platform}/accounts/{account_id} */
195
+ parent: string;
196
+ /** Returns response with indentations and line breaks. */
197
+ prettyPrint?: boolean;
198
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
199
+ quotaUser?: string;
200
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
201
+ upload_protocol?: string;
202
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
203
+ uploadType?: string;
204
+ /** Request body */
205
+ resource: Site;
206
+ }): Request<Site>;
207
+ create(
208
+ request: {
209
+ /** V1 error format. */
210
+ '$.xgafv'?: string;
211
+ /** OAuth access token. */
212
+ access_token?: string;
213
+ /** Data format for response. */
214
+ alt?: string;
215
+ /** JSONP */
216
+ callback?: string;
217
+ /** Selector specifying which fields to include in a partial response. */
218
+ fields?: string;
219
+ /** 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. */
220
+ key?: string;
221
+ /** OAuth 2.0 token for the current user. */
222
+ oauth_token?: string;
223
+ /** Required. Account to create site. Format: platforms/{platform}/accounts/{account_id} */
224
+ parent: string;
225
+ /** Returns response with indentations and line breaks. */
226
+ prettyPrint?: boolean;
227
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
228
+ quotaUser?: string;
229
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
230
+ upload_protocol?: string;
231
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
232
+ uploadType?: string;
233
+ },
234
+ body: Site
235
+ ): Request<Site>;
236
+ /** Deletes a site from a specified account. */
237
+ delete(request?: {
238
+ /** V1 error format. */
239
+ '$.xgafv'?: string;
240
+ /** OAuth access token. */
241
+ access_token?: string;
242
+ /** Data format for response. */
243
+ alt?: string;
244
+ /** JSONP */
245
+ callback?: string;
246
+ /** Selector specifying which fields to include in a partial response. */
247
+ fields?: string;
248
+ /** 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. */
249
+ key?: string;
250
+ /** Required. The name of the site to delete. Format: platforms/{platform}/accounts/{account}/sites/{site} */
251
+ name: string;
252
+ /** OAuth 2.0 token for the current user. */
253
+ oauth_token?: string;
254
+ /** Returns response with indentations and line breaks. */
255
+ prettyPrint?: boolean;
256
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
257
+ quotaUser?: string;
258
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
259
+ upload_protocol?: string;
260
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
261
+ uploadType?: string;
262
+ }): Request<{}>;
263
+ /** Gets a site from a specified sub-account. */
264
+ get(request?: {
265
+ /** V1 error format. */
266
+ '$.xgafv'?: string;
267
+ /** OAuth access token. */
268
+ access_token?: string;
269
+ /** Data format for response. */
270
+ alt?: string;
271
+ /** JSONP */
272
+ callback?: string;
273
+ /** Selector specifying which fields to include in a partial response. */
274
+ fields?: string;
275
+ /** 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. */
276
+ key?: string;
277
+ /** Required. The name of the site to retrieve. Format: platforms/{platform}/accounts/{account}/sites/{site} */
278
+ name: string;
279
+ /** OAuth 2.0 token for the current user. */
280
+ oauth_token?: string;
281
+ /** Returns response with indentations and line breaks. */
282
+ prettyPrint?: boolean;
283
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
284
+ quotaUser?: string;
285
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
286
+ upload_protocol?: string;
287
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
288
+ uploadType?: string;
289
+ }): Request<Site>;
290
+ /** Lists sites for a specific account. */
291
+ list(request?: {
292
+ /** V1 error format. */
293
+ '$.xgafv'?: string;
294
+ /** OAuth access token. */
295
+ access_token?: string;
296
+ /** Data format for response. */
297
+ alt?: string;
298
+ /** JSONP */
299
+ callback?: string;
300
+ /** Selector specifying which fields to include in a partial response. */
301
+ fields?: string;
302
+ /** 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. */
303
+ key?: string;
304
+ /** OAuth 2.0 token for the current user. */
305
+ oauth_token?: string;
306
+ /** The maximum number of sites to include in the response, used for paging. If unspecified, at most 10000 sites will be returned. The maximum value is 10000; values above 10000 will be coerced to 10000. */
307
+ pageSize?: number;
308
+ /** A page token, received from a previous `ListSites` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSites` must match the call that provided the page token. */
309
+ pageToken?: string;
310
+ /** Required. The account which owns the sites. Format: platforms/{platform}/accounts/{account} */
311
+ parent: string;
312
+ /** Returns response with indentations and line breaks. */
313
+ prettyPrint?: boolean;
314
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
315
+ quotaUser?: string;
316
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
317
+ upload_protocol?: string;
318
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
319
+ uploadType?: string;
320
+ }): Request<ListSitesResponse>;
321
+ /** Requests the review of a site. The site should be in REQUIRES_REVIEW or NEEDS_ATTENTION state. Note: Make sure you place an [ad tag](https://developers.google.com/adsense/platforms/direct/ad-tags) on your site before requesting a review. */
322
+ requestReview(request?: {
323
+ /** V1 error format. */
324
+ '$.xgafv'?: string;
325
+ /** OAuth access token. */
326
+ access_token?: string;
327
+ /** Data format for response. */
328
+ alt?: string;
329
+ /** JSONP */
330
+ callback?: string;
331
+ /** Selector specifying which fields to include in a partial response. */
332
+ fields?: string;
333
+ /** 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. */
334
+ key?: string;
335
+ /** Required. The name of the site to submit for review. Format: platforms/{platform}/accounts/{account}/sites/{site} */
336
+ name: string;
337
+ /** OAuth 2.0 token for the current user. */
338
+ oauth_token?: string;
339
+ /** Returns response with indentations and line breaks. */
340
+ prettyPrint?: boolean;
341
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
342
+ quotaUser?: string;
343
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
344
+ upload_protocol?: string;
345
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
346
+ uploadType?: string;
347
+ }): Request<{}>;
348
+ }
349
+ interface AccountsResource {
350
+ /** Closes a sub-account. */
351
+ close(request: {
352
+ /** V1 error format. */
353
+ '$.xgafv'?: string;
354
+ /** OAuth access token. */
355
+ access_token?: string;
356
+ /** Data format for response. */
357
+ alt?: string;
358
+ /** JSONP */
359
+ callback?: string;
360
+ /** Selector specifying which fields to include in a partial response. */
361
+ fields?: string;
362
+ /** 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. */
363
+ key?: string;
364
+ /** Required. Account to close. Format: platforms/{platform}/accounts/{account_id} */
365
+ name: string;
366
+ /** OAuth 2.0 token for the current user. */
367
+ oauth_token?: string;
368
+ /** Returns response with indentations and line breaks. */
369
+ prettyPrint?: boolean;
370
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
371
+ quotaUser?: string;
372
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
373
+ upload_protocol?: string;
374
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
375
+ uploadType?: string;
376
+ /** Request body */
377
+ resource: CloseAccountRequest;
378
+ }): Request<{}>;
379
+ close(
380
+ request: {
381
+ /** V1 error format. */
382
+ '$.xgafv'?: string;
383
+ /** OAuth access token. */
384
+ access_token?: string;
385
+ /** Data format for response. */
386
+ alt?: string;
387
+ /** JSONP */
388
+ callback?: string;
389
+ /** Selector specifying which fields to include in a partial response. */
390
+ fields?: string;
391
+ /** 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. */
392
+ key?: string;
393
+ /** Required. Account to close. Format: platforms/{platform}/accounts/{account_id} */
394
+ name: string;
395
+ /** OAuth 2.0 token for the current user. */
396
+ oauth_token?: string;
397
+ /** Returns response with indentations and line breaks. */
398
+ prettyPrint?: boolean;
399
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
400
+ quotaUser?: string;
401
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
402
+ upload_protocol?: string;
403
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
404
+ uploadType?: string;
405
+ },
406
+ body: CloseAccountRequest
407
+ ): Request<{}>;
408
+ /** Creates a sub-account. */
409
+ create(request: {
410
+ /** V1 error format. */
411
+ '$.xgafv'?: string;
412
+ /** OAuth access token. */
413
+ access_token?: string;
414
+ /** Data format for response. */
415
+ alt?: string;
416
+ /** JSONP */
417
+ callback?: string;
418
+ /** Selector specifying which fields to include in a partial response. */
419
+ fields?: string;
420
+ /** 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. */
421
+ key?: string;
422
+ /** OAuth 2.0 token for the current user. */
423
+ oauth_token?: string;
424
+ /** Required. Platform to create an account for. Format: platforms/{platform} */
425
+ parent: string;
426
+ /** Returns response with indentations and line breaks. */
427
+ prettyPrint?: boolean;
428
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
429
+ quotaUser?: string;
430
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
431
+ upload_protocol?: string;
432
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
433
+ uploadType?: string;
434
+ /** Request body */
435
+ resource: Account;
436
+ }): Request<Account>;
437
+ create(
438
+ request: {
439
+ /** V1 error format. */
440
+ '$.xgafv'?: string;
441
+ /** OAuth access token. */
442
+ access_token?: string;
443
+ /** Data format for response. */
444
+ alt?: string;
445
+ /** JSONP */
446
+ callback?: string;
447
+ /** Selector specifying which fields to include in a partial response. */
448
+ fields?: string;
449
+ /** 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. */
450
+ key?: string;
451
+ /** OAuth 2.0 token for the current user. */
452
+ oauth_token?: string;
453
+ /** Required. Platform to create an account for. Format: platforms/{platform} */
454
+ parent: string;
455
+ /** Returns response with indentations and line breaks. */
456
+ prettyPrint?: boolean;
457
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
458
+ quotaUser?: string;
459
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
460
+ upload_protocol?: string;
461
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
462
+ uploadType?: string;
463
+ },
464
+ body: Account
465
+ ): Request<Account>;
466
+ /** Gets information about the selected sub-account. */
467
+ get(request?: {
468
+ /** V1 error format. */
469
+ '$.xgafv'?: string;
470
+ /** OAuth access token. */
471
+ access_token?: string;
472
+ /** Data format for response. */
473
+ alt?: string;
474
+ /** JSONP */
475
+ callback?: string;
476
+ /** Selector specifying which fields to include in a partial response. */
477
+ fields?: string;
478
+ /** 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. */
479
+ key?: string;
480
+ /** Required. Account to get information about. Format: platforms/{platform}/accounts/{account_id} */
481
+ name: string;
482
+ /** OAuth 2.0 token for the current user. */
483
+ oauth_token?: string;
484
+ /** Returns response with indentations and line breaks. */
485
+ prettyPrint?: boolean;
486
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
487
+ quotaUser?: string;
488
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
489
+ upload_protocol?: string;
490
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
491
+ uploadType?: string;
492
+ }): Request<Account>;
493
+ /** Lists a partial view of sub-accounts for a specific parent account. */
494
+ list(request?: {
495
+ /** V1 error format. */
496
+ '$.xgafv'?: string;
497
+ /** OAuth access token. */
498
+ access_token?: string;
499
+ /** Data format for response. */
500
+ alt?: string;
501
+ /** JSONP */
502
+ callback?: string;
503
+ /** Selector specifying which fields to include in a partial response. */
504
+ fields?: string;
505
+ /** 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. */
506
+ key?: string;
507
+ /** OAuth 2.0 token for the current user. */
508
+ oauth_token?: string;
509
+ /** Optional. The maximum number of accounts to include in the response, used for paging. If unspecified, at most 10000 accounts will be returned. The maximum value is 10000; values above 10000 will be coerced to 10000. */
510
+ pageSize?: number;
511
+ /** Optional. A page token, received from a previous `ListAccounts` call. Provide this to retrieve the subsequent page. */
512
+ pageToken?: string;
513
+ /** Required. Platform who parents the accounts. Format: platforms/{platform} */
514
+ parent: string;
515
+ /** Returns response with indentations and line breaks. */
516
+ prettyPrint?: boolean;
517
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
518
+ quotaUser?: string;
519
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
520
+ upload_protocol?: string;
521
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
522
+ uploadType?: string;
523
+ }): Request<ListAccountsResponse>;
524
+ /** Looks up information about a sub-account for a specified creation_request_id. If no account exists for the given creation_request_id, returns 404. */
525
+ lookup(request?: {
526
+ /** V1 error format. */
527
+ '$.xgafv'?: string;
528
+ /** OAuth access token. */
529
+ access_token?: string;
530
+ /** Data format for response. */
531
+ alt?: string;
532
+ /** JSONP */
533
+ callback?: string;
534
+ /** Optional. The creation_request_id provided when calling createAccount. */
535
+ creationRequestId?: string;
536
+ /** Selector specifying which fields to include in a partial response. */
537
+ fields?: string;
538
+ /** 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. */
539
+ key?: string;
540
+ /** OAuth 2.0 token for the current user. */
541
+ oauth_token?: string;
542
+ /** Required. Platform who parents the account. Format: platforms/{platform} */
543
+ parent: string;
544
+ /** Returns response with indentations and line breaks. */
545
+ prettyPrint?: boolean;
546
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
547
+ quotaUser?: string;
548
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
549
+ upload_protocol?: string;
550
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
551
+ uploadType?: string;
552
+ }): Request<LookupAccountResponse>;
553
+ events: EventsResource;
554
+ sites: SitesResource;
555
+ }
556
+ interface PlatformsResource {
557
+ accounts: AccountsResource;
558
+ }
559
+
560
+ const platforms: PlatformsResource;
561
+ }
562
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.adsenseplatform-v1alpha",
3
+ "version": "0.0.20240709",
4
+ "description": "TypeScript typings for AdSense Platform API v1alpha",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
13
+ "url": "https://maxim.mazurok.com"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery-v1": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,75 @@
1
+ # TypeScript typings for AdSense Platform API v1alpha
2
+
3
+ For detailed description please check [documentation](https://developers.google.com/adsense/platforms/).
4
+
5
+ ## Installing
6
+
7
+ Install typings for AdSense Platform API:
8
+
9
+ ```
10
+ npm install @types/gapi.client.adsenseplatform-v1alpha --save-dev
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ You need to initialize Google API client in your code:
16
+
17
+ ```typescript
18
+ gapi.load('client', () => {
19
+ // now we can use gapi.client
20
+ // ...
21
+ });
22
+ ```
23
+
24
+ Then load api client wrapper:
25
+
26
+ ```typescript
27
+ gapi.client.load(
28
+ 'https://adsenseplatform.googleapis.com/$discovery/rest?version=v1alpha',
29
+ () => {
30
+ // now we can use:
31
+ // gapi.client.adsenseplatform
32
+ }
33
+ );
34
+ ```
35
+
36
+ ```typescript
37
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
38
+ gapi.client.load('adsenseplatform', 'v1alpha', () => {
39
+ // now we can use:
40
+ // gapi.client.adsenseplatform
41
+ });
42
+ ```
43
+
44
+ Don't forget to authenticate your client before sending any request to resources:
45
+
46
+ ```typescript
47
+ // declare client_id registered in Google Developers Console
48
+ var client_id = '',
49
+ scope = [
50
+ // View and manage your AdSense data
51
+ 'https://www.googleapis.com/auth/adsense',
52
+
53
+ // View your AdSense data
54
+ 'https://www.googleapis.com/auth/adsense.readonly',
55
+ ],
56
+ immediate = true;
57
+ // ...
58
+
59
+ gapi.auth.authorize(
60
+ {client_id: client_id, scope: scope, immediate: immediate},
61
+ authResult => {
62
+ if (authResult && !authResult.error) {
63
+ /* handle successful authorization */
64
+ } else {
65
+ /* handle authorization error */
66
+ }
67
+ }
68
+ );
69
+ ```
70
+
71
+ After that you can use AdSense Platform API resources: <!-- TODO: make this work for multiple namespaces -->
72
+
73
+ ```typescript
74
+
75
+ ```