From db3bcd9813aadcf36b35c15a0e7d7f22e72d4926 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Tue, 15 Oct 2024 01:35:59 +0000 Subject: [PATCH] feat(youtube): update the API #### youtube:v3 The following keys were added: - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.description - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.flatPath - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.httpMethod - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.id - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameterOrder - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.hl.description - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.hl.location - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.hl.type - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.liveChatId.description - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.liveChatId.location - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.liveChatId.type - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.maxResults.default - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.maxResults.description - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.maxResults.format - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.maxResults.location - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.maxResults.maximum - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.maxResults.minimum - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.maxResults.type - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.pageToken.description - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.pageToken.location - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.pageToken.type - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.part.description - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.part.location - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.part.repeated - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.part.type - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.profileImageSize.description - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.profileImageSize.format - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.profileImageSize.location - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.profileImageSize.maximum - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.profileImageSize.minimum - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.parameters.profileImageSize.type - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.path - resources.youtube.resources.v3.resources.liveChat.resources.messages.methods.stream.response.$ref The following keys were changed: - resources.liveChatMessages.methods.list.parameters.maxResults.description --- discovery/youtube-v3.json | 65 ++++++++++++++++- src/apis/youtube/v3.ts | 143 +++++++++++++++++++++++++++++++++++++- 2 files changed, 205 insertions(+), 3 deletions(-) diff --git a/discovery/youtube-v3.json b/discovery/youtube-v3.json index ac111201fa..8345b6c506 100644 --- a/discovery/youtube-v3.json +++ b/discovery/youtube-v3.json @@ -1757,7 +1757,7 @@ }, "maxResults": { "default": "500", - "description": "The *maxResults* parameter specifies the maximum number of items that should be returned in the result set.", + "description": "The *maxResults* parameter specifies the maximum number of items that should be returned in the result set. Not used in the streaming RPC.", "format": "uint32", "location": "query", "maximum": "2000", @@ -4067,12 +4067,73 @@ "$ref": "CommentThread" } } + }, + "resources": { + "liveChat": { + "resources": { + "messages": { + "methods": { + "stream": { + "description": "Allows a user to load live chat through a server-streamed RPC.", + "flatPath": "youtube/v3/liveChat/messages/stream", + "httpMethod": "GET", + "id": "youtube.youtube.v3.liveChat.messages.stream", + "parameterOrder": [], + "parameters": { + "hl": { + "description": "Specifies the localization language in which the system messages should be returned.", + "location": "query", + "type": "string" + }, + "liveChatId": { + "description": "The id of the live chat for which comments should be returned.", + "location": "query", + "type": "string" + }, + "maxResults": { + "default": "500", + "description": "The *maxResults* parameter specifies the maximum number of items that should be returned in the result set. Not used in the streaming RPC.", + "format": "uint32", + "location": "query", + "maximum": "2000", + "minimum": "200", + "type": "integer" + }, + "pageToken": { + "description": "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.", + "location": "query", + "type": "string" + }, + "part": { + "description": "The *part* parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id, snippet, and authorDetails.", + "location": "query", + "repeated": true, + "type": "string" + }, + "profileImageSize": { + "description": "Specifies the size of the profile image that should be returned for each user.", + "format": "uint32", + "location": "query", + "maximum": "720", + "minimum": "16", + "type": "integer" + } + }, + "path": "youtube/v3/liveChat/messages/stream", + "response": { + "$ref": "LiveChatMessageListResponse" + } + } + } + } + } + } } } } } }, - "revision": "20240926", + "revision": "20241010", "rootUrl": "https://youtube.googleapis.com/", "schemas": { "AbuseReport": { diff --git a/src/apis/youtube/v3.ts b/src/apis/youtube/v3.ts index bbbc613a33..df9d2e566a 100644 --- a/src/apis/youtube/v3.ts +++ b/src/apis/youtube/v3.ts @@ -8788,7 +8788,7 @@ export namespace youtube_v3 { */ liveChatId?: string; /** - * The *maxResults* parameter specifies the maximum number of items that should be returned in the result set. + * The *maxResults* parameter specifies the maximum number of items that should be returned in the result set. Not used in the streaming RPC. */ maxResults?: number; /** @@ -13780,8 +13780,10 @@ export namespace youtube_v3 { export class Resource$Youtube$V3 { context: APIRequestContext; + liveChat: Resource$Youtube$V3$Livechat; constructor(context: APIRequestContext) { this.context = context; + this.liveChat = new Resource$Youtube$V3$Livechat(this.context); } /** @@ -13887,4 +13889,143 @@ export namespace youtube_v3 { */ requestBody?: Schema$CommentThread; } + + export class Resource$Youtube$V3$Livechat { + context: APIRequestContext; + messages: Resource$Youtube$V3$Livechat$Messages; + constructor(context: APIRequestContext) { + this.context = context; + this.messages = new Resource$Youtube$V3$Livechat$Messages(this.context); + } + } + + export class Resource$Youtube$V3$Livechat$Messages { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * Allows a user to load live chat through a server-streamed RPC. + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + stream( + params: Params$Resource$Youtube$V3$Livechat$Messages$Stream, + options: StreamMethodOptions + ): GaxiosPromise; + stream( + params?: Params$Resource$Youtube$V3$Livechat$Messages$Stream, + options?: MethodOptions + ): GaxiosPromise; + stream( + params: Params$Resource$Youtube$V3$Livechat$Messages$Stream, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + stream( + params: Params$Resource$Youtube$V3$Livechat$Messages$Stream, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + stream( + params: Params$Resource$Youtube$V3$Livechat$Messages$Stream, + callback: BodyResponseCallback + ): void; + stream( + callback: BodyResponseCallback + ): void; + stream( + paramsOrCallback?: + | Params$Resource$Youtube$V3$Livechat$Messages$Stream + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Youtube$V3$Livechat$Messages$Stream; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Youtube$V3$Livechat$Messages$Stream; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://youtube.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/messages/stream').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + apiVersion: '', + }, + options + ), + params, + requiredParams: [], + pathParams: [], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Youtube$V3$Livechat$Messages$Stream + extends StandardParameters { + /** + * Specifies the localization language in which the system messages should be returned. + */ + hl?: string; + /** + * The id of the live chat for which comments should be returned. + */ + liveChatId?: string; + /** + * The *maxResults* parameter specifies the maximum number of items that should be returned in the result set. Not used in the streaming RPC. + */ + maxResults?: number; + /** + * 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. + */ + pageToken?: string; + /** + * The *part* parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id, snippet, and authorDetails. + */ + part?: string[]; + /** + * Specifies the size of the profile image that should be returned for each user. + */ + profileImageSize?: number; + } }