From a802760940dd7ec414a1706b47ea0f4d3994e4c5 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 21 Oct 2024 09:24:29 +0000 Subject: [PATCH] Add summary feature --- .openapi-generator/FILES | 14 + .../oas_apivideo.yaml-defaut-cli.sha256 | 2 +- README.md | 26 ++ Sources/APIs/SummariesAPI.swift | 337 ++++++++++++++++++ Sources/Models/ConflictError.swift | 53 +++ Sources/Models/NotFound.swift | 4 + Sources/Models/SummariesListResponse.swift | 37 ++ Sources/Models/Summary.swift | 69 ++++ Sources/Models/SummaryCreationPayload.swift | 41 +++ Sources/Models/SummarySource.swift | 43 +++ Sources/Models/SummaryUpdatePayload.swift | 43 +++ Sources/Models/VideoCreationPayload.swift | 7 +- Sources/Models/VideoUpdatePayload.swift | 7 +- .../summaries/create/responses/201.json | 8 + .../summaries/create/responses/409.json | 7 + .../getSummarySource/responses/404.json | 6 + .../summaries/list/responses/200.json | 34 ++ .../summaries/update/responses/409.json | 6 + .../payloads/videos/update/responses/409.json | 7 + docs/ConflictError.md | 14 + docs/NotFound.md | 8 +- docs/SummariesAPI.md | 281 +++++++++++++++ docs/SummariesListResponse.md | 11 + docs/Summary.md | 15 + docs/SummaryCreationPayload.md | 11 + docs/SummarySource.md | 12 + docs/SummaryUpdatePayload.md | 12 + docs/VideoCreationPayload.md | 1 + docs/VideoUpdatePayload.md | 1 + docs/VideosAPI.md | 4 +- 30 files changed, 1112 insertions(+), 9 deletions(-) create mode 100644 Sources/APIs/SummariesAPI.swift create mode 100644 Sources/Models/ConflictError.swift create mode 100644 Sources/Models/SummariesListResponse.swift create mode 100644 Sources/Models/Summary.swift create mode 100644 Sources/Models/SummaryCreationPayload.swift create mode 100644 Sources/Models/SummarySource.swift create mode 100644 Sources/Models/SummaryUpdatePayload.swift create mode 100644 Tests/TestResources/payloads/summaries/create/responses/201.json create mode 100644 Tests/TestResources/payloads/summaries/create/responses/409.json create mode 100644 Tests/TestResources/payloads/summaries/getSummarySource/responses/404.json create mode 100644 Tests/TestResources/payloads/summaries/list/responses/200.json create mode 100644 Tests/TestResources/payloads/summaries/update/responses/409.json create mode 100644 Tests/TestResources/payloads/videos/update/responses/409.json create mode 100644 docs/ConflictError.md create mode 100644 docs/SummariesAPI.md create mode 100644 docs/SummariesListResponse.md create mode 100644 docs/Summary.md create mode 100644 docs/SummaryCreationPayload.md create mode 100644 docs/SummarySource.md create mode 100644 docs/SummaryUpdatePayload.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 105a6fe..9b6af6f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -11,6 +11,7 @@ Sources/APIs/CaptionsAPI.swift Sources/APIs/ChaptersAPI.swift Sources/APIs/LiveStreamsAPI.swift Sources/APIs/PlayerThemesAPI.swift +Sources/APIs/SummariesAPI.swift Sources/APIs/TagsAPI.swift Sources/APIs/UploadTokensAPI.swift Sources/APIs/VideosAPI.swift @@ -47,6 +48,7 @@ Sources/Models/CaptionsListResponse.swift Sources/Models/CaptionsUpdatePayload.swift Sources/Models/Chapter.swift Sources/Models/ChaptersListResponse.swift +Sources/Models/ConflictError.swift Sources/Models/DiscardedVideoUpdatePayload.swift Sources/Models/Environment.swift Sources/Models/FilterBy.swift @@ -76,6 +78,11 @@ Sources/Models/Quality.swift Sources/Models/RefreshTokenPayload.swift Sources/Models/RestreamsRequestObject.swift Sources/Models/RestreamsResponseObject.swift +Sources/Models/SummariesListResponse.swift +Sources/Models/Summary.swift +Sources/Models/SummaryCreationPayload.swift +Sources/Models/SummarySource.swift +Sources/Models/SummaryUpdatePayload.swift Sources/Models/TokenCreationPayload.swift Sources/Models/TokenListResponse.swift Sources/Models/TooManyRequests.swift @@ -134,6 +141,7 @@ docs/CaptionsUpdatePayload.md docs/Chapter.md docs/ChaptersAPI.md docs/ChaptersListResponse.md +docs/ConflictError.md docs/DiscardedVideoUpdatePayload.md docs/FilterBy.md docs/FilterBy1.md @@ -163,6 +171,12 @@ docs/Quality.md docs/RefreshTokenPayload.md docs/RestreamsRequestObject.md docs/RestreamsResponseObject.md +docs/SummariesAPI.md +docs/SummariesListResponse.md +docs/Summary.md +docs/SummaryCreationPayload.md +docs/SummarySource.md +docs/SummaryUpdatePayload.md docs/TagsAPI.md docs/TokenCreationPayload.md docs/TokenListResponse.md diff --git a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 index 4621ff6..5fb072e 100644 --- a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 +++ b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 @@ -1 +1 @@ -6f374764cf476ad001123c84953d1980aaf6bc352573020d111594ab74058bf6 \ No newline at end of file +26bc230bbff9cf85d3c88920a464491eb9ba7b54ececc356b72bd81374eac1b7 \ No newline at end of file diff --git a/README.md b/README.md index 64ab475..317357c 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ - [ChaptersAPI](#ChaptersAPI) - [LiveStreamsAPI](#LiveStreamsAPI) - [PlayerThemesAPI](#PlayerThemesAPI) + - [SummariesAPI](#SummariesAPI) - [TagsAPI](#TagsAPI) - [UploadTokensAPI](#UploadTokensAPI) - [VideosAPI](#VideosAPI) @@ -190,6 +191,25 @@ Method | HTTP request | Description [**deleteLogo**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/PlayerThemesAPI.md#deleteLogo) | **DELETE** `/players/{playerId}/logo` | Delete logo +#### SummariesAPI + +##### Retrieve an instance of SummariesAPI: + +```swift +SummariesAPI +``` + +##### Endpoints + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummariesAPI.md#create) | **POST** `/summaries` | Generate video summary +[**update**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummariesAPI.md#update) | **PATCH** `/summaries/{summaryId}/source` | Update summary details +[**delete**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummariesAPI.md#delete) | **DELETE** `/summaries/{summaryId}` | Delete video summary +[**list**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummariesAPI.md#list) | **GET** `/summaries` | List summaries +[**getSummarySource**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummariesAPI.md#getSummarySource) | **GET** `/summaries/{summaryId}/source` | Get summary details + + #### TagsAPI ##### Retrieve an instance of TagsAPI: @@ -310,6 +330,7 @@ Method | HTTP request | Description - [CaptionsUpdatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/CaptionsUpdatePayload.md) - [Chapter](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Chapter.md) - [ChaptersListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/ChaptersListResponse.md) + - [ConflictError](https://github.com/apivideo/api.video-swift-client/blob/main/docs/ConflictError.md) - [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/DiscardedVideoUpdatePayload.md) - [FilterBy](https://github.com/apivideo/api.video-swift-client/blob/main/docs/FilterBy.md) - [FilterBy1](https://github.com/apivideo/api.video-swift-client/blob/main/docs/FilterBy1.md) @@ -337,6 +358,11 @@ Method | HTTP request | Description - [RefreshTokenPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/RefreshTokenPayload.md) - [RestreamsRequestObject](https://github.com/apivideo/api.video-swift-client/blob/main/docs/RestreamsRequestObject.md) - [RestreamsResponseObject](https://github.com/apivideo/api.video-swift-client/blob/main/docs/RestreamsResponseObject.md) + - [SummariesListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummariesListResponse.md) + - [Summary](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Summary.md) + - [SummaryCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummaryCreationPayload.md) + - [SummarySource](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummarySource.md) + - [SummaryUpdatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/SummaryUpdatePayload.md) - [TokenCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenCreationPayload.md) - [TokenListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenListResponse.md) - [TooManyRequests](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TooManyRequests.md) diff --git a/Sources/APIs/SummariesAPI.swift b/Sources/APIs/SummariesAPI.swift new file mode 100644 index 0000000..997ddc8 --- /dev/null +++ b/Sources/APIs/SummariesAPI.swift @@ -0,0 +1,337 @@ +// +// SummariesAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class SummariesAPI { + + /** + Generate video summary + + - parameter summaryCreationPayload: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects. + */ + @discardableResult + open class func create(summaryCreationPayload: SummaryCreationPayload, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: Summary?, _ error: Error?) -> Void)) -> RequestTask { + return create(summaryCreationPayload: summaryCreationPayload, apiResponseQueue: apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Generate video summary + + - parameter summaryCreationPayload: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the result of the request (incl. headers). + */ + @discardableResult + open class func create(summaryCreationPayload: SummaryCreationPayload, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return createWithRequestBuilder(summaryCreationPayload: summaryCreationPayload).execute(apiResponseQueue, completion) + } + + + /** + Generate video summary + - POST /summaries + - Generate a title, 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 + */ + internal class func createWithRequestBuilder(summaryCreationPayload: SummaryCreationPayload) -> RequestBuilder { + let localVariablePath = "/summaries" + let localVariableURLString = ApiVideoClient.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: summaryCreationPayload) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + + /** + Update summary details + + - parameter summaryId: (path) The unique identifier of the summary source you want to update. + - parameter summaryUpdatePayload: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects. + */ + @discardableResult + open class func update(summaryId: String, summaryUpdatePayload: SummaryUpdatePayload, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: SummarySource?, _ error: Error?) -> Void)) -> RequestTask { + return update(summaryId: summaryId, summaryUpdatePayload: summaryUpdatePayload, apiResponseQueue: apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Update summary details + + - parameter summaryId: (path) The unique identifier of the summary source you want to update. + - parameter summaryUpdatePayload: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the result of the request (incl. headers). + */ + @discardableResult + open class func update(summaryId: String, summaryUpdatePayload: SummaryUpdatePayload, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return updateWithRequestBuilder(summaryId: summaryId, summaryUpdatePayload: summaryUpdatePayload).execute(apiResponseQueue, completion) + } + + + /** + 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`. + - 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) + - returns: RequestBuilder + */ + internal class func updateWithRequestBuilder(summaryId: String, summaryUpdatePayload: SummaryUpdatePayload) -> RequestBuilder { + var localVariablePath = "/summaries/{summaryId}/source" + let summaryIdPreEscape = "\(APIHelper.mapValueToPathItem(summaryId))" + let summaryIdPostEscape = summaryIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{summaryId}", with: summaryIdPostEscape, options: .literal, range: nil) + let localVariableURLString = ApiVideoClient.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: summaryUpdatePayload) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + + /** + Delete video summary + + - parameter summaryId: (path) The unique identifier of the summary you want to delete. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects. + */ + @discardableResult + open class func delete(summaryId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { + return delete(summaryId: summaryId, apiResponseQueue: apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Delete video summary + + - parameter summaryId: (path) The unique identifier of the summary you want to delete. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the result of the request (incl. headers). + */ + @discardableResult + open class func delete(summaryId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return deleteWithRequestBuilder(summaryId: summaryId).execute(apiResponseQueue, completion) + } + + + /** + Delete video summary + - DELETE /summaries/{summaryId} + - Delete a summary tied to a video. + - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] + - parameter summaryId: (path) The unique identifier of the summary you want to delete. + - returns: RequestBuilder + */ + internal class func deleteWithRequestBuilder(summaryId: String) -> RequestBuilder { + var localVariablePath = "/summaries/{summaryId}" + let summaryIdPreEscape = "\(APIHelper.mapValueToPathItem(summaryId))" + let summaryIdPostEscape = summaryIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{summaryId}", with: summaryIdPostEscape, options: .literal, range: nil) + let localVariableURLString = ApiVideoClient.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + + /** + List summaries + + - parameter sortBy: (query) Allowed: createdAt. You can search by the time watermark were created at. (optional) + - parameter sortOrder: (query) Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. (optional) + - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) + - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects. + */ + @discardableResult + open class func list(sortBy: String? = nil, sortOrder: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: SummariesListResponse?, _ error: Error?) -> Void)) -> RequestTask { + return list(sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize, apiResponseQueue: apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + List summaries + + - parameter sortBy: (query) Allowed: createdAt. You can search by the time watermark were created at. (optional) + - parameter sortOrder: (query) Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. (optional) + - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) + - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the result of the request (incl. headers). + */ + @discardableResult + open class func list(sortBy: String? = nil, sortOrder: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return listWithRequestBuilder(sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue, completion) + } + + + /** + List summaries + - GET /summaries + - List all summarries for your videos in a project. + - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] + - parameter sortBy: (query) Allowed: createdAt. You can search by the time watermark were created at. (optional) + - parameter sortOrder: (query) Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. (optional) + - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) + - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) + - returns: RequestBuilder + */ + internal class func listWithRequestBuilder(sortBy: String? = nil, sortOrder: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + let localVariablePath = "/summaries" + let localVariableURLString = ApiVideoClient.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "sortBy": sortBy?.encodeToJSON(), + "sortOrder": sortOrder?.encodeToJSON(), + "currentPage": currentPage?.encodeToJSON(), + "pageSize": pageSize?.encodeToJSON(), + ]) + + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + + /** + Get summary details + + - parameter summaryId: (path) The unique identifier of the summary source you want to retrieve. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects. + */ + @discardableResult + open class func getSummarySource(summaryId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: SummarySource?, _ error: Error?) -> Void)) -> RequestTask { + return getSummarySource(summaryId: summaryId, apiResponseQueue: apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Get summary details + + - parameter summaryId: (path) The unique identifier of the summary source you want to retrieve. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the result of the request (incl. headers). + */ + @discardableResult + open class func getSummarySource(summaryId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return getSummarySourceWithRequestBuilder(summaryId: summaryId).execute(apiResponseQueue, completion) + } + + + /** + Get summary details + - GET /summaries/{summaryId}/source + - Get all 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 retrieve. + - returns: RequestBuilder + */ + internal class func getSummarySourceWithRequestBuilder(summaryId: String) -> RequestBuilder { + var localVariablePath = "/summaries/{summaryId}/source" + let summaryIdPreEscape = "\(APIHelper.mapValueToPathItem(summaryId))" + let summaryIdPostEscape = summaryIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{summaryId}", with: summaryIdPostEscape, options: .literal, range: nil) + let localVariableURLString = ApiVideoClient.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + +} diff --git a/Sources/Models/ConflictError.swift b/Sources/Models/ConflictError.swift new file mode 100644 index 0000000..25afc4c --- /dev/null +++ b/Sources/Models/ConflictError.swift @@ -0,0 +1,53 @@ +// +// ConflictError.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ConflictError: Codable, Hashable { + + /** A link to the error documentation. */ + public var type: String? + /** A description of the error that occurred. */ + public var title: String? + /** The name of the parameter that caused the error. */ + public var name: String? + /** The HTTP status code. */ + public var status: Int? + /** A solution for the error. */ + public var detail: String? + + public init(type: String? = nil, title: String? = nil, name: String? = nil, status: Int? = nil, detail: String? = nil) { + self.type = type + self.title = title + self.name = name + self.status = status + self.detail = detail + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case type + case title + case name + case status + case detail + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(type, forKey: .type) + try container.encodeIfPresent(title, forKey: .title) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(status, forKey: .status) + try container.encodeIfPresent(detail, forKey: .detail) + } +} + diff --git a/Sources/Models/NotFound.swift b/Sources/Models/NotFound.swift index c836f7c..87efdb1 100644 --- a/Sources/Models/NotFound.swift +++ b/Sources/Models/NotFound.swift @@ -12,9 +12,13 @@ import AnyCodable public struct NotFound: Codable, Hashable { + /** A link to the error documentation. */ public var type: String? + /** A description of the error that occurred. */ public var title: String? + /** The name of the parameter that caused the error. */ public var name: String? + /** The HTTP status code. */ public var status: Int? public init(type: String? = nil, title: String? = nil, name: String? = nil, status: Int? = nil) { diff --git a/Sources/Models/SummariesListResponse.swift b/Sources/Models/SummariesListResponse.swift new file mode 100644 index 0000000..2698b97 --- /dev/null +++ b/Sources/Models/SummariesListResponse.swift @@ -0,0 +1,37 @@ +// +// SummariesListResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct SummariesListResponse: Codable, Hashable { + + /** An array of summary objects. */ + public var data: [Summary] + public var pagination: Pagination + + public init(data: [Summary], pagination: Pagination) { + self.data = data + self.pagination = pagination + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case data + case pagination + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(data, forKey: .data) + try container.encode(pagination, forKey: .pagination) + } +} + diff --git a/Sources/Models/Summary.swift b/Sources/Models/Summary.swift new file mode 100644 index 0000000..7fffc86 --- /dev/null +++ b/Sources/Models/Summary.swift @@ -0,0 +1,69 @@ +// +// Summary.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Summary: Codable, Hashable { + + public enum Origin: String, Codable, CaseIterable { + case api = "api" + case auto = "auto" + } + public enum SourceStatus: String, Codable, CaseIterable { + case missing = "missing" + case waiting = "waiting" + case failed = "failed" + case completed = "completed" + case unprocessable = "unprocessable" + } + /** The unique identifier of the summary object. */ + public var summaryId: String? + /** Returns the date and time when the summary was created in ATOM date-time format. */ + public var createdAt: Date? + /** Returns the date and time when the summary was last updated in ATOM date-time format. */ + public var updatedAt: Date? + /** The unique identifier of the video object. */ + public var videoId: String? + /** Returns the origin of how the summary was created. - `api` means that no summary was generated automatically. You can add summary manually using the `PATCH /summaries/{summaryId}/source` endpoint operation. Until this happens, `sourceStatus` returns `missing`. - `auto` means that the API generated the summary automatically. */ + public var origin: Origin? + /** Returns the current status of summary generation. `missing`: the input for a summary is not present. `waiting` : the input video is being processed and a summary will be generated. `failed`: a technical issue prevented summary generation. `completed`: the summary is generated. `unprocessable`: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. */ + public var sourceStatus: SourceStatus? + + public init(summaryId: String? = nil, createdAt: Date? = nil, updatedAt: Date? = nil, videoId: String? = nil, origin: Origin? = nil, sourceStatus: SourceStatus? = nil) { + self.summaryId = summaryId + self.createdAt = createdAt + self.updatedAt = updatedAt + self.videoId = videoId + self.origin = origin + self.sourceStatus = sourceStatus + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case summaryId + case createdAt + case updatedAt + case videoId + case origin + case sourceStatus + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(summaryId, forKey: .summaryId) + try container.encodeIfPresent(createdAt, forKey: .createdAt) + try container.encodeIfPresent(updatedAt, forKey: .updatedAt) + try container.encodeIfPresent(videoId, forKey: .videoId) + try container.encodeIfPresent(origin, forKey: .origin) + try container.encodeIfPresent(sourceStatus, forKey: .sourceStatus) + } +} + diff --git a/Sources/Models/SummaryCreationPayload.swift b/Sources/Models/SummaryCreationPayload.swift new file mode 100644 index 0000000..fce1d56 --- /dev/null +++ b/Sources/Models/SummaryCreationPayload.swift @@ -0,0 +1,41 @@ +// +// SummaryCreationPayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct SummaryCreationPayload: Codable, Hashable { + + public enum Origin: String, Codable, CaseIterable { + case auto = "auto" + } + /** 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? + + public init(videoId: String, origin: Origin? = nil) { + self.videoId = videoId + self.origin = origin + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case videoId + case origin + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(videoId, forKey: .videoId) + try container.encodeIfPresent(origin, forKey: .origin) + } +} + diff --git a/Sources/Models/SummarySource.swift b/Sources/Models/SummarySource.swift new file mode 100644 index 0000000..869d5fc --- /dev/null +++ b/Sources/Models/SummarySource.swift @@ -0,0 +1,43 @@ +// +// SummarySource.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +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 + self.abstract = abstract + self.takeaways = takeaways + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case title + case abstract + case takeaways + } + + // Encodable protocol methods + + 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 new file mode 100644 index 0000000..dc2f22d --- /dev/null +++ b/Sources/Models/SummaryUpdatePayload.swift @@ -0,0 +1,43 @@ +// +// SummaryUpdatePayload.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +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 + self.abstract = abstract + self.takeaways = takeaways + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case title + case abstract + case takeaways + } + + // Encodable protocol methods + + 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 0cfadfd..a0ee620 100644 --- a/Sources/Models/VideoCreationPayload.swift +++ b/Sources/Models/VideoCreationPayload.swift @@ -71,8 +71,10 @@ public struct VideoCreationPayload: Codable, Hashable { public var language: Language? /** 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. */ 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? - 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) { + 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) { self.title = title self.description = description self.source = source @@ -86,6 +88,7 @@ public struct VideoCreationPayload: Codable, Hashable { self.watermark = watermark self.language = language self.transcript = transcript + self.transcriptSummary = transcriptSummary } public enum CodingKeys: String, CodingKey, CaseIterable { @@ -102,6 +105,7 @@ public struct VideoCreationPayload: Codable, Hashable { case watermark case language case transcript + case transcriptSummary } // Encodable protocol methods @@ -121,6 +125,7 @@ public struct VideoCreationPayload: Codable, Hashable { try container.encodeIfPresent(watermark, forKey: .watermark) try container.encodeIfPresent(language, forKey: .language) try container.encodeIfPresent(transcript, forKey: .transcript) + try container.encodeIfPresent(transcriptSummary, forKey: .transcriptSummary) } } diff --git a/Sources/Models/VideoUpdatePayload.swift b/Sources/Models/VideoUpdatePayload.swift index 8cd0ee3..7a295ae 100644 --- a/Sources/Models/VideoUpdatePayload.swift +++ b/Sources/Models/VideoUpdatePayload.swift @@ -67,8 +67,10 @@ public struct VideoUpdatePayload: Codable, Hashable { public var language: Language? /** 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. */ 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? - 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) { + 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) { self.playerId = playerId self.title = title self.description = description @@ -79,6 +81,7 @@ public struct VideoUpdatePayload: Codable, Hashable { self.metadata = metadata self.language = language self.transcript = transcript + self.transcriptSummary = transcriptSummary } public enum CodingKeys: String, CodingKey, CaseIterable { @@ -92,6 +95,7 @@ public struct VideoUpdatePayload: Codable, Hashable { case metadata case language case transcript + case transcriptSummary } // Encodable protocol methods @@ -108,6 +112,7 @@ public struct VideoUpdatePayload: Codable, Hashable { try container.encodeIfPresent(metadata, forKey: .metadata) try container.encodeIfPresent(language, forKey: .language) try container.encodeIfPresent(transcript, forKey: .transcript) + try container.encodeIfPresent(transcriptSummary, forKey: .transcriptSummary) } } diff --git a/Tests/TestResources/payloads/summaries/create/responses/201.json b/Tests/TestResources/payloads/summaries/create/responses/201.json new file mode 100644 index 0000000..4144fc4 --- /dev/null +++ b/Tests/TestResources/payloads/summaries/create/responses/201.json @@ -0,0 +1,8 @@ +{ + "summaryId" : "summary_1CGHWuXjhxmeH4WiZ51234", + "createdAt" : "2024-07-14T23:36:07+00:00", + "updatedAt" : "2024-07-14T23:36:07+00:00", + "videoId" : "vilkR8K3N7yrRcxcMt91234", + "origin" : "auto", + "sourceStatus" : "completed" +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/summaries/create/responses/409.json b/Tests/TestResources/payloads/summaries/create/responses/409.json new file mode 100644 index 0000000..8d8965e --- /dev/null +++ b/Tests/TestResources/payloads/summaries/create/responses/409.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/summary-already-exists", + "title" : "A summary already exists or is being created on this video.", + "status" : 409, + "detail" : "You can delete the existing summary and generate a new one.", + "name" : "videoId" +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/summaries/getSummarySource/responses/404.json b/Tests/TestResources/payloads/summaries/getSummarySource/responses/404.json new file mode 100644 index 0000000..01e6e6d --- /dev/null +++ b/Tests/TestResources/payloads/summaries/getSummarySource/responses/404.json @@ -0,0 +1,6 @@ +{ + "type" : "https://docs.api.video/reference/resource-not-found", + "title" : "The requested resource was not found.", + "name" : "summaryId", + "status" : 404 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/summaries/list/responses/200.json b/Tests/TestResources/payloads/summaries/list/responses/200.json new file mode 100644 index 0000000..e057a94 --- /dev/null +++ b/Tests/TestResources/payloads/summaries/list/responses/200.json @@ -0,0 +1,34 @@ +{ + "data" : [ { + "summaryId" : "summary_1CGHWuXjhxmeH4WiZ51234", + "createdAt" : "2024-07-14T23:36:07+00:00", + "updatedAt" : "2024-07-14T23:36:07+00:00", + "videoId" : "vilkR8K3N7yrRcxcMt91234", + "origin" : "auto", + "sourceStatus" : "completed" + }, { + "summaryId" : "summary_123HWuXjhxmeH4WiZ55678", + "createdAt" : "2024-07-15T23:36:07+00:00", + "updatedAt" : "2024-07-15T23:36:07+00:00", + "videoId" : "vibaBXK3N7yrRcxcMt95678", + "origin" : "auto", + "sourceStatus" : "waiting" + } ], + "pagination" : { + "currentPage" : 1, + "pageSize" : 25, + "pagesTotal" : 1, + "itemsTotal" : 11, + "currentPageItems" : 11, + "links" : [ { + "rel" : "self", + "uri" : "https://ws.api.video/summaries?currentPage=1" + }, { + "rel" : "first", + "uri" : "https://ws.api.video/summaries?currentPage=1" + }, { + "rel" : "last", + "uri" : "https://ws.api.video/summaries?currentPage=1" + } ] + } +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/summaries/update/responses/409.json b/Tests/TestResources/payloads/summaries/update/responses/409.json new file mode 100644 index 0000000..5ad057e --- /dev/null +++ b/Tests/TestResources/payloads/summaries/update/responses/409.json @@ -0,0 +1,6 @@ +{ + "type" : "https://docs.api.video/reference/summary-already-exists", + "title" : "A summary already exists or is being created on this video.", + "status" : 409, + "detail" : "You can delete the existing summary and generate a new one." +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/videos/update/responses/409.json b/Tests/TestResources/payloads/videos/update/responses/409.json new file mode 100644 index 0000000..93fe9b8 --- /dev/null +++ b/Tests/TestResources/payloads/videos/update/responses/409.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/summary-already-exists", + "title" : "A summary already exists or is being created on this video.", + "status" : 409, + "detail" : "You can delete the existing summary and generate a new one.", + "name" : "transcriptSummary" +} \ No newline at end of file diff --git a/docs/ConflictError.md b/docs/ConflictError.md new file mode 100644 index 0000000..b5c9547 --- /dev/null +++ b/docs/ConflictError.md @@ -0,0 +1,14 @@ +# ConflictError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | A link to the error documentation. | [optional] +**title** | **String** | A description of the error that occurred. | [optional] +**name** | **String** | The name of the parameter that caused the error. | [optional] +**status** | **Int** | The HTTP status code. | [optional] +**detail** | **String** | A solution for the error. | [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/NotFound.md b/docs/NotFound.md index 122997f..426b1d2 100644 --- a/docs/NotFound.md +++ b/docs/NotFound.md @@ -3,10 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **String** | | [optional] -**title** | **String** | | [optional] -**name** | **String** | | [optional] -**status** | **Int** | | [optional] +**type** | **String** | A link to the error documentation. | [optional] +**title** | **String** | A description of the error that occurred. | [optional] +**name** | **String** | The name of the parameter that caused the error. | [optional] +**status** | **Int** | The HTTP status code. | [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/SummariesAPI.md b/docs/SummariesAPI.md new file mode 100644 index 0000000..3885d13 --- /dev/null +++ b/docs/SummariesAPI.md @@ -0,0 +1,281 @@ +# SummariesAPI + +All URIs are relative to *https://ws.api.video* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create**](SummariesAPI.md#postsummaries) | **POST** /summaries | Generate video summary +[**update**](SummariesAPI.md#patchsummariessummaryidsource) | **PATCH** /summaries/{summaryId}/source | Update summary details +[**delete**](SummariesAPI.md#deletesummariessummaryid) | **DELETE** /summaries/{summaryId} | Delete video summary +[**list**](SummariesAPI.md#getsummaries) | **GET** /summaries | List summaries +[**getSummarySource**](SummariesAPI.md#getsummariessummaryidsource) | **GET** /summaries/{summaryId}/source | Get summary details + + +# **create** +```swift + open class func create(summaryCreationPayload: SummaryCreationPayload, completion: @escaping (_ data: Summary?, _ error: Error?) -> Void) + open class func create(summaryCreationPayload: SummaryCreationPayload, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) +``` + +Generate video summary + +Generate a title, abstract, and key takeaways for a video. + + +### Example +```swift +// 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 | + +// Generate video summary +SummariesAPI.create(summaryCreationPayload: summaryCreationPayload) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryCreationPayload** | [**SummaryCreationPayload**](SummaryCreationPayload.md) | | + +### Return type + +[**Summary**](Summary.md) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update** +```swift + open class func update(summaryId: String, summaryUpdatePayload: SummaryUpdatePayload, completion: @escaping (_ data: SummarySource?, _ error: Error?) -> Void) + open class func update(summaryId: String, summaryUpdatePayload: SummaryUpdatePayload, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) +``` + +Update summary details + +Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +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 | + +// Update summary details +SummariesAPI.update(summaryId: summaryId, summaryUpdatePayload: summaryUpdatePayload) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **String** | The unique identifier of the summary source you want to update. | + **summaryUpdatePayload** | [**SummaryUpdatePayload**](SummaryUpdatePayload.md) | | + +### Return type + +[**SummarySource**](SummarySource.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete** +```swift + open class func delete(summaryId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) + open class func delete(summaryId: String, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) +``` + +Delete video summary + +Delete a summary tied to a video. + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import ApiVideoClient + +let summaryId = "summaryId_example" // String | The unique identifier of the summary you want to delete. + +// Delete video summary +SummariesAPI.delete(summaryId: summaryId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **String** | The unique identifier of the summary you want to delete. | + +### Return type + +Void (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list** +```swift + open class func list(sortBy: String? = nil, sortOrder: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ data: SummariesListResponse?, _ error: Error?) -> Void) + open class func list(sortBy: String? = nil, sortOrder: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) +``` + +List summaries + +List all summarries for your videos in a project. + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import ApiVideoClient + +let sortBy = "sortBy_example" // String | Allowed: createdAt. You can search by the time watermark were created at. (optional) +let sortOrder = "sortOrder_example" // String | Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. (optional) +let currentPage = 987 // Int | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1) +let pageSize = 987 // Int | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25) + +// List summaries +SummariesAPI.list(sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sortBy** | **String** | Allowed: createdAt. You can search by the time watermark were created at. | [optional] + **sortOrder** | **String** | Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. | [optional] + **currentPage** | **Int** | Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] + **pageSize** | **Int** | Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] + +### Return type + +[**SummariesListResponse**](SummariesListResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getSummarySource** +```swift + open class func getSummarySource(summaryId: String, completion: @escaping (_ data: SummarySource?, _ error: Error?) -> Void) + open class func getSummarySource(summaryId: String, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) +``` + +Get summary details + +Get all details for a summary. + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import ApiVideoClient + +let summaryId = "summaryId_example" // String | The unique identifier of the summary source you want to retrieve. + +// Get summary details +SummariesAPI.getSummarySource(summaryId: summaryId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **summaryId** | **String** | The unique identifier of the summary source you want to retrieve. | + +### Return type + +[**SummarySource**](SummarySource.md) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/SummariesListResponse.md b/docs/SummariesListResponse.md new file mode 100644 index 0000000..637d955 --- /dev/null +++ b/docs/SummariesListResponse.md @@ -0,0 +1,11 @@ +# SummariesListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [Summary] | An array of summary objects. | +**pagination** | [**Pagination**](Pagination.md) | | + +[[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/Summary.md b/docs/Summary.md new file mode 100644 index 0000000..ec675a8 --- /dev/null +++ b/docs/Summary.md @@ -0,0 +1,15 @@ +# Summary + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**summaryId** | **String** | The unique identifier of the summary object. | [optional] +**createdAt** | **Date** | Returns the date and time when the summary was created in ATOM date-time format. | [optional] +**updatedAt** | **Date** | Returns the date and time when the summary was last updated in ATOM date-time format. | [optional] +**videoId** | **String** | The unique identifier of the video object. | [optional] +**origin** | **String** | Returns the origin of how the summary was created. - `api` means that no summary was generated automatically. You can add summary manually using the `PATCH /summaries/{summaryId}/source` endpoint operation. Until this happens, `sourceStatus` returns `missing`. - `auto` means that the API generated the summary automatically. | [optional] +**sourceStatus** | **String** | Returns the current status of summary generation. `missing`: the input for a summary is not present. `waiting` : the input video is being processed and a summary will be generated. `failed`: a technical issue prevented summary generation. `completed`: the summary is generated. `unprocessable`: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. | [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/SummaryCreationPayload.md b/docs/SummaryCreationPayload.md new file mode 100644 index 0000000..ce8cd34 --- /dev/null +++ b/docs/SummaryCreationPayload.md @@ -0,0 +1,11 @@ +# SummaryCreationPayload + +## Properties +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] + +[[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 new file mode 100644 index 0000000..b57122d --- /dev/null +++ b/docs/SummarySource.md @@ -0,0 +1,12 @@ +# SummarySource + +## 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] + +[[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/SummaryUpdatePayload.md b/docs/SummaryUpdatePayload.md new file mode 100644 index 0000000..54242ce --- /dev/null +++ b/docs/SummaryUpdatePayload.md @@ -0,0 +1,12 @@ +# SummaryUpdatePayload + +## 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] + +[[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/VideoCreationPayload.md b/docs/VideoCreationPayload.md index 0019ddf..3a565a8 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional] **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] [[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 3b150fc..e8b0ebb 100644 --- a/docs/VideoUpdatePayload.md +++ b/docs/VideoUpdatePayload.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **metadata** | [Metadata] | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. | [optional] **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] [[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 994c5c0..cec4f52 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) // 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) // 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) // 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) // VideoUpdatePayload | // Update a video object VideosAPI.update(videoId: videoId, videoUpdatePayload: videoUpdatePayload) { (response, error) in