@maxim_mazurok/gapi.client.admob-v1 0.0.20220811

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.
package/index.d.ts ADDED
@@ -0,0 +1,543 @@
1
+ /* Type definitions for non-npm package AdMob API v1 0.0 */
2
+ // Project: https://developers.google.com/admob/api/
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
+ // TypeScript Version: 2.8
8
+
9
+ // IMPORTANT
10
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
11
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
12
+ // Generated from: https://admob.googleapis.com/$discovery/rest?version=v1
13
+ // Revision: 20220811
14
+
15
+ /// <reference types="gapi.client" />
16
+
17
+ declare namespace gapi.client {
18
+ /** Load AdMob API v1 */
19
+ function load(urlOrObject: "https://admob.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
20
+ /** @deprecated Please load APIs with discovery documents. */
21
+ function load(name: "admob", version: "v1"): Promise<void>;
22
+ /** @deprecated Please load APIs with discovery documents. */
23
+ function load(name: "admob", version: "v1", callback: () => any): void;
24
+
25
+ namespace admob {
26
+ interface AdUnit {
27
+ /**
28
+ * AdFormat of the ad unit. Possible values are as follows: "BANNER" - Banner ad format. "BANNER_INTERSTITIAL" - Legacy format that can be used as either banner or interstitial. This
29
+ * format can no longer be created but can be targeted by mediation groups. "INTERSTITIAL" - A full screen ad. Supported ad types are "RICH_MEDIA" and "VIDEO". "NATIVE" - Native ad
30
+ * format. "REWARDED" - An ad that, once viewed, gets a callback verifying the view so that a reward can be given to the user. Supported ad types are "RICH_MEDIA" (interactive) and
31
+ * video where video can not be excluded.
32
+ */
33
+ adFormat?: string;
34
+ /** Ad media type supported by this ad unit. Possible values as follows: "RICH_MEDIA" - Text, image, and other non-video media. "VIDEO" - Video media. */
35
+ adTypes?: string[];
36
+ /** The externally visible ID of the ad unit which can be used to integrate with the AdMob SDK. This is a read only property. Example: ca-app-pub-9876543210987654/0123456789 */
37
+ adUnitId?: string;
38
+ /** The externally visible ID of the app this ad unit is associated with. Example: ca-app-pub-9876543210987654~0123456789 */
39
+ appId?: string;
40
+ /** The display name of the ad unit as shown in the AdMob UI, which is provided by the user. The maximum length allowed is 80 characters. */
41
+ displayName?: string;
42
+ /** Resource name for this ad unit. Format is accounts/{publisher_id}/adUnits/{ad_unit_id_fragment} Example: accounts/pub-9876543210987654/adUnits/0123456789 */
43
+ name?: string;
44
+ }
45
+ interface App {
46
+ /** The externally visible ID of the app which can be used to integrate with the AdMob SDK. This is a read only property. Example: ca-app-pub-9876543210987654~0123456789 */
47
+ appId?: string;
48
+ /** Immutable. The information for an app that is linked to an app store. This field is present if and only if the app is linked to an app store. */
49
+ linkedAppInfo?: AppLinkedAppInfo;
50
+ /**
51
+ * The information for an app that is not linked to any app store. After an app is linked, this information is still retrivable. If no name is provided for the app upon creation, a
52
+ * placeholder name will be used.
53
+ */
54
+ manualAppInfo?: AppManualAppInfo;
55
+ /** Resource name for this app. Format is accounts/{publisher_id}/apps/{app_id_fragment} Example: accounts/pub-9876543210987654/apps/0123456789 */
56
+ name?: string;
57
+ /** Describes the platform of the app. Limited to "IOS" and "ANDROID". */
58
+ platform?: string;
59
+ }
60
+ interface AppLinkedAppInfo {
61
+ /**
62
+ * The app store ID of the app; present if and only if the app is linked to an app store. If the app is added to the Google Play store, it will be the application ID of the app. For
63
+ * example: "com.example.myapp". See https://developer.android.com/studio/build/application-id. If the app is added to the Apple App Store, it will be app store ID. For example
64
+ * "105169111". Note that setting the app store id is considered an irreversible action. Once an app is linked, it cannot be unlinked.
65
+ */
66
+ appStoreId?: string;
67
+ /** Output only. Display name of the app as it appears in the app store. This is an output-only field, and may be empty if the app cannot be found in the store. */
68
+ displayName?: string;
69
+ }
70
+ interface AppManualAppInfo {
71
+ /** The display name of the app as shown in the AdMob UI, which is provided by the user. The maximum length allowed is 80 characters. */
72
+ displayName?: string;
73
+ }
74
+ interface Date {
75
+ /** Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */
76
+ day?: number;
77
+ /** Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */
78
+ month?: number;
79
+ /** Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */
80
+ year?: number;
81
+ }
82
+ interface DateRange {
83
+ /** End date of the date range, inclusive. Must be greater than or equal to the start date. */
84
+ endDate?: Date;
85
+ /** Start date of the date range, inclusive. Must be less than or equal to the end date. */
86
+ startDate?: Date;
87
+ }
88
+ interface GenerateMediationReportRequest {
89
+ /** Network report specification. */
90
+ reportSpec?: MediationReportSpec;
91
+ }
92
+ interface GenerateMediationReportResponse {
93
+ /** Additional information about the generated report, such as warnings about the data. */
94
+ footer?: ReportFooter;
95
+ /** Report generation settings that describes the report contents, such as the report date range and localization settings. */
96
+ header?: ReportHeader;
97
+ /** Actual report data. */
98
+ row?: ReportRow;
99
+ }
100
+ interface GenerateNetworkReportRequest {
101
+ /** Network report specification. */
102
+ reportSpec?: NetworkReportSpec;
103
+ }
104
+ interface GenerateNetworkReportResponse {
105
+ /** Additional information about the generated report, such as warnings about the data. */
106
+ footer?: ReportFooter;
107
+ /** Report generation settings that describes the report contents, such as the report date range and localization settings. */
108
+ header?: ReportHeader;
109
+ /** Actual report data. */
110
+ row?: ReportRow;
111
+ }
112
+ interface ListAdUnitsResponse {
113
+ /** The resulting ad units for the requested account. */
114
+ adUnits?: AdUnit[];
115
+ /** If not empty, indicates that there may be more ad units for the request; this value should be passed in a new `ListAdUnitsRequest`. */
116
+ nextPageToken?: string;
117
+ }
118
+ interface ListAppsResponse {
119
+ /** The resulting apps for the requested account. */
120
+ apps?: App[];
121
+ /** If not empty, indicates that there may be more apps for the request; this value should be passed in a new `ListAppsRequest`. */
122
+ nextPageToken?: string;
123
+ }
124
+ interface ListPublisherAccountsResponse {
125
+ /** Publisher that the client credentials can access. */
126
+ account?: PublisherAccount[];
127
+ /** If not empty, indicates that there might be more accounts for the request; you must pass this value in a new `ListPublisherAccountsRequest`. */
128
+ nextPageToken?: string;
129
+ }
130
+ interface LocalizationSettings {
131
+ /**
132
+ * Currency code of the earning related metrics, which is the 3-letter code defined in ISO 4217. The daily average rate is used for the currency conversion. Defaults to the account
133
+ * currency code if unspecified.
134
+ */
135
+ currencyCode?: string;
136
+ /** Language used for any localized text, such as some dimension value display labels. The language tag defined in the IETF BCP47. Defaults to 'en-US' if unspecified. */
137
+ languageCode?: string;
138
+ }
139
+ interface MediationReportSpec {
140
+ /** The date range for which the report is generated. */
141
+ dateRange?: DateRange;
142
+ /** Describes which report rows to match based on their dimension values. */
143
+ dimensionFilters?: MediationReportSpecDimensionFilter[];
144
+ /**
145
+ * List of dimensions of the report. The value combination of these dimensions determines the row of the report. If no dimensions are specified, the report returns a single row of
146
+ * requested metrics for the entire account.
147
+ */
148
+ dimensions?: string[];
149
+ /** Localization settings of the report. */
150
+ localizationSettings?: LocalizationSettings;
151
+ /**
152
+ * Maximum number of report data rows to return. If the value is not set, the API returns as many rows as possible, up to 100000. Acceptable values are 1-100000, inclusive. Values
153
+ * larger than 100000 return an error.
154
+ */
155
+ maxReportRows?: number;
156
+ /** List of metrics of the report. A report must specify at least one metric. */
157
+ metrics?: string[];
158
+ /**
159
+ * Describes the sorting of report rows. The order of the condition in the list defines its precedence; the earlier the condition, the higher its precedence. If no sort conditions are
160
+ * specified, the row ordering is undefined.
161
+ */
162
+ sortConditions?: MediationReportSpecSortCondition[];
163
+ /**
164
+ * A report time zone. Accepts an IANA TZ name values, such as "America/Los_Angeles." If no time zone is defined, the account default takes effect. Check default value by the get
165
+ * account action. **Warning:** The "America/Los_Angeles" is the only supported value at the moment.
166
+ */
167
+ timeZone?: string;
168
+ }
169
+ interface MediationReportSpecDimensionFilter {
170
+ /** Applies the filter criterion to the specified dimension. */
171
+ dimension?: string;
172
+ /** Matches a row if its value for the specified dimension is in one of the values specified in this condition. */
173
+ matchesAny?: StringList;
174
+ }
175
+ interface MediationReportSpecSortCondition {
176
+ /** Sort by the specified dimension. */
177
+ dimension?: string;
178
+ /** Sort by the specified metric. */
179
+ metric?: string;
180
+ /** Sorting order of the dimension or metric. */
181
+ order?: string;
182
+ }
183
+ interface NetworkReportSpec {
184
+ /** The date range for which the report is generated. */
185
+ dateRange?: DateRange;
186
+ /** Describes which report rows to match based on their dimension values. */
187
+ dimensionFilters?: NetworkReportSpecDimensionFilter[];
188
+ /**
189
+ * List of dimensions of the report. The value combination of these dimensions determines the row of the report. If no dimensions are specified, the report returns a single row of
190
+ * requested metrics for the entire account.
191
+ */
192
+ dimensions?: string[];
193
+ /** Localization settings of the report. */
194
+ localizationSettings?: LocalizationSettings;
195
+ /**
196
+ * Maximum number of report data rows to return. If the value is not set, the API returns as many rows as possible, up to 100000. Acceptable values are 1-100000, inclusive. Values
197
+ * larger than 100000 return an error.
198
+ */
199
+ maxReportRows?: number;
200
+ /** List of metrics of the report. A report must specify at least one metric. */
201
+ metrics?: string[];
202
+ /**
203
+ * Describes the sorting of report rows. The order of the condition in the list defines its precedence; the earlier the condition, the higher its precedence. If no sort conditions are
204
+ * specified, the row ordering is undefined.
205
+ */
206
+ sortConditions?: NetworkReportSpecSortCondition[];
207
+ /**
208
+ * A report time zone. Accepts an IANA TZ name values, such as "America/Los_Angeles." If no time zone is defined, the account default takes effect. Check default value by the get
209
+ * account action. **Warning:** The "America/Los_Angeles" is the only supported value at the moment.
210
+ */
211
+ timeZone?: string;
212
+ }
213
+ interface NetworkReportSpecDimensionFilter {
214
+ /** Applies the filter criterion to the specified dimension. */
215
+ dimension?: string;
216
+ /** Matches a row if its value for the specified dimension is in one of the values specified in this condition. */
217
+ matchesAny?: StringList;
218
+ }
219
+ interface NetworkReportSpecSortCondition {
220
+ /** Sort by the specified dimension. */
221
+ dimension?: string;
222
+ /** Sort by the specified metric. */
223
+ metric?: string;
224
+ /** Sorting order of the dimension or metric. */
225
+ order?: string;
226
+ }
227
+ interface PublisherAccount {
228
+ /** Currency code of the earning-related metrics, which is the 3-letter code defined in ISO 4217. The daily average rate is used for the currency conversion. */
229
+ currencyCode?: string;
230
+ /** Resource name of this account. Format is accounts/{publisher_id}. */
231
+ name?: string;
232
+ /** The unique ID by which this publisher account can be identified in the API requests (for example, pub-1234567890). */
233
+ publisherId?: string;
234
+ /** The time zone that is used in reports that are generated for this account. The value is a time-zone ID as specified by the CLDR project, for example, "America/Los_Angeles". */
235
+ reportingTimeZone?: string;
236
+ }
237
+ interface ReportFooter {
238
+ /**
239
+ * Total number of rows that matched the request. Warning: This count does NOT always match the number of rows in the response. Do not make that assumption when processing the
240
+ * response.
241
+ */
242
+ matchingRowCount?: string;
243
+ /** Warnings associated with generation of the report. */
244
+ warnings?: ReportWarning[];
245
+ }
246
+ interface ReportHeader {
247
+ /** The date range for which the report is generated. This is identical to the range specified in the report request. */
248
+ dateRange?: DateRange;
249
+ /** Localization settings of the report. This is identical to the settings in the report request. */
250
+ localizationSettings?: LocalizationSettings;
251
+ /** The report time zone. The value is a time-zone ID as specified by the CLDR project, for example, "America/Los_Angeles". */
252
+ reportingTimeZone?: string;
253
+ }
254
+ interface ReportRow {
255
+ /** Map of dimension values in a row, with keys as enum name of the dimensions. */
256
+ dimensionValues?: { [P in string]: ReportRowDimensionValue };
257
+ /** Map of metric values in a row, with keys as enum name of the metrics. If a metric being requested has no value returned, the map will not include it. */
258
+ metricValues?: { [P in string]: ReportRowMetricValue };
259
+ }
260
+ interface ReportRowDimensionValue {
261
+ /** The localized string representation of the value. If unspecified, the display label should be derived from the value. */
262
+ displayLabel?: string;
263
+ /** Dimension value in the format specified in the report's spec Dimension enum. */
264
+ value?: string;
265
+ }
266
+ interface ReportRowMetricValue {
267
+ /** Double precision (approximate) decimal values. Rates are from 0 to 1. */
268
+ doubleValue?: number;
269
+ /** Metric integer value. */
270
+ integerValue?: string;
271
+ /**
272
+ * Amount in micros. One million is equivalent to one unit. Currency value is in the unit (USD, EUR or other) specified by the request. For example, $6.50 whould be represented as
273
+ * 6500000 micros.
274
+ */
275
+ microsValue?: string;
276
+ }
277
+ interface ReportWarning {
278
+ /** Describes the details of the warning message, in English. */
279
+ description?: string;
280
+ /** Type of the warning. */
281
+ type?: string;
282
+ }
283
+ interface StringList {
284
+ /** The string values. */
285
+ values?: string[];
286
+ }
287
+ interface AdUnitsResource {
288
+ /** List the ad units under the specified AdMob account. */
289
+ list(request?: {
290
+ /** V1 error format. */
291
+ "$.xgafv"?: string;
292
+ /** OAuth access token. */
293
+ access_token?: string;
294
+ /** Data format for response. */
295
+ alt?: string;
296
+ /** JSONP */
297
+ callback?: string;
298
+ /** Selector specifying which fields to include in a partial response. */
299
+ fields?: string;
300
+ /** 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. */
301
+ key?: string;
302
+ /** OAuth 2.0 token for the current user. */
303
+ oauth_token?: string;
304
+ /**
305
+ * The maximum number of ad units to return. If unspecified or 0, at most 10,000 ad units will be returned. The maximum value is 20,000; values above 20,000 will be coerced to
306
+ * 20,000.
307
+ */
308
+ pageSize?: number;
309
+ /**
310
+ * The value returned by the last `ListAdUnitsResponse`; indicates that this is a continuation of a prior `ListAdUnits` call, and that the system should return the next page of
311
+ * data.
312
+ */
313
+ pageToken?: string;
314
+ /** Required. Resource name of the account to list ad units for. Example: accounts/pub-9876543210987654 */
315
+ parent: string;
316
+ /** Returns response with indentations and line breaks. */
317
+ prettyPrint?: boolean;
318
+ /** 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. */
319
+ quotaUser?: string;
320
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
321
+ upload_protocol?: string;
322
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
323
+ uploadType?: string;
324
+ }): Request<ListAdUnitsResponse>;
325
+ }
326
+ interface AppsResource {
327
+ /** List the apps under the specified AdMob account. */
328
+ list(request?: {
329
+ /** V1 error format. */
330
+ "$.xgafv"?: string;
331
+ /** OAuth access token. */
332
+ access_token?: string;
333
+ /** Data format for response. */
334
+ alt?: string;
335
+ /** JSONP */
336
+ callback?: string;
337
+ /** Selector specifying which fields to include in a partial response. */
338
+ fields?: string;
339
+ /** 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. */
340
+ key?: string;
341
+ /** OAuth 2.0 token for the current user. */
342
+ oauth_token?: string;
343
+ /** The maximum number of apps to return. If unspecified or 0, at most 10,000 apps will be returned. The maximum value is 20,000; values above 20,000 will be coerced to 20,000. */
344
+ pageSize?: number;
345
+ /** The value returned by the last `ListAppsResponse`; indicates that this is a continuation of a prior `ListApps` call, and that the system should return the next page of data. */
346
+ pageToken?: string;
347
+ /** Required. Resource name of the account to list apps for. Example: accounts/pub-9876543210987654 */
348
+ parent: string;
349
+ /** Returns response with indentations and line breaks. */
350
+ prettyPrint?: boolean;
351
+ /** 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. */
352
+ quotaUser?: string;
353
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
354
+ upload_protocol?: string;
355
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
356
+ uploadType?: string;
357
+ }): Request<ListAppsResponse>;
358
+ }
359
+ interface MediationReportResource {
360
+ /** Generates an AdMob Mediation report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses. */
361
+ generate(request: {
362
+ /** V1 error format. */
363
+ "$.xgafv"?: string;
364
+ /** OAuth access token. */
365
+ access_token?: string;
366
+ /** Data format for response. */
367
+ alt?: string;
368
+ /** JSONP */
369
+ callback?: string;
370
+ /** Selector specifying which fields to include in a partial response. */
371
+ fields?: string;
372
+ /** 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. */
373
+ key?: string;
374
+ /** OAuth 2.0 token for the current user. */
375
+ oauth_token?: string;
376
+ /** Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 */
377
+ parent: string;
378
+ /** Returns response with indentations and line breaks. */
379
+ prettyPrint?: boolean;
380
+ /** 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. */
381
+ quotaUser?: string;
382
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
383
+ upload_protocol?: string;
384
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
385
+ uploadType?: string;
386
+ /** Request body */
387
+ resource: GenerateMediationReportRequest;
388
+ }): Request<GenerateMediationReportResponse>;
389
+ generate(request: {
390
+ /** V1 error format. */
391
+ "$.xgafv"?: string;
392
+ /** OAuth access token. */
393
+ access_token?: string;
394
+ /** Data format for response. */
395
+ alt?: string;
396
+ /** JSONP */
397
+ callback?: string;
398
+ /** Selector specifying which fields to include in a partial response. */
399
+ fields?: string;
400
+ /** 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. */
401
+ key?: string;
402
+ /** OAuth 2.0 token for the current user. */
403
+ oauth_token?: string;
404
+ /** Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 */
405
+ parent: string;
406
+ /** Returns response with indentations and line breaks. */
407
+ prettyPrint?: boolean;
408
+ /** 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. */
409
+ quotaUser?: string;
410
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
411
+ upload_protocol?: string;
412
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
413
+ uploadType?: string;
414
+ },
415
+ body: GenerateMediationReportRequest): Request<GenerateMediationReportResponse>;
416
+ }
417
+ interface NetworkReportResource {
418
+ /** Generates an AdMob Network report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses. */
419
+ generate(request: {
420
+ /** V1 error format. */
421
+ "$.xgafv"?: string;
422
+ /** OAuth access token. */
423
+ access_token?: string;
424
+ /** Data format for response. */
425
+ alt?: string;
426
+ /** JSONP */
427
+ callback?: string;
428
+ /** Selector specifying which fields to include in a partial response. */
429
+ fields?: string;
430
+ /** 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. */
431
+ key?: string;
432
+ /** OAuth 2.0 token for the current user. */
433
+ oauth_token?: string;
434
+ /** Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 */
435
+ parent: string;
436
+ /** Returns response with indentations and line breaks. */
437
+ prettyPrint?: boolean;
438
+ /** 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. */
439
+ quotaUser?: string;
440
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
441
+ upload_protocol?: string;
442
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
443
+ uploadType?: string;
444
+ /** Request body */
445
+ resource: GenerateNetworkReportRequest;
446
+ }): Request<GenerateNetworkReportResponse>;
447
+ generate(request: {
448
+ /** V1 error format. */
449
+ "$.xgafv"?: string;
450
+ /** OAuth access token. */
451
+ access_token?: string;
452
+ /** Data format for response. */
453
+ alt?: string;
454
+ /** JSONP */
455
+ callback?: string;
456
+ /** Selector specifying which fields to include in a partial response. */
457
+ fields?: string;
458
+ /** 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. */
459
+ key?: string;
460
+ /** OAuth 2.0 token for the current user. */
461
+ oauth_token?: string;
462
+ /** Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 */
463
+ parent: string;
464
+ /** Returns response with indentations and line breaks. */
465
+ prettyPrint?: boolean;
466
+ /** 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. */
467
+ quotaUser?: string;
468
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
469
+ upload_protocol?: string;
470
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
471
+ uploadType?: string;
472
+ },
473
+ body: GenerateNetworkReportRequest): Request<GenerateNetworkReportResponse>;
474
+ }
475
+ interface AccountsResource {
476
+ /** Gets information about the specified AdMob publisher account. */
477
+ get(request?: {
478
+ /** V1 error format. */
479
+ "$.xgafv"?: string;
480
+ /** OAuth access token. */
481
+ access_token?: string;
482
+ /** Data format for response. */
483
+ alt?: string;
484
+ /** JSONP */
485
+ callback?: string;
486
+ /** Selector specifying which fields to include in a partial response. */
487
+ fields?: string;
488
+ /** 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. */
489
+ key?: string;
490
+ /** Resource name of the publisher account to retrieve. Example: accounts/pub-9876543210987654 */
491
+ name: string;
492
+ /** OAuth 2.0 token for the current user. */
493
+ oauth_token?: string;
494
+ /** Returns response with indentations and line breaks. */
495
+ prettyPrint?: boolean;
496
+ /** 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. */
497
+ quotaUser?: string;
498
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
499
+ upload_protocol?: string;
500
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
501
+ uploadType?: string;
502
+ }): Request<PublisherAccount>;
503
+ /** Lists the AdMob publisher account that was most recently signed in to from the AdMob UI. For more information, see https://support.google.com/admob/answer/10243672. */
504
+ list(request?: {
505
+ /** V1 error format. */
506
+ "$.xgafv"?: string;
507
+ /** OAuth access token. */
508
+ access_token?: string;
509
+ /** Data format for response. */
510
+ alt?: string;
511
+ /** JSONP */
512
+ callback?: string;
513
+ /** Selector specifying which fields to include in a partial response. */
514
+ fields?: string;
515
+ /** 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. */
516
+ key?: string;
517
+ /** OAuth 2.0 token for the current user. */
518
+ oauth_token?: string;
519
+ /** Maximum number of accounts to return. */
520
+ pageSize?: number;
521
+ /**
522
+ * The value returned by the last `ListPublisherAccountsResponse`; indicates that this is a continuation of a prior `ListPublisherAccounts` call, and that the system should return
523
+ * the next page of data.
524
+ */
525
+ pageToken?: string;
526
+ /** Returns response with indentations and line breaks. */
527
+ prettyPrint?: boolean;
528
+ /** 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. */
529
+ quotaUser?: string;
530
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
531
+ upload_protocol?: string;
532
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
533
+ uploadType?: string;
534
+ }): Request<ListPublisherAccountsResponse>;
535
+ adUnits: AdUnitsResource;
536
+ apps: AppsResource;
537
+ mediationReport: MediationReportResource;
538
+ networkReport: NetworkReportResource;
539
+ }
540
+
541
+ const accounts: AccountsResource;
542
+ }
543
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.admob-v1",
3
+ "version": "0.0.20220811",
4
+ "description": "TypeScript typings for AdMob API v1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,81 @@
1
+ # TypeScript typings for AdMob API v1
2
+
3
+ The AdMob API allows publishers to programmatically get information about their AdMob account.
4
+ For detailed description please check [documentation](https://developers.google.com/admob/api/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for AdMob API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.admob-v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://admob.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.admob
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('admob', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.admob
39
+ });
40
+ ```
41
+
42
+ Don't forget to authenticate your client before sending any request to resources:
43
+
44
+ ```typescript
45
+ // declare client_id registered in Google Developers Console
46
+ var client_id = '',
47
+ scope = [
48
+ // See your AdMob data
49
+ 'https://www.googleapis.com/auth/admob.readonly',
50
+
51
+ // See your AdMob data
52
+ 'https://www.googleapis.com/auth/admob.report',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ { client_id: client_id, scope: scope, immediate: immediate },
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ });
66
+ ```
67
+
68
+ After that you can use AdMob API resources: <!-- TODO: make this work for multiple namespaces -->
69
+
70
+ ```typescript
71
+
72
+ /*
73
+ Gets information about the specified AdMob publisher account.
74
+ */
75
+ await gapi.client.admob.accounts.get({ name: "name", });
76
+
77
+ /*
78
+ Lists the AdMob publisher account that was most recently signed in to from the AdMob UI. For more information, see https://support.google.com/admob/answer/10243672.
79
+ */
80
+ await gapi.client.admob.accounts.list({ });
81
+ ```
package/tests.ts ADDED
@@ -0,0 +1,152 @@
1
+ /* This is stub file for gapi.client.admob-v1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20220811
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://admob.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.admob */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** See your AdMob data */
19
+ 'https://www.googleapis.com/auth/admob.readonly',
20
+ /** See your AdMob data */
21
+ 'https://www.googleapis.com/auth/admob.report',
22
+ ];
23
+ const immediate = false;
24
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
25
+ if (authResult && !authResult.error) {
26
+ /** handle successful authorization */
27
+ run();
28
+ } else {
29
+ /** handle authorization error */
30
+ }
31
+ });
32
+
33
+ async function run() {
34
+ /** Gets information about the specified AdMob publisher account. */
35
+ await gapi.client.admob.accounts.get({
36
+ name: "Test string",
37
+ });
38
+ /** Lists the AdMob publisher account that was most recently signed in to from the AdMob UI. For more information, see https://support.google.com/admob/answer/10243672. */
39
+ await gapi.client.admob.accounts.list({
40
+ pageSize: 42,
41
+ pageToken: "Test string",
42
+ });
43
+ /** List the ad units under the specified AdMob account. */
44
+ await gapi.client.admob.accounts.adUnits.list({
45
+ pageSize: 42,
46
+ pageToken: "Test string",
47
+ parent: "Test string",
48
+ });
49
+ /** List the apps under the specified AdMob account. */
50
+ await gapi.client.admob.accounts.apps.list({
51
+ pageSize: 42,
52
+ pageToken: "Test string",
53
+ parent: "Test string",
54
+ });
55
+ /** Generates an AdMob Mediation report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses. */
56
+ await gapi.client.admob.accounts.mediationReport.generate({
57
+ parent: "Test string",
58
+ }, {
59
+ reportSpec: {
60
+ dateRange: {
61
+ endDate: {
62
+ day: 42,
63
+ month: 42,
64
+ year: 42,
65
+ },
66
+ startDate: {
67
+ day: 42,
68
+ month: 42,
69
+ year: 42,
70
+ },
71
+ },
72
+ dimensionFilters: [
73
+ {
74
+ dimension: "Test string",
75
+ matchesAny: {
76
+ values: [
77
+ "Test string"
78
+ ],
79
+ },
80
+ }
81
+ ],
82
+ dimensions: [
83
+ "Test string"
84
+ ],
85
+ localizationSettings: {
86
+ currencyCode: "Test string",
87
+ languageCode: "Test string",
88
+ },
89
+ maxReportRows: 42,
90
+ metrics: [
91
+ "Test string"
92
+ ],
93
+ sortConditions: [
94
+ {
95
+ dimension: "Test string",
96
+ metric: "Test string",
97
+ order: "Test string",
98
+ }
99
+ ],
100
+ timeZone: "Test string",
101
+ },
102
+ });
103
+ /** Generates an AdMob Network report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses. */
104
+ await gapi.client.admob.accounts.networkReport.generate({
105
+ parent: "Test string",
106
+ }, {
107
+ reportSpec: {
108
+ dateRange: {
109
+ endDate: {
110
+ day: 42,
111
+ month: 42,
112
+ year: 42,
113
+ },
114
+ startDate: {
115
+ day: 42,
116
+ month: 42,
117
+ year: 42,
118
+ },
119
+ },
120
+ dimensionFilters: [
121
+ {
122
+ dimension: "Test string",
123
+ matchesAny: {
124
+ values: [
125
+ "Test string"
126
+ ],
127
+ },
128
+ }
129
+ ],
130
+ dimensions: [
131
+ "Test string"
132
+ ],
133
+ localizationSettings: {
134
+ currencyCode: "Test string",
135
+ languageCode: "Test string",
136
+ },
137
+ maxReportRows: 42,
138
+ metrics: [
139
+ "Test string"
140
+ ],
141
+ sortConditions: [
142
+ {
143
+ dimension: "Test string",
144
+ metric: "Test string",
145
+ order: "Test string",
146
+ }
147
+ ],
148
+ timeZone: "Test string",
149
+ },
150
+ });
151
+ }
152
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }