From cafa33e2017709c0044af403516f09fc639e3760 Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Tue, 5 Nov 2024 20:48:49 +0000 Subject: [PATCH] Update Summary endpoints --- .../oas_apivideo.yaml-defaut-cli.sha256 | 2 +- Sources/APIs/SummariesAPI.swift | 4 ++-- Sources/Models/SummaryCreationPayload.swift | 11 ++++++++++- Sources/Models/SummarySource.swift | 7 +------ Sources/Models/SummaryUpdatePayload.swift | 7 +------ Sources/Models/VideoCreationPayload.swift | 11 ++++++++++- Sources/Models/VideoUpdatePayload.swift | 11 ++++++++++- docs/SummariesAPI.md | 8 ++++---- docs/SummaryCreationPayload.md | 1 + docs/SummarySource.md | 1 - docs/SummaryUpdatePayload.md | 1 - docs/VideoCreationPayload.md | 1 + docs/VideoUpdatePayload.md | 1 + docs/VideosAPI.md | 4 ++-- 14 files changed, 44 insertions(+), 26 deletions(-) diff --git a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 index 5e5fa75..d97c87b 100644 --- a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 +++ b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 @@ -1 +1 @@ -3c9f9d1c48428c25a16b809ddeab072c978d6d1c689903a76e3d66a69a36a233 \ No newline at end of file +4ae7edf8587ba07687da3931d634008d47a2232885067a33c603c65c22c82430 \ No newline at end of file diff --git a/Sources/APIs/SummariesAPI.swift b/Sources/APIs/SummariesAPI.swift index 75a04dd..6c6d8c6 100644 --- a/Sources/APIs/SummariesAPI.swift +++ b/Sources/APIs/SummariesAPI.swift @@ -47,7 +47,7 @@ open class SummariesAPI { /** Generate video summary - POST /summaries - - Generate a title, abstract, and key takeaways for a video. + - Generate an abstract and key takeaways for a video. - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - parameter summaryCreationPayload: (body) - returns: RequestBuilder @@ -108,7 +108,7 @@ open class SummariesAPI { /** Update summary details - PATCH /summaries/{summaryId}/source - - Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + - Update details for a summary. - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - parameter summaryId: (path) The unique identifier of the summary source you want to update. - parameter summaryUpdatePayload: (body) diff --git a/Sources/Models/SummaryCreationPayload.swift b/Sources/Models/SummaryCreationPayload.swift index fce1d56..04ab02d 100644 --- a/Sources/Models/SummaryCreationPayload.swift +++ b/Sources/Models/SummaryCreationPayload.swift @@ -15,19 +15,27 @@ public struct SummaryCreationPayload: Codable, Hashable { public enum Origin: String, Codable, CaseIterable { case auto = "auto" } + public enum Attributes: String, Codable, CaseIterable { + case abstract = "abstract" + case takeaways = "takeaways" + } /** Create a summary of a video using the video ID. */ public var videoId: String /** Use this parameter to define how the API generates the summary. The only allowed value is `auto`, which means that the API generates a summary automatically. If you do not set this parameter, **the API will not generate a summary automatically**. In this case, `sourceStatus` will return `missing`, and you have to manually add a summary using the `PATCH /summaries/{summaryId}/source` endpoint operation. */ public var origin: Origin? + /** Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. */ + public var attributes: [Attributes]? - public init(videoId: String, origin: Origin? = nil) { + public init(videoId: String, origin: Origin? = nil, attributes: [Attributes]? = nil) { self.videoId = videoId self.origin = origin + self.attributes = attributes } public enum CodingKeys: String, CodingKey, CaseIterable { case videoId case origin + case attributes } // Encodable protocol methods @@ -36,6 +44,7 @@ public struct SummaryCreationPayload: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(videoId, forKey: .videoId) try container.encodeIfPresent(origin, forKey: .origin) + try container.encodeIfPresent(attributes, forKey: .attributes) } } diff --git a/Sources/Models/SummarySource.swift b/Sources/Models/SummarySource.swift index 869d5fc..a24473e 100644 --- a/Sources/Models/SummarySource.swift +++ b/Sources/Models/SummarySource.swift @@ -12,21 +12,17 @@ import AnyCodable public struct SummarySource: Codable, Hashable { - /** A video title, based on the contents of the video. */ - public var title: String? /** A short outline of the contents of the video. The length of an `abstract` depends on the amount of content in a video that can be transcribed. The API condenses the contents into minimum 20, maximum 300 words. */ public var abstract: String? /** A list of 3 key points from the video, in chronological order. */ public var takeaways: [String]? - public init(title: String? = nil, abstract: String? = nil, takeaways: [String]? = nil) { - self.title = title + public init(abstract: String? = nil, takeaways: [String]? = nil) { self.abstract = abstract self.takeaways = takeaways } public enum CodingKeys: String, CodingKey, CaseIterable { - case title case abstract case takeaways } @@ -35,7 +31,6 @@ public struct SummarySource: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(title, forKey: .title) try container.encodeIfPresent(abstract, forKey: .abstract) try container.encodeIfPresent(takeaways, forKey: .takeaways) } diff --git a/Sources/Models/SummaryUpdatePayload.swift b/Sources/Models/SummaryUpdatePayload.swift index dc2f22d..57dd2c9 100644 --- a/Sources/Models/SummaryUpdatePayload.swift +++ b/Sources/Models/SummaryUpdatePayload.swift @@ -12,21 +12,17 @@ import AnyCodable public struct SummaryUpdatePayload: Codable, Hashable { - /** A video title, based on the contents of the video. */ - public var title: String? /** A short outline of the contents of the video. */ public var abstract: String? /** A list of 3 key points from the video, in chronological order. */ public var takeaways: [String]? - public init(title: String? = nil, abstract: String? = nil, takeaways: [String]? = nil) { - self.title = title + public init(abstract: String? = nil, takeaways: [String]? = nil) { self.abstract = abstract self.takeaways = takeaways } public enum CodingKeys: String, CodingKey, CaseIterable { - case title case abstract case takeaways } @@ -35,7 +31,6 @@ public struct SummaryUpdatePayload: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(title, forKey: .title) try container.encodeIfPresent(abstract, forKey: .abstract) try container.encodeIfPresent(takeaways, forKey: .takeaways) } diff --git a/Sources/Models/VideoCreationPayload.swift b/Sources/Models/VideoCreationPayload.swift index a0ee620..139ac3b 100644 --- a/Sources/Models/VideoCreationPayload.swift +++ b/Sources/Models/VideoCreationPayload.swift @@ -47,6 +47,10 @@ public struct VideoCreationPayload: Codable, Hashable { case vi = "vi" case zh = "zh" } + public enum TranscriptSummaryAttributes: String, Codable, CaseIterable { + case abstract = "abstract" + case takeaways = "takeaways" + } /** The title of your new video. */ public var title: String /** A brief description of your video. */ @@ -73,8 +77,10 @@ public struct VideoCreationPayload: Codable, Hashable { public var transcript: Bool? /** Use this parameter to enable summarization. We recommend using this parameter together with `transcript: true`. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. */ public var transcriptSummary: Bool? + /** Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. */ + public var transcriptSummaryAttributes: [TranscriptSummaryAttributes]? - public init(title: String, description: String? = nil, source: String? = nil, _public: Bool? = true, panoramic: Bool? = false, mp4Support: Bool? = true, playerId: String? = nil, tags: [String]? = nil, metadata: [Metadata]? = nil, clip: VideoClip? = nil, watermark: VideoWatermark? = nil, language: Language? = nil, transcript: Bool? = nil, transcriptSummary: Bool? = nil) { + public init(title: String, description: String? = nil, source: String? = nil, _public: Bool? = true, panoramic: Bool? = false, mp4Support: Bool? = true, playerId: String? = nil, tags: [String]? = nil, metadata: [Metadata]? = nil, clip: VideoClip? = nil, watermark: VideoWatermark? = nil, language: Language? = nil, transcript: Bool? = nil, transcriptSummary: Bool? = nil, transcriptSummaryAttributes: [TranscriptSummaryAttributes]? = nil) { self.title = title self.description = description self.source = source @@ -89,6 +95,7 @@ public struct VideoCreationPayload: Codable, Hashable { self.language = language self.transcript = transcript self.transcriptSummary = transcriptSummary + self.transcriptSummaryAttributes = transcriptSummaryAttributes } public enum CodingKeys: String, CodingKey, CaseIterable { @@ -106,6 +113,7 @@ public struct VideoCreationPayload: Codable, Hashable { case language case transcript case transcriptSummary + case transcriptSummaryAttributes } // Encodable protocol methods @@ -126,6 +134,7 @@ public struct VideoCreationPayload: Codable, Hashable { try container.encodeIfPresent(language, forKey: .language) try container.encodeIfPresent(transcript, forKey: .transcript) try container.encodeIfPresent(transcriptSummary, forKey: .transcriptSummary) + try container.encodeIfPresent(transcriptSummaryAttributes, forKey: .transcriptSummaryAttributes) } } diff --git a/Sources/Models/VideoUpdatePayload.swift b/Sources/Models/VideoUpdatePayload.swift index 7a295ae..572c59a 100644 --- a/Sources/Models/VideoUpdatePayload.swift +++ b/Sources/Models/VideoUpdatePayload.swift @@ -47,6 +47,10 @@ public struct VideoUpdatePayload: Codable, Hashable { case vi = "vi" case zh = "zh" } + public enum TranscriptSummaryAttributes: String, Codable, CaseIterable { + case abstract = "abstract" + case takeaways = "takeaways" + } /** The unique ID for the player you want to associate with your video. */ public var playerId: NullableString? /** The title you want to use for your video. */ @@ -69,8 +73,10 @@ public struct VideoUpdatePayload: Codable, Hashable { public var transcript: Bool? /** Use this parameter to enable summarization. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. */ public var transcriptSummary: Bool? + /** Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. */ + public var transcriptSummaryAttributes: [TranscriptSummaryAttributes]? - public init(playerId: NullableString? = nil, title: String? = nil, description: String? = nil, _public: Bool? = nil, panoramic: Bool? = nil, mp4Support: Bool? = nil, tags: [String]? = nil, metadata: [Metadata]? = nil, language: Language? = nil, transcript: Bool? = nil, transcriptSummary: Bool? = nil) { + public init(playerId: NullableString? = nil, title: String? = nil, description: String? = nil, _public: Bool? = nil, panoramic: Bool? = nil, mp4Support: Bool? = nil, tags: [String]? = nil, metadata: [Metadata]? = nil, language: Language? = nil, transcript: Bool? = nil, transcriptSummary: Bool? = nil, transcriptSummaryAttributes: [TranscriptSummaryAttributes]? = nil) { self.playerId = playerId self.title = title self.description = description @@ -82,6 +88,7 @@ public struct VideoUpdatePayload: Codable, Hashable { self.language = language self.transcript = transcript self.transcriptSummary = transcriptSummary + self.transcriptSummaryAttributes = transcriptSummaryAttributes } public enum CodingKeys: String, CodingKey, CaseIterable { @@ -96,6 +103,7 @@ public struct VideoUpdatePayload: Codable, Hashable { case language case transcript case transcriptSummary + case transcriptSummaryAttributes } // Encodable protocol methods @@ -113,6 +121,7 @@ public struct VideoUpdatePayload: Codable, Hashable { try container.encodeIfPresent(language, forKey: .language) try container.encodeIfPresent(transcript, forKey: .transcript) try container.encodeIfPresent(transcriptSummary, forKey: .transcriptSummary) + try container.encodeIfPresent(transcriptSummaryAttributes, forKey: .transcriptSummaryAttributes) } } diff --git a/docs/SummariesAPI.md b/docs/SummariesAPI.md index 2159940..a707119 100644 --- a/docs/SummariesAPI.md +++ b/docs/SummariesAPI.md @@ -19,7 +19,7 @@ Method | HTTP request | Description Generate video summary -Generate a title, abstract, and key takeaways for a video. +Generate an abstract and key takeaways for a video. ### Example @@ -27,7 +27,7 @@ Generate a title, abstract, and key takeaways for a video. // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new import ApiVideoClient -let summaryCreationPayload = SummaryCreationPayload(videoId: "videoId_example", origin: "origin_example") // SummaryCreationPayload | +let summaryCreationPayload = SummaryCreationPayload(videoId: "videoId_example", origin: "origin_example", attributes: ["attributes_example"]) // SummaryCreationPayload | // Generate video summary SummariesAPI.create(summaryCreationPayload: summaryCreationPayload) { (response, error) in @@ -71,7 +71,7 @@ Name | Type | Description | Notes Update summary details -Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. +Update details for a summary. ### Example @@ -80,7 +80,7 @@ Update details for a summary. Note that this operation is only allowed for summa import ApiVideoClient let summaryId = "summaryId_example" // String | The unique identifier of the summary source you want to update. -let summaryUpdatePayload = SummaryUpdatePayload(title: "title_example", abstract: "abstract_example", takeaways: ["takeaways_example"]) // SummaryUpdatePayload | +let summaryUpdatePayload = SummaryUpdatePayload(abstract: "abstract_example", takeaways: ["takeaways_example"]) // SummaryUpdatePayload | // Update summary details SummariesAPI.update(summaryId: summaryId, summaryUpdatePayload: summaryUpdatePayload) { (response, error) in diff --git a/docs/SummaryCreationPayload.md b/docs/SummaryCreationPayload.md index ce8cd34..c9dcee7 100644 --- a/docs/SummaryCreationPayload.md +++ b/docs/SummaryCreationPayload.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **videoId** | **String** | Create a summary of a video using the video ID. | **origin** | **String** | Use this parameter to define how the API generates the summary. The only allowed value is `auto`, which means that the API generates a summary automatically. If you do not set this parameter, **the API will not generate a summary automatically**. In this case, `sourceStatus` will return `missing`, and you have to manually add a summary using the `PATCH /summaries/{summaryId}/source` endpoint operation. | [optional] +**attributes** | **[String]** | Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SummarySource.md b/docs/SummarySource.md index b57122d..15b4683 100644 --- a/docs/SummarySource.md +++ b/docs/SummarySource.md @@ -3,7 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **String** | A video title, based on the contents of the video. | [optional] **abstract** | **String** | A short outline of the contents of the video. The length of an `abstract` depends on the amount of content in a video that can be transcribed. The API condenses the contents into minimum 20, maximum 300 words. | [optional] **takeaways** | **[String]** | A list of 3 key points from the video, in chronological order. | [optional] diff --git a/docs/SummaryUpdatePayload.md b/docs/SummaryUpdatePayload.md index 54242ce..1e6d71c 100644 --- a/docs/SummaryUpdatePayload.md +++ b/docs/SummaryUpdatePayload.md @@ -3,7 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **String** | A video title, based on the contents of the video. | [optional] **abstract** | **String** | A short outline of the contents of the video. | [optional] **takeaways** | **[String]** | A list of 3 key points from the video, in chronological order. | [optional] diff --git a/docs/VideoCreationPayload.md b/docs/VideoCreationPayload.md index 3a565a8..ccd40d5 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **language** | **String** | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional] **transcript** | **Bool** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional] **transcriptSummary** | **Bool** | Use this parameter to enable summarization. We recommend using this parameter together with `transcript: true`. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional] +**transcriptSummaryAttributes** | **[String]** | Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VideoUpdatePayload.md b/docs/VideoUpdatePayload.md index e8b0ebb..61b97df 100644 --- a/docs/VideoUpdatePayload.md +++ b/docs/VideoUpdatePayload.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **language** | **String** | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional] **transcript** | **Bool** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional] **transcriptSummary** | **Bool** | Use this parameter to enable summarization. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional] +**transcriptSummaryAttributes** | **[String]** | Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VideosAPI.md b/docs/VideosAPI.md index cec4f52..428a6fa 100644 --- a/docs/VideosAPI.md +++ b/docs/VideosAPI.md @@ -35,7 +35,7 @@ Creates a video object. More information on video objects can be found [here](ht // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new import ApiVideoClient -let videoCreationPayload = VideoCreationPayload(title: "title_example", description: "description_example", source: "source_example", _public: true, panoramic: false, mp4Support: true, playerId: "playerId_example", tags: ["tags_example"], metadata: [Metadata(key: "key_example", value: "value_example")], clip: VideoClip(startTimecode: "startTimecode_example", endTimecode: "endTimecode_example"), watermark: VideoWatermark(id: "id_example", top: "top_example", _left: "_left_example", bottom: "bottom_example", _right: "_right_example", width: "width_example", height: "height_example", opacity: "opacity_example"), language: "language_example", transcript: false, transcriptSummary: false) // VideoCreationPayload | video to create +let videoCreationPayload = VideoCreationPayload(title: "title_example", description: "description_example", source: "source_example", _public: true, panoramic: false, mp4Support: true, playerId: "playerId_example", tags: ["tags_example"], metadata: [Metadata(key: "key_example", value: "value_example")], clip: VideoClip(startTimecode: "startTimecode_example", endTimecode: "endTimecode_example"), watermark: VideoWatermark(id: "id_example", top: "top_example", _left: "_left_example", bottom: "bottom_example", _right: "_right_example", width: "width_example", height: "height_example", opacity: "opacity_example"), language: "language_example", transcript: false, transcriptSummary: false, transcriptSummaryAttributes: ["transcriptSummaryAttributes_example"]) // VideoCreationPayload | video to create // Create a video object VideosAPI.create(videoCreationPayload: videoCreationPayload) { (response, error) in @@ -272,7 +272,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo import ApiVideoClient let videoId = "videoId_example" // String | The video ID for the video you want to update. -let videoUpdatePayload = VideoUpdatePayload(playerId: NullableString(value: "pl4k0jvEUuaTdRAEjQ4Jfrgz"), title: "title_example", description: "description_example", _public: true, panoramic: false, mp4Support: true, tags: ["tags_example"], metadata: [Metadata(key: "key_example", value: "value_example")], language: "language_example", transcript: false, transcriptSummary: false) // VideoUpdatePayload | +let videoUpdatePayload = VideoUpdatePayload(playerId: NullableString(value: "pl4k0jvEUuaTdRAEjQ4Jfrgz"), title: "title_example", description: "description_example", _public: true, panoramic: false, mp4Support: true, tags: ["tags_example"], metadata: [Metadata(key: "key_example", value: "value_example")], language: "language_example", transcript: false, transcriptSummary: false, transcriptSummaryAttributes: ["transcriptSummaryAttributes_example"]) // VideoUpdatePayload | // Update a video object VideosAPI.update(videoId: videoId, videoUpdatePayload: videoUpdatePayload) { (response, error) in