@maxim_mazurok/gapi.client.youtubereporting-v1 0.0.20220808

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,558 @@
1
+ /* Type definitions for non-npm package YouTube Reporting API v1 0.0 */
2
+ // Project: https://developers.google.com/youtube/reporting/v1/reports/
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://youtubereporting.googleapis.com/$discovery/rest?version=v1
13
+ // Revision: 20220808
14
+
15
+ /// <reference types="gapi.client" />
16
+
17
+ declare namespace gapi.client {
18
+ /** Load YouTube Reporting API v1 */
19
+ function load(urlOrObject: "https://youtubereporting.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
20
+ /** @deprecated Please load APIs with discovery documents. */
21
+ function load(name: "youtubereporting", version: "v1"): Promise<void>;
22
+ /** @deprecated Please load APIs with discovery documents. */
23
+ function load(name: "youtubereporting", version: "v1", callback: () => any): void;
24
+
25
+ namespace youtubereporting {
26
+ // tslint:disable-next-line:no-empty-interface
27
+ interface Empty {
28
+ }
29
+ interface GdataBlobstore2Info {
30
+ /** gdata */
31
+ blobGeneration?: string;
32
+ /** gdata */
33
+ blobId?: string;
34
+ /** gdata */
35
+ downloadReadHandle?: string;
36
+ /** gdata */
37
+ readToken?: string;
38
+ /** gdata */
39
+ uploadMetadataContainer?: string;
40
+ }
41
+ interface GdataCompositeMedia {
42
+ /** gdata */
43
+ blobRef?: string;
44
+ /** gdata */
45
+ blobstore2Info?: GdataBlobstore2Info;
46
+ /** gdata */
47
+ cosmoBinaryReference?: string;
48
+ /** gdata */
49
+ crc32cHash?: number;
50
+ /** gdata */
51
+ inline?: string;
52
+ /** gdata */
53
+ length?: string;
54
+ /** gdata */
55
+ md5Hash?: string;
56
+ /** gdata */
57
+ objectId?: GdataObjectId;
58
+ /** gdata */
59
+ path?: string;
60
+ /** gdata */
61
+ referenceType?: string;
62
+ /** gdata */
63
+ sha1Hash?: string;
64
+ }
65
+ interface GdataContentTypeInfo {
66
+ /** gdata */
67
+ bestGuess?: string;
68
+ /** gdata */
69
+ fromBytes?: string;
70
+ /** gdata */
71
+ fromFileName?: string;
72
+ /** gdata */
73
+ fromHeader?: string;
74
+ /** gdata */
75
+ fromUrlPath?: string;
76
+ }
77
+ interface GdataDiffChecksumsResponse {
78
+ /** gdata */
79
+ checksumsLocation?: GdataCompositeMedia;
80
+ /** gdata */
81
+ chunkSizeBytes?: string;
82
+ /** gdata */
83
+ objectLocation?: GdataCompositeMedia;
84
+ /** gdata */
85
+ objectSizeBytes?: string;
86
+ /** gdata */
87
+ objectVersion?: string;
88
+ }
89
+ interface GdataDiffDownloadResponse {
90
+ /** gdata */
91
+ objectLocation?: GdataCompositeMedia;
92
+ }
93
+ interface GdataDiffUploadRequest {
94
+ /** gdata */
95
+ checksumsInfo?: GdataCompositeMedia;
96
+ /** gdata */
97
+ objectInfo?: GdataCompositeMedia;
98
+ /** gdata */
99
+ objectVersion?: string;
100
+ }
101
+ interface GdataDiffUploadResponse {
102
+ /** gdata */
103
+ objectVersion?: string;
104
+ /** gdata */
105
+ originalObject?: GdataCompositeMedia;
106
+ }
107
+ interface GdataDiffVersionResponse {
108
+ /** gdata */
109
+ objectSizeBytes?: string;
110
+ /** gdata */
111
+ objectVersion?: string;
112
+ }
113
+ interface GdataDownloadParameters {
114
+ /** gdata */
115
+ allowGzipCompression?: boolean;
116
+ /** gdata */
117
+ ignoreRange?: boolean;
118
+ }
119
+ interface GdataMedia {
120
+ /** gdata */
121
+ algorithm?: string;
122
+ /** gdata */
123
+ bigstoreObjectRef?: string;
124
+ /** gdata */
125
+ blobRef?: string;
126
+ /** gdata */
127
+ blobstore2Info?: GdataBlobstore2Info;
128
+ /** gdata */
129
+ compositeMedia?: GdataCompositeMedia[];
130
+ /** gdata */
131
+ contentType?: string;
132
+ /** gdata */
133
+ contentTypeInfo?: GdataContentTypeInfo;
134
+ /** gdata */
135
+ cosmoBinaryReference?: string;
136
+ /** gdata */
137
+ crc32cHash?: number;
138
+ /** gdata */
139
+ diffChecksumsResponse?: GdataDiffChecksumsResponse;
140
+ /** gdata */
141
+ diffDownloadResponse?: GdataDiffDownloadResponse;
142
+ /** gdata */
143
+ diffUploadRequest?: GdataDiffUploadRequest;
144
+ /** gdata */
145
+ diffUploadResponse?: GdataDiffUploadResponse;
146
+ /** gdata */
147
+ diffVersionResponse?: GdataDiffVersionResponse;
148
+ /** gdata */
149
+ downloadParameters?: GdataDownloadParameters;
150
+ /** gdata */
151
+ filename?: string;
152
+ /** gdata */
153
+ hash?: string;
154
+ /** gdata */
155
+ hashVerified?: boolean;
156
+ /** gdata */
157
+ inline?: string;
158
+ /** gdata */
159
+ isPotentialRetry?: boolean;
160
+ /** gdata */
161
+ length?: string;
162
+ /** gdata */
163
+ md5Hash?: string;
164
+ /** gdata */
165
+ mediaId?: string;
166
+ /** gdata */
167
+ objectId?: GdataObjectId;
168
+ /** gdata */
169
+ path?: string;
170
+ /** gdata */
171
+ referenceType?: string;
172
+ /** gdata */
173
+ sha1Hash?: string;
174
+ /** gdata */
175
+ sha256Hash?: string;
176
+ /** gdata */
177
+ timestamp?: string;
178
+ /** gdata */
179
+ token?: string;
180
+ }
181
+ interface GdataObjectId {
182
+ /** gdata */
183
+ bucketName?: string;
184
+ /** gdata */
185
+ generation?: string;
186
+ /** gdata */
187
+ objectName?: string;
188
+ }
189
+ interface Job {
190
+ /** The creation date/time of the job. */
191
+ createTime?: string;
192
+ /** The date/time when this job will expire/expired. After a job expired, no new reports are generated. */
193
+ expireTime?: string;
194
+ /** The server-generated ID of the job (max. 40 characters). */
195
+ id?: string;
196
+ /** The name of the job (max. 100 characters). */
197
+ name?: string;
198
+ /** The type of reports this job creates. Corresponds to the ID of a ReportType. */
199
+ reportTypeId?: string;
200
+ /** True if this a system-managed job that cannot be modified by the user; otherwise false. */
201
+ systemManaged?: boolean;
202
+ }
203
+ interface ListJobsResponse {
204
+ /** The list of jobs. */
205
+ jobs?: Job[];
206
+ /** A token to retrieve next page of results. Pass this value in the ListJobsRequest.page_token field in the subsequent call to `ListJobs` method to retrieve the next page of results. */
207
+ nextPageToken?: string;
208
+ }
209
+ interface ListReportsResponse {
210
+ /**
211
+ * A token to retrieve next page of results. Pass this value in the ListReportsRequest.page_token field in the subsequent call to `ListReports` method to retrieve the next page of
212
+ * results.
213
+ */
214
+ nextPageToken?: string;
215
+ /** The list of report types. */
216
+ reports?: Report[];
217
+ }
218
+ interface ListReportTypesResponse {
219
+ /**
220
+ * A token to retrieve next page of results. Pass this value in the ListReportTypesRequest.page_token field in the subsequent call to `ListReportTypes` method to retrieve the next page
221
+ * of results.
222
+ */
223
+ nextPageToken?: string;
224
+ /** The list of report types. */
225
+ reportTypes?: ReportType[];
226
+ }
227
+ interface Report {
228
+ /** The date/time when this report was created. */
229
+ createTime?: string;
230
+ /** The URL from which the report can be downloaded (max. 1000 characters). */
231
+ downloadUrl?: string;
232
+ /** The end of the time period that the report instance covers. The value is exclusive. */
233
+ endTime?: string;
234
+ /** The server-generated ID of the report. */
235
+ id?: string;
236
+ /** The date/time when the job this report belongs to will expire/expired. */
237
+ jobExpireTime?: string;
238
+ /** The ID of the job that created this report. */
239
+ jobId?: string;
240
+ /** The start of the time period that the report instance covers. The value is inclusive. */
241
+ startTime?: string;
242
+ }
243
+ interface ReportType {
244
+ /** The date/time when this report type was/will be deprecated. */
245
+ deprecateTime?: string;
246
+ /** The ID of the report type (max. 100 characters). */
247
+ id?: string;
248
+ /** The name of the report type (max. 100 characters). */
249
+ name?: string;
250
+ /**
251
+ * True if this a system-managed report type; otherwise false. Reporting jobs for system-managed report types are created automatically and can thus not be used in the `CreateJob`
252
+ * method.
253
+ */
254
+ systemManaged?: boolean;
255
+ }
256
+ interface ReportsResource {
257
+ /** Gets the metadata of a specific report. */
258
+ get(request?: {
259
+ /** V1 error format. */
260
+ "$.xgafv"?: string;
261
+ /** OAuth access token. */
262
+ access_token?: string;
263
+ /** Data format for response. */
264
+ alt?: string;
265
+ /** JSONP */
266
+ callback?: string;
267
+ /** Selector specifying which fields to include in a partial response. */
268
+ fields?: string;
269
+ /** The ID of the job. */
270
+ jobId: string;
271
+ /** 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. */
272
+ key?: string;
273
+ /** OAuth 2.0 token for the current user. */
274
+ oauth_token?: string;
275
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
276
+ onBehalfOfContentOwner?: string;
277
+ /** Returns response with indentations and line breaks. */
278
+ prettyPrint?: boolean;
279
+ /** 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. */
280
+ quotaUser?: string;
281
+ /** The ID of the report to retrieve. */
282
+ reportId: string;
283
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
284
+ upload_protocol?: string;
285
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
286
+ uploadType?: string;
287
+ }): Request<Report>;
288
+ /** Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist. */
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
+ /** If set, only reports created after the specified date/time are returned. */
299
+ createdAfter?: string;
300
+ /** Selector specifying which fields to include in a partial response. */
301
+ fields?: string;
302
+ /** The ID of the job. */
303
+ jobId: string;
304
+ /** 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. */
305
+ key?: string;
306
+ /** OAuth 2.0 token for the current user. */
307
+ oauth_token?: string;
308
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
309
+ onBehalfOfContentOwner?: string;
310
+ /** Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. */
311
+ pageSize?: number;
312
+ /**
313
+ * A token identifying a page of results the server should return. Typically, this is the value of ListReportsResponse.next_page_token returned in response to the previous call to
314
+ * the `ListReports` method.
315
+ */
316
+ pageToken?: string;
317
+ /** Returns response with indentations and line breaks. */
318
+ prettyPrint?: boolean;
319
+ /** 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. */
320
+ quotaUser?: string;
321
+ /** If set, only reports whose start time is greater than or equal the specified date/time are returned. */
322
+ startTimeAtOrAfter?: string;
323
+ /** If set, only reports whose start time is smaller than the specified date/time are returned. */
324
+ startTimeBefore?: string;
325
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
326
+ upload_protocol?: string;
327
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
328
+ uploadType?: string;
329
+ }): Request<ListReportsResponse>;
330
+ }
331
+ interface JobsResource {
332
+ /** Creates a job and returns it. */
333
+ create(request: {
334
+ /** V1 error format. */
335
+ "$.xgafv"?: string;
336
+ /** OAuth access token. */
337
+ access_token?: string;
338
+ /** Data format for response. */
339
+ alt?: string;
340
+ /** JSONP */
341
+ callback?: string;
342
+ /** Selector specifying which fields to include in a partial response. */
343
+ fields?: string;
344
+ /** 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. */
345
+ key?: string;
346
+ /** OAuth 2.0 token for the current user. */
347
+ oauth_token?: string;
348
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
349
+ onBehalfOfContentOwner?: string;
350
+ /** Returns response with indentations and line breaks. */
351
+ prettyPrint?: boolean;
352
+ /** 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. */
353
+ quotaUser?: string;
354
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
355
+ upload_protocol?: string;
356
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
357
+ uploadType?: string;
358
+ /** Request body */
359
+ resource: Job;
360
+ }): Request<Job>;
361
+ create(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
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
377
+ onBehalfOfContentOwner?: 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
+ },
387
+ body: Job): Request<Job>;
388
+ /** Deletes a job. */
389
+ delete(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
+ /** The ID of the job to delete. */
401
+ jobId: string;
402
+ /** 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. */
403
+ key?: string;
404
+ /** OAuth 2.0 token for the current user. */
405
+ oauth_token?: string;
406
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
407
+ onBehalfOfContentOwner?: string;
408
+ /** Returns response with indentations and line breaks. */
409
+ prettyPrint?: boolean;
410
+ /** 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. */
411
+ quotaUser?: string;
412
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
413
+ upload_protocol?: string;
414
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
415
+ uploadType?: string;
416
+ }): Request<{}>;
417
+ /** Gets a job. */
418
+ get(request?: {
419
+ /** V1 error format. */
420
+ "$.xgafv"?: string;
421
+ /** OAuth access token. */
422
+ access_token?: string;
423
+ /** Data format for response. */
424
+ alt?: string;
425
+ /** JSONP */
426
+ callback?: string;
427
+ /** Selector specifying which fields to include in a partial response. */
428
+ fields?: string;
429
+ /** The ID of the job to retrieve. */
430
+ jobId: string;
431
+ /** 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. */
432
+ key?: string;
433
+ /** OAuth 2.0 token for the current user. */
434
+ oauth_token?: string;
435
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
436
+ onBehalfOfContentOwner?: string;
437
+ /** Returns response with indentations and line breaks. */
438
+ prettyPrint?: boolean;
439
+ /** 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. */
440
+ quotaUser?: string;
441
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
442
+ upload_protocol?: string;
443
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
444
+ uploadType?: string;
445
+ }): Request<Job>;
446
+ /** Lists jobs. */
447
+ list(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
+ /** If set to true, also system-managed jobs will be returned; otherwise only user-created jobs will be returned. System-managed jobs can neither be modified nor deleted. */
459
+ includeSystemManaged?: boolean;
460
+ /** 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. */
461
+ key?: string;
462
+ /** OAuth 2.0 token for the current user. */
463
+ oauth_token?: string;
464
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
465
+ onBehalfOfContentOwner?: string;
466
+ /** Requested page size. Server may return fewer jobs than requested. If unspecified, server will pick an appropriate default. */
467
+ pageSize?: number;
468
+ /**
469
+ * A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call
470
+ * to the `ListJobs` method.
471
+ */
472
+ pageToken?: string;
473
+ /** Returns response with indentations and line breaks. */
474
+ prettyPrint?: boolean;
475
+ /** 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. */
476
+ quotaUser?: string;
477
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
478
+ upload_protocol?: string;
479
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
480
+ uploadType?: string;
481
+ }): Request<ListJobsResponse>;
482
+ reports: ReportsResource;
483
+ }
484
+ interface MediaResource {
485
+ /** Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`. */
486
+ download(request?: {
487
+ /** V1 error format. */
488
+ "$.xgafv"?: string;
489
+ /** OAuth access token. */
490
+ access_token?: string;
491
+ /** Data format for response. */
492
+ alt?: string;
493
+ /** JSONP */
494
+ callback?: string;
495
+ /** Selector specifying which fields to include in a partial response. */
496
+ fields?: string;
497
+ /** 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. */
498
+ key?: string;
499
+ /** OAuth 2.0 token for the current user. */
500
+ oauth_token?: string;
501
+ /** Returns response with indentations and line breaks. */
502
+ prettyPrint?: boolean;
503
+ /** 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. */
504
+ quotaUser?: string;
505
+ /** Name of the media that is being downloaded. */
506
+ resourceName: string;
507
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
508
+ upload_protocol?: string;
509
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
510
+ uploadType?: string;
511
+ }): Request<GdataMedia>;
512
+ }
513
+ interface ReportTypesResource {
514
+ /** Lists report types. */
515
+ list(request?: {
516
+ /** V1 error format. */
517
+ "$.xgafv"?: string;
518
+ /** OAuth access token. */
519
+ access_token?: string;
520
+ /** Data format for response. */
521
+ alt?: string;
522
+ /** JSONP */
523
+ callback?: string;
524
+ /** Selector specifying which fields to include in a partial response. */
525
+ fields?: string;
526
+ /** If set to true, also system-managed report types will be returned; otherwise only the report types that can be used to create new reporting jobs will be returned. */
527
+ includeSystemManaged?: boolean;
528
+ /** 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. */
529
+ key?: string;
530
+ /** OAuth 2.0 token for the current user. */
531
+ oauth_token?: string;
532
+ /** The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). */
533
+ onBehalfOfContentOwner?: string;
534
+ /** Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. */
535
+ pageSize?: number;
536
+ /**
537
+ * A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call
538
+ * to the `ListReportTypes` method.
539
+ */
540
+ pageToken?: string;
541
+ /** Returns response with indentations and line breaks. */
542
+ prettyPrint?: boolean;
543
+ /** 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. */
544
+ quotaUser?: string;
545
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
546
+ upload_protocol?: string;
547
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
548
+ uploadType?: string;
549
+ }): Request<ListReportTypesResponse>;
550
+ }
551
+
552
+ const jobs: JobsResource;
553
+
554
+ const media: MediaResource;
555
+
556
+ const reportTypes: ReportTypesResource;
557
+ }
558
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.youtubereporting-v1",
3
+ "version": "0.0.20220808",
4
+ "description": "TypeScript typings for YouTube Reporting 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,101 @@
1
+ # TypeScript typings for YouTube Reporting API v1
2
+
3
+ Schedules reporting jobs containing your YouTube Analytics data and downloads the resulting bulk data reports in the form of CSV files.
4
+ For detailed description please check [documentation](https://developers.google.com/youtube/reporting/v1/reports/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for YouTube Reporting API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.youtubereporting-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://youtubereporting.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.youtubereporting
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('youtubereporting', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.youtubereporting
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
+ // View monetary and non-monetary YouTube Analytics reports for your YouTube content
49
+ 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly',
50
+
51
+ // View YouTube Analytics reports for your YouTube content
52
+ 'https://www.googleapis.com/auth/yt-analytics.readonly',
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 YouTube Reporting API resources: <!-- TODO: make this work for multiple namespaces -->
69
+
70
+ ```typescript
71
+
72
+ /*
73
+ Creates a job and returns it.
74
+ */
75
+ await gapi.client.youtubereporting.jobs.create({ });
76
+
77
+ /*
78
+ Deletes a job.
79
+ */
80
+ await gapi.client.youtubereporting.jobs.delete({ jobId: "jobId", });
81
+
82
+ /*
83
+ Gets a job.
84
+ */
85
+ await gapi.client.youtubereporting.jobs.get({ jobId: "jobId", });
86
+
87
+ /*
88
+ Lists jobs.
89
+ */
90
+ await gapi.client.youtubereporting.jobs.list({ });
91
+
92
+ /*
93
+ Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`.
94
+ */
95
+ await gapi.client.youtubereporting.media.download({ resourceName: "resourceName", });
96
+
97
+ /*
98
+ Lists report types.
99
+ */
100
+ await gapi.client.youtubereporting.reportTypes.list({ });
101
+ ```
package/tests.ts ADDED
@@ -0,0 +1,90 @@
1
+ /* This is stub file for gapi.client.youtubereporting-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: 20220808
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://youtubereporting.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.youtubereporting */
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
+ /** View monetary and non-monetary YouTube Analytics reports for your YouTube content */
19
+ 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly',
20
+ /** View YouTube Analytics reports for your YouTube content */
21
+ 'https://www.googleapis.com/auth/yt-analytics.readonly',
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
+ /** Creates a job and returns it. */
35
+ await gapi.client.youtubereporting.jobs.create({
36
+ onBehalfOfContentOwner: "Test string",
37
+ }, {
38
+ createTime: "Test string",
39
+ expireTime: "Test string",
40
+ id: "Test string",
41
+ name: "Test string",
42
+ reportTypeId: "Test string",
43
+ systemManaged: true,
44
+ });
45
+ /** Deletes a job. */
46
+ await gapi.client.youtubereporting.jobs.delete({
47
+ jobId: "Test string",
48
+ onBehalfOfContentOwner: "Test string",
49
+ });
50
+ /** Gets a job. */
51
+ await gapi.client.youtubereporting.jobs.get({
52
+ jobId: "Test string",
53
+ onBehalfOfContentOwner: "Test string",
54
+ });
55
+ /** Lists jobs. */
56
+ await gapi.client.youtubereporting.jobs.list({
57
+ includeSystemManaged: true,
58
+ onBehalfOfContentOwner: "Test string",
59
+ pageSize: 42,
60
+ pageToken: "Test string",
61
+ });
62
+ /** Gets the metadata of a specific report. */
63
+ await gapi.client.youtubereporting.jobs.reports.get({
64
+ jobId: "Test string",
65
+ onBehalfOfContentOwner: "Test string",
66
+ reportId: "Test string",
67
+ });
68
+ /** Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist. */
69
+ await gapi.client.youtubereporting.jobs.reports.list({
70
+ createdAfter: "Test string",
71
+ jobId: "Test string",
72
+ onBehalfOfContentOwner: "Test string",
73
+ pageSize: 42,
74
+ pageToken: "Test string",
75
+ startTimeAtOrAfter: "Test string",
76
+ startTimeBefore: "Test string",
77
+ });
78
+ /** Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`. */
79
+ await gapi.client.youtubereporting.media.download({
80
+ resourceName: "Test string",
81
+ });
82
+ /** Lists report types. */
83
+ await gapi.client.youtubereporting.reportTypes.list({
84
+ includeSystemManaged: true,
85
+ onBehalfOfContentOwner: "Test string",
86
+ pageSize: 42,
87
+ pageToken: "Test string",
88
+ });
89
+ }
90
+ });
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
+ }