@googleapis/youtube 27.0.1 → 29.0.0
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/CHANGELOG.md +30 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/v3.d.ts +120 -1
- package/build/v3.js +118 -1
- package/build/v3.js.map +1 -1
- package/package.json +4 -4
- package/v3.ts +211 -0
package/v3.ts
CHANGED
|
@@ -19249,8 +19249,10 @@ export namespace youtube_v3 {
|
|
|
19249
19249
|
|
|
19250
19250
|
export class Resource$Youtube$V3 {
|
|
19251
19251
|
context: APIRequestContext;
|
|
19252
|
+
liveChat: Resource$Youtube$V3$Livechat;
|
|
19252
19253
|
constructor(context: APIRequestContext) {
|
|
19253
19254
|
this.context = context;
|
|
19255
|
+
this.liveChat = new Resource$Youtube$V3$Livechat(this.context);
|
|
19254
19256
|
}
|
|
19255
19257
|
|
|
19256
19258
|
/**
|
|
@@ -19421,4 +19423,213 @@ export namespace youtube_v3 {
|
|
|
19421
19423
|
*/
|
|
19422
19424
|
requestBody?: Schema$CommentThread;
|
|
19423
19425
|
}
|
|
19426
|
+
|
|
19427
|
+
export class Resource$Youtube$V3$Livechat {
|
|
19428
|
+
context: APIRequestContext;
|
|
19429
|
+
messages: Resource$Youtube$V3$Livechat$Messages;
|
|
19430
|
+
constructor(context: APIRequestContext) {
|
|
19431
|
+
this.context = context;
|
|
19432
|
+
this.messages = new Resource$Youtube$V3$Livechat$Messages(this.context);
|
|
19433
|
+
}
|
|
19434
|
+
}
|
|
19435
|
+
|
|
19436
|
+
export class Resource$Youtube$V3$Livechat$Messages {
|
|
19437
|
+
context: APIRequestContext;
|
|
19438
|
+
constructor(context: APIRequestContext) {
|
|
19439
|
+
this.context = context;
|
|
19440
|
+
}
|
|
19441
|
+
|
|
19442
|
+
/**
|
|
19443
|
+
* Allows a user to load live chat through a server-streamed RPC.
|
|
19444
|
+
* @example
|
|
19445
|
+
* ```js
|
|
19446
|
+
* // Before running the sample:
|
|
19447
|
+
* // - Enable the API at:
|
|
19448
|
+
* // https://console.developers.google.com/apis/api/youtube.googleapis.com
|
|
19449
|
+
* // - Login into gcloud by running:
|
|
19450
|
+
* // ```sh
|
|
19451
|
+
* // $ gcloud auth application-default login
|
|
19452
|
+
* // ```
|
|
19453
|
+
* // - Install the npm module by running:
|
|
19454
|
+
* // ```sh
|
|
19455
|
+
* // $ npm install googleapis
|
|
19456
|
+
* // ```
|
|
19457
|
+
*
|
|
19458
|
+
* const {google} = require('googleapis');
|
|
19459
|
+
* const youtube = google.youtube('v3');
|
|
19460
|
+
*
|
|
19461
|
+
* async function main() {
|
|
19462
|
+
* const auth = new google.auth.GoogleAuth({
|
|
19463
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
19464
|
+
* scopes: [
|
|
19465
|
+
* 'https://www.googleapis.com/auth/youtube',
|
|
19466
|
+
* 'https://www.googleapis.com/auth/youtube.force-ssl',
|
|
19467
|
+
* 'https://www.googleapis.com/auth/youtube.readonly',
|
|
19468
|
+
* ],
|
|
19469
|
+
* });
|
|
19470
|
+
*
|
|
19471
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
19472
|
+
* const authClient = await auth.getClient();
|
|
19473
|
+
* google.options({auth: authClient});
|
|
19474
|
+
*
|
|
19475
|
+
* // Do the magic
|
|
19476
|
+
* const res = await youtube.youtube.v3.liveChat.messages.stream({
|
|
19477
|
+
* // Specifies the localization language in which the system messages should be returned.
|
|
19478
|
+
* hl: 'placeholder-value',
|
|
19479
|
+
* // The id of the live chat for which comments should be returned.
|
|
19480
|
+
* liveChatId: 'placeholder-value',
|
|
19481
|
+
* // The *maxResults* parameter specifies the maximum number of items that should be returned in the result set. Not used in the streaming RPC.
|
|
19482
|
+
* maxResults: 'placeholder-value',
|
|
19483
|
+
* // The *pageToken* parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved.
|
|
19484
|
+
* pageToken: 'placeholder-value',
|
|
19485
|
+
* // The *part* parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id, snippet, and authorDetails.
|
|
19486
|
+
* part: 'placeholder-value',
|
|
19487
|
+
* // Specifies the size of the profile image that should be returned for each user.
|
|
19488
|
+
* profileImageSize: 'placeholder-value',
|
|
19489
|
+
* });
|
|
19490
|
+
* console.log(res.data);
|
|
19491
|
+
*
|
|
19492
|
+
* // Example response
|
|
19493
|
+
* // {
|
|
19494
|
+
* // "activePollItem": {},
|
|
19495
|
+
* // "etag": "my_etag",
|
|
19496
|
+
* // "eventId": "my_eventId",
|
|
19497
|
+
* // "items": [],
|
|
19498
|
+
* // "kind": "my_kind",
|
|
19499
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
19500
|
+
* // "offlineAt": "my_offlineAt",
|
|
19501
|
+
* // "pageInfo": {},
|
|
19502
|
+
* // "pollingIntervalMillis": 0,
|
|
19503
|
+
* // "tokenPagination": {},
|
|
19504
|
+
* // "visitorId": "my_visitorId"
|
|
19505
|
+
* // }
|
|
19506
|
+
* }
|
|
19507
|
+
*
|
|
19508
|
+
* main().catch(e => {
|
|
19509
|
+
* console.error(e);
|
|
19510
|
+
* throw e;
|
|
19511
|
+
* });
|
|
19512
|
+
*
|
|
19513
|
+
* ```
|
|
19514
|
+
*
|
|
19515
|
+
* @param params - Parameters for request
|
|
19516
|
+
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
19517
|
+
* @param callback - Optional callback that handles the response.
|
|
19518
|
+
* @returns A promise if used with async/await, or void if used with a callback.
|
|
19519
|
+
*/
|
|
19520
|
+
stream(
|
|
19521
|
+
params: Params$Resource$Youtube$V3$Livechat$Messages$Stream,
|
|
19522
|
+
options: StreamMethodOptions
|
|
19523
|
+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
19524
|
+
stream(
|
|
19525
|
+
params?: Params$Resource$Youtube$V3$Livechat$Messages$Stream,
|
|
19526
|
+
options?: MethodOptions
|
|
19527
|
+
): Promise<GaxiosResponseWithHTTP2<Schema$LiveChatMessageListResponse>>;
|
|
19528
|
+
stream(
|
|
19529
|
+
params: Params$Resource$Youtube$V3$Livechat$Messages$Stream,
|
|
19530
|
+
options: StreamMethodOptions | BodyResponseCallback<Readable>,
|
|
19531
|
+
callback: BodyResponseCallback<Readable>
|
|
19532
|
+
): void;
|
|
19533
|
+
stream(
|
|
19534
|
+
params: Params$Resource$Youtube$V3$Livechat$Messages$Stream,
|
|
19535
|
+
options:
|
|
19536
|
+
| MethodOptions
|
|
19537
|
+
| BodyResponseCallback<Schema$LiveChatMessageListResponse>,
|
|
19538
|
+
callback: BodyResponseCallback<Schema$LiveChatMessageListResponse>
|
|
19539
|
+
): void;
|
|
19540
|
+
stream(
|
|
19541
|
+
params: Params$Resource$Youtube$V3$Livechat$Messages$Stream,
|
|
19542
|
+
callback: BodyResponseCallback<Schema$LiveChatMessageListResponse>
|
|
19543
|
+
): void;
|
|
19544
|
+
stream(
|
|
19545
|
+
callback: BodyResponseCallback<Schema$LiveChatMessageListResponse>
|
|
19546
|
+
): void;
|
|
19547
|
+
stream(
|
|
19548
|
+
paramsOrCallback?:
|
|
19549
|
+
| Params$Resource$Youtube$V3$Livechat$Messages$Stream
|
|
19550
|
+
| BodyResponseCallback<Schema$LiveChatMessageListResponse>
|
|
19551
|
+
| BodyResponseCallback<Readable>,
|
|
19552
|
+
optionsOrCallback?:
|
|
19553
|
+
| MethodOptions
|
|
19554
|
+
| StreamMethodOptions
|
|
19555
|
+
| BodyResponseCallback<Schema$LiveChatMessageListResponse>
|
|
19556
|
+
| BodyResponseCallback<Readable>,
|
|
19557
|
+
callback?:
|
|
19558
|
+
| BodyResponseCallback<Schema$LiveChatMessageListResponse>
|
|
19559
|
+
| BodyResponseCallback<Readable>
|
|
19560
|
+
):
|
|
19561
|
+
| void
|
|
19562
|
+
| Promise<GaxiosResponseWithHTTP2<Schema$LiveChatMessageListResponse>>
|
|
19563
|
+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
|
|
19564
|
+
let params = (paramsOrCallback ||
|
|
19565
|
+
{}) as Params$Resource$Youtube$V3$Livechat$Messages$Stream;
|
|
19566
|
+
let options = (optionsOrCallback || {}) as MethodOptions;
|
|
19567
|
+
|
|
19568
|
+
if (typeof paramsOrCallback === 'function') {
|
|
19569
|
+
callback = paramsOrCallback;
|
|
19570
|
+
params = {} as Params$Resource$Youtube$V3$Livechat$Messages$Stream;
|
|
19571
|
+
options = {};
|
|
19572
|
+
}
|
|
19573
|
+
|
|
19574
|
+
if (typeof optionsOrCallback === 'function') {
|
|
19575
|
+
callback = optionsOrCallback;
|
|
19576
|
+
options = {};
|
|
19577
|
+
}
|
|
19578
|
+
|
|
19579
|
+
const rootUrl = options.rootUrl || 'https://youtube.googleapis.com/';
|
|
19580
|
+
const parameters = {
|
|
19581
|
+
options: Object.assign(
|
|
19582
|
+
{
|
|
19583
|
+
url: (rootUrl + '/youtube/v3/liveChat/messages/stream').replace(
|
|
19584
|
+
/([^:]\/)\/+/g,
|
|
19585
|
+
'$1'
|
|
19586
|
+
),
|
|
19587
|
+
method: 'GET',
|
|
19588
|
+
apiVersion: '',
|
|
19589
|
+
},
|
|
19590
|
+
options
|
|
19591
|
+
),
|
|
19592
|
+
params,
|
|
19593
|
+
requiredParams: [],
|
|
19594
|
+
pathParams: [],
|
|
19595
|
+
context: this.context,
|
|
19596
|
+
};
|
|
19597
|
+
if (callback) {
|
|
19598
|
+
createAPIRequest<Schema$LiveChatMessageListResponse>(
|
|
19599
|
+
parameters,
|
|
19600
|
+
callback as BodyResponseCallback<unknown>
|
|
19601
|
+
);
|
|
19602
|
+
} else {
|
|
19603
|
+
return createAPIRequest<Schema$LiveChatMessageListResponse>(parameters);
|
|
19604
|
+
}
|
|
19605
|
+
}
|
|
19606
|
+
}
|
|
19607
|
+
|
|
19608
|
+
export interface Params$Resource$Youtube$V3$Livechat$Messages$Stream
|
|
19609
|
+
extends StandardParameters {
|
|
19610
|
+
/**
|
|
19611
|
+
* Specifies the localization language in which the system messages should be returned.
|
|
19612
|
+
*/
|
|
19613
|
+
hl?: string;
|
|
19614
|
+
/**
|
|
19615
|
+
* The id of the live chat for which comments should be returned.
|
|
19616
|
+
*/
|
|
19617
|
+
liveChatId?: string;
|
|
19618
|
+
/**
|
|
19619
|
+
* The *maxResults* parameter specifies the maximum number of items that should be returned in the result set. Not used in the streaming RPC.
|
|
19620
|
+
*/
|
|
19621
|
+
maxResults?: number;
|
|
19622
|
+
/**
|
|
19623
|
+
* The *pageToken* parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved.
|
|
19624
|
+
*/
|
|
19625
|
+
pageToken?: string;
|
|
19626
|
+
/**
|
|
19627
|
+
* The *part* parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id, snippet, and authorDetails.
|
|
19628
|
+
*/
|
|
19629
|
+
part?: string[];
|
|
19630
|
+
/**
|
|
19631
|
+
* Specifies the size of the profile image that should be returned for each user.
|
|
19632
|
+
*/
|
|
19633
|
+
profileImageSize?: number;
|
|
19634
|
+
}
|
|
19424
19635
|
}
|