From a200b365408d245074d96a52adecdd738b0b484c Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Tue, 20 Apr 2021 02:02:41 -0700 Subject: [PATCH] feat(youtube)!: update the API BREAKING CHANGE: This release has breaking changes. #### youtube:v3 The following keys were deleted: - schemas.VideoRatingListResponse.id - schemas.VideoRatingListResponse.properties.etag.description - schemas.VideoRatingListResponse.properties.etag.type - schemas.VideoRatingListResponse.properties.eventId.description - schemas.VideoRatingListResponse.properties.eventId.type - schemas.VideoRatingListResponse.properties.items.description - schemas.VideoRatingListResponse.properties.items.items.$ref - schemas.VideoRatingListResponse.properties.items.type - schemas.VideoRatingListResponse.properties.kind.default - schemas.VideoRatingListResponse.properties.kind.description - schemas.VideoRatingListResponse.properties.kind.type - schemas.VideoRatingListResponse.properties.visitorId.description - schemas.VideoRatingListResponse.properties.visitorId.type - schemas.VideoRatingListResponse.type The following keys were added: - schemas.CaptionSnippet.properties.language.annotations.required - schemas.CaptionSnippet.properties.name.annotations.required - schemas.CdnSettings.properties.format.annotations.required - schemas.CdnSettings.properties.ingestionType.annotations.required - schemas.LiveBroadcast.properties.id.annotations.required - schemas.LiveBroadcastSnippet.properties.scheduledStartTime.annotations.required - schemas.LiveBroadcastSnippet.properties.title.annotations.required - schemas.LiveBroadcastStatus.properties.privacyStatus.annotations.required - schemas.LiveStream.properties.id.annotations.required - schemas.LiveStreamSnippet.properties.title.annotations.required - schemas.PlaylistItemSnippet.properties.playlistId.annotations.required - schemas.PlaylistItemSnippet.properties.resourceId.annotations.required - schemas.PlaylistSnippet.properties.title.annotations.required - schemas.Video.properties.id.annotations.required - schemas.VideoGetRatingResponse.id - schemas.VideoGetRatingResponse.properties.etag.description - schemas.VideoGetRatingResponse.properties.etag.type - schemas.VideoGetRatingResponse.properties.eventId.description - schemas.VideoGetRatingResponse.properties.eventId.type - schemas.VideoGetRatingResponse.properties.items.description - schemas.VideoGetRatingResponse.properties.items.items.$ref - schemas.VideoGetRatingResponse.properties.items.type - schemas.VideoGetRatingResponse.properties.kind.default - schemas.VideoGetRatingResponse.properties.kind.description - schemas.VideoGetRatingResponse.properties.kind.type - schemas.VideoGetRatingResponse.properties.visitorId.description - schemas.VideoGetRatingResponse.properties.visitorId.type - schemas.VideoGetRatingResponse.type The following keys were changed: - resources.search.methods.list.parameters.videoDimension.enumDescriptions - resources.videos.methods.getRating.response.$ref - schemas.ActivityContentDetailsSocial.properties.type.enum - schemas.ChannelSectionSnippet.properties.type.enum - schemas.LiveBroadcastSnippet.properties.scheduledEndTime.description - schemas.LiveBroadcastSnippet.properties.scheduledStartTime.description --- discovery/youtube-v3.json | 153 +++++++++++++++++++++++++++++--------- src/apis/youtube/v3.ts | 70 ++++++++--------- 2 files changed, 151 insertions(+), 72 deletions(-) diff --git a/discovery/youtube-v3.json b/discovery/youtube-v3.json index 479b2aaaf62..d4e8fecbda0 100644 --- a/discovery/youtube-v3.json +++ b/discovery/youtube-v3.json @@ -2723,7 +2723,7 @@ "3d" ], "enumDescriptions": [ - "", + "Include both 3D and non-3D videos in returned results. This is the default value.", "Restrict search results to exclude 3D videos.", "Restrict search results to only include 3D videos." ], @@ -3385,7 +3385,7 @@ }, "path": "youtube/v3/videos/getRating", "response": { - "$ref": "VideoRatingListResponse" + "$ref": "VideoGetRatingResponse" }, "scopes": [ "https://www.googleapis.com/auth/youtube", @@ -3764,7 +3764,7 @@ } } }, - "revision": "20210307", + "revision": "20210417", "rootUrl": "https://youtube.googleapis.com/", "schemas": { "AbuseReport": { @@ -4086,7 +4086,7 @@ "type": { "description": "The name of the social network.", "enum": [ - "typeUnspecified", + "unspecified", "googlePlus", "facebook", "twitter" @@ -4350,6 +4350,11 @@ "type": "boolean" }, "language": { + "annotations": { + "required": [ + "youtube.captions.insert" + ] + }, "description": "The language of the caption track. The property value is a BCP-47 language tag.", "type": "string" }, @@ -4359,6 +4364,11 @@ "type": "string" }, "name": { + "annotations": { + "required": [ + "youtube.captions.insert" + ] + }, "description": "The name of the caption track. The name is intended to be visible to the user as an option during playback.", "type": "string" }, @@ -4407,6 +4417,12 @@ "id": "CdnSettings", "properties": { "format": { + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + }, "description": "The format of the video stream that you are sending to Youtube. ", "type": "string" }, @@ -4429,6 +4445,12 @@ "description": "The ingestionInfo object contains information that YouTube provides that you need to transmit your RTMP or HTTP stream to YouTube." }, "ingestionType": { + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + }, "description": " The method or protocol used to transmit the video stream.", "enum": [ "rtmp", @@ -4908,7 +4930,7 @@ "type": { "description": "The type of the channel section.", "enum": [ - "channelsectionTypeUnspecified", + "channelsectionTypeUndefined", "singlePlaylist", "multiplePlaylists", "popularUploads", @@ -7635,6 +7657,11 @@ "type": "string" }, "id": { + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + }, "description": "The ID that YouTube assigns to uniquely identify the broadcast.", "type": "string" }, @@ -7888,12 +7915,18 @@ "type": "string" }, "scheduledEndTime": { - "description": "The date and time that the broadcast is scheduled to start.", + "description": "The date and time that the broadcast is scheduled to end.", "format": "date-time", "type": "string" }, "scheduledStartTime": { - "description": "The date and time that the broadcast is scheduled to end.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + }, + "description": "The date and time that the broadcast is scheduled to start.", "format": "date-time", "type": "string" }, @@ -7902,6 +7935,12 @@ "description": "A map of thumbnail images associated with the broadcast. For each nested object in this object, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." }, "title": { + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + }, "description": "The broadcast's title. Note that the broadcast represents exactly one YouTube video. You can set this field by modifying the broadcast resource or by setting the title field of the corresponding video resource.", "type": "string" } @@ -7971,6 +8010,12 @@ "type": "boolean" }, "privacyStatus": { + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + }, "description": "The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource.", "enum": [ "public", @@ -8497,6 +8542,11 @@ "type": "string" }, "id": { + "annotations": { + "required": [ + "youtube.liveStreams.update" + ] + }, "description": "The ID that YouTube assigns to uniquely identify the stream.", "type": "string" }, @@ -8735,6 +8785,12 @@ "type": "string" }, "title": { + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + }, "description": "The stream's title. The value must be between 1 and 128 characters long.", "type": "string" } @@ -9233,6 +9289,12 @@ "type": "string" }, "playlistId": { + "annotations": { + "required": [ + "youtube.playlistItems.insert", + "youtube.playlistItems.update" + ] + }, "description": "The ID that YouTube uses to uniquely identify thGe playlist that the playlist item is in.", "type": "string" }, @@ -9248,6 +9310,12 @@ }, "resourceId": { "$ref": "ResourceId", + "annotations": { + "required": [ + "youtube.playlistItems.insert", + "youtube.playlistItems.update" + ] + }, "description": "The id object contains information that can be used to uniquely identify the resource that is included in the playlist as the playlist item." }, "thumbnails": { @@ -9405,6 +9473,12 @@ "description": "A map of thumbnail images associated with the playlist. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." }, "title": { + "annotations": { + "required": [ + "youtube.playlists.insert", + "youtube.playlists.update" + ] + }, "description": "The playlist's title.", "type": "string" } @@ -10099,6 +10173,11 @@ "description": "The fileDetails object encapsulates information about the video file that was uploaded to YouTube, including the file's resolution, duration, audio and video codecs, stream bitrates, and more. This data can only be retrieved by the video owner." }, "id": { + "annotations": { + "required": [ + "youtube.videos.update" + ] + }, "description": "The ID that YouTube uses to uniquely identify the video.", "type": "string" }, @@ -10636,6 +10715,36 @@ }, "type": "object" }, + "VideoGetRatingResponse": { + "id": "VideoGetRatingResponse", + "properties": { + "etag": { + "description": "Etag of this resource.", + "type": "string" + }, + "eventId": { + "description": "Serialized EventId of the request which produced this response.", + "type": "string" + }, + "items": { + "description": "A list of ratings that match the request criteria.", + "items": { + "$ref": "VideoRating" + }, + "type": "array" + }, + "kind": { + "default": "youtube#videoGetRatingResponse", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoGetRatingResponse\".", + "type": "string" + }, + "visitorId": { + "description": "The visitorId identifies the visitor.", + "type": "string" + } + }, + "type": "object" + }, "VideoListResponse": { "id": "VideoListResponse", "properties": { @@ -10878,36 +10987,6 @@ }, "type": "object" }, - "VideoRatingListResponse": { - "id": "VideoRatingListResponse", - "properties": { - "etag": { - "description": "Etag of this resource.", - "type": "string" - }, - "eventId": { - "description": "Serialized EventId of the request which produced this response.", - "type": "string" - }, - "items": { - "description": "A list of ratings that match the request criteria.", - "items": { - "$ref": "VideoRating" - }, - "type": "array" - }, - "kind": { - "default": "youtube#videoGetRatingResponse", - "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoGetRatingResponse\".", - "type": "string" - }, - "visitorId": { - "description": "The visitorId identifies the visitor.", - "type": "string" - } - }, - "type": "object" - }, "VideoRecordingDetails": { "description": "Recording information associated with the video.", "id": "VideoRecordingDetails", diff --git a/src/apis/youtube/v3.ts b/src/apis/youtube/v3.ts index 5f2069359ce..136a4342ddd 100644 --- a/src/apis/youtube/v3.ts +++ b/src/apis/youtube/v3.ts @@ -2135,11 +2135,11 @@ export namespace youtube_v3 { */ publishedAt?: string | null; /** - * The date and time that the broadcast is scheduled to start. + * The date and time that the broadcast is scheduled to end. */ scheduledEndTime?: string | null; /** - * The date and time that the broadcast is scheduled to end. + * The date and time that the broadcast is scheduled to start. */ scheduledStartTime?: string | null; /** @@ -4029,6 +4029,28 @@ export namespace youtube_v3 { */ widthPixels?: number | null; } + export interface Schema$VideoGetRatingResponse { + /** + * Etag of this resource. + */ + etag?: string | null; + /** + * Serialized EventId of the request which produced this response. + */ + eventId?: string | null; + /** + * A list of ratings that match the request criteria. + */ + items?: Schema$VideoRating[]; + /** + * Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse". + */ + kind?: string | null; + /** + * The visitorId identifies the visitor. + */ + visitorId?: string | null; + } export interface Schema$VideoListResponse { /** * Etag of this resource. @@ -4197,28 +4219,6 @@ export namespace youtube_v3 { */ videoId?: string | null; } - export interface Schema$VideoRatingListResponse { - /** - * Etag of this resource. - */ - etag?: string | null; - /** - * Serialized EventId of the request which produced this response. - */ - eventId?: string | null; - /** - * A list of ratings that match the request criteria. - */ - items?: Schema$VideoRating[]; - /** - * Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse". - */ - kind?: string | null; - /** - * The visitorId identifies the visitor. - */ - visitorId?: string | null; - } /** * Recording information associated with the video. */ @@ -15930,7 +15930,7 @@ export namespace youtube_v3 { getRating( params?: Params$Resource$Videos$Getrating, options?: MethodOptions - ): GaxiosPromise; + ): GaxiosPromise; getRating( params: Params$Resource$Videos$Getrating, options: StreamMethodOptions | BodyResponseCallback, @@ -15940,32 +15940,32 @@ export namespace youtube_v3 { params: Params$Resource$Videos$Getrating, options: | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback + | BodyResponseCallback, + callback: BodyResponseCallback ): void; getRating( params: Params$Resource$Videos$Getrating, - callback: BodyResponseCallback + callback: BodyResponseCallback ): void; getRating( - callback: BodyResponseCallback + callback: BodyResponseCallback ): void; getRating( paramsOrCallback?: | Params$Resource$Videos$Getrating - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback ): | void - | GaxiosPromise + | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || {}) as Params$Resource$Videos$Getrating; let options = (optionsOrCallback || {}) as MethodOptions; @@ -15999,12 +15999,12 @@ export namespace youtube_v3 { context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } }