diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d4e2b3e..c24d654 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -46,6 +46,7 @@ Sources/Models/CaptionsListResponse.swift Sources/Models/CaptionsUpdatePayload.swift Sources/Models/Chapter.swift Sources/Models/ChaptersListResponse.swift +Sources/Models/DiscardedVideoUpdatePayload.swift Sources/Models/Environment.swift Sources/Models/FilterBy.swift Sources/Models/FilterBy1.swift @@ -130,6 +131,7 @@ docs/CaptionsUpdatePayload.md docs/Chapter.md docs/ChaptersAPI.md docs/ChaptersListResponse.md +docs/DiscardedVideoUpdatePayload.md docs/FilterBy.md docs/FilterBy1.md docs/FilterBy2.md diff --git a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 index c8d66fb..c691017 100644 --- a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 +++ b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 @@ -1 +1 @@ -b89163ac996bc8f2bcaf0a054a6a9c28de9b0cf52e16fbcb17055f42852e2a57 \ No newline at end of file +17ac0a7b292afb851962592fd7280e7727bb901d5d4e2a3f75808aa76a1ecdf5 \ No newline at end of file diff --git a/ApiVideoClient.podspec b/ApiVideoClient.podspec index fd94628..5b470c9 100644 --- a/ApiVideoClient.podspec +++ b/ApiVideoClient.podspec @@ -5,8 +5,8 @@ Pod::Spec.new do |s| s.tvos.deployment_target = '10.0' # Add back when CocoaPods/CocoaPods#11558 is released #s.watchos.deployment_target = '3.0' - s.version = '1.3.1' - s.source = { :git => 'https://github.com/apivideo/api.video-swift-client', :tag => 'v1.3.1' } + s.version = '1.3.2' + s.source = { :git => 'https://github.com/apivideo/api.video-swift-client', :tag => 'v1.3.2' } s.authors = { 'Ecosystem Team' => 'ecosystem@api.video' } s.license = { :type => 'MIT' } s.homepage = 'https://docs.api.video' diff --git a/CHANGELOG.md b/CHANGELOG.md index a7baa86..4f7d8f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.3.2] - 2024-09-16 +- Add discarded video endpoints + ## [1.3.1] - 2024-09-05 - Add sort parameters in analytics endpoints diff --git a/README.md b/README.md index 1119784..ee5c913 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,14 @@ api.video's Swift API client for iOS, macOS and tvOS streamlines the coding proc Specify it in your `Cartfile`: ``` -github "apivideo/api.video-swift-client" ~> 1.3.1 +github "apivideo/api.video-swift-client" ~> 1.3.2 ``` Run `carthage update` #### CocoaPods -Add `pod 'ApiVideoClient', '1.3.1'` in your `Podfile` +Add `pod 'ApiVideoClient', '1.3.2'` in your `Podfile` Run `pod install` @@ -228,7 +228,10 @@ Method | HTTP request | Description [**list**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#list) | **GET** `/videos` | List all video objects [**uploadThumbnail**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#uploadThumbnail) | **POST** `/videos/{videoId}/thumbnail` | Upload a thumbnail [**pickThumbnail**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#pickThumbnail) | **PATCH** `/videos/{videoId}/thumbnail` | Set a thumbnail +[**getDiscarded**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#getDiscarded) | **GET** `/discarded/videos/{videoId}` | Retrieve a discarded video object [**getStatus**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#getStatus) | **GET** `/videos/{videoId}/status` | Retrieve video status and details +[**listDiscarded**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#listDiscarded) | **GET** `/discarded/videos` | List all discarded video objects +[**updateDiscarded**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#updateDiscarded) | **PATCH** `/discarded/videos/{videoId}` | Update a discarded video object #### WatermarksAPI @@ -291,6 +294,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) + - [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) - [FilterBy2](https://github.com/apivideo/api.video-swift-client/blob/main/docs/FilterBy2.md) diff --git a/Sources/APIs.swift b/Sources/APIs.swift index d3a96a3..2eead37 100644 --- a/Sources/APIs.swift +++ b/Sources/APIs.swift @@ -8,7 +8,7 @@ import Foundation public class ApiVideoClient { public static var apiKey: String? = nil public static var basePath = "https://ws.api.video" - internal static var customHeaders:[String: String] = ["AV-Origin-Client": "swift:1.3.1"] + internal static var customHeaders:[String: String] = ["AV-Origin-Client": "swift:1.3.2"] private static var chunkSize: Int = 50 * 1024 * 1024 internal static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() internal static var credential = ApiVideoCredential() diff --git a/Sources/APIs/LiveStreamsAPI.swift b/Sources/APIs/LiveStreamsAPI.swift index 480b54a..ce1e095 100644 --- a/Sources/APIs/LiveStreamsAPI.swift +++ b/Sources/APIs/LiveStreamsAPI.swift @@ -282,7 +282,7 @@ open class LiveStreamsAPI { - parameter streamKey: (query) The unique stream key that allows you to stream videos. (optional) - parameter name: (query) You can filter live streams by their name or a part of their name. (optional) - - parameter sortBy: (query) Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. (optional) + - parameter sortBy: (query) Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. (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) @@ -306,7 +306,7 @@ open class LiveStreamsAPI { - parameter streamKey: (query) The unique stream key that allows you to stream videos. (optional) - parameter name: (query) You can filter live streams by their name or a part of their name. (optional) - - parameter sortBy: (query) Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. (optional) + - parameter sortBy: (query) Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. (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) @@ -326,7 +326,7 @@ open class LiveStreamsAPI { - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - parameter streamKey: (query) The unique stream key that allows you to stream videos. (optional) - parameter name: (query) You can filter live streams by their name or a part of their name. (optional) - - parameter sortBy: (query) Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. (optional) + - parameter sortBy: (query) Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. (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) diff --git a/Sources/APIs/PlayerThemesAPI.swift b/Sources/APIs/PlayerThemesAPI.swift index 8a5a402..0c2685b 100644 --- a/Sources/APIs/PlayerThemesAPI.swift +++ b/Sources/APIs/PlayerThemesAPI.swift @@ -280,7 +280,7 @@ open class PlayerThemesAPI { /** List all player themes - - parameter sortBy: (query) createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. (optional) + - parameter sortBy: (query) createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. (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) @@ -302,7 +302,7 @@ open class PlayerThemesAPI { /** List all player themes - - parameter sortBy: (query) createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. (optional) + - parameter sortBy: (query) createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. (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) @@ -320,7 +320,7 @@ open class PlayerThemesAPI { - GET /players - Retrieve a list of all the player themes you created, as well as details about each one. - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - - parameter sortBy: (query) createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. (optional) + - parameter sortBy: (query) createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. (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) diff --git a/Sources/APIs/UploadTokensAPI.swift b/Sources/APIs/UploadTokensAPI.swift index ce4c8d2..029322d 100644 --- a/Sources/APIs/UploadTokensAPI.swift +++ b/Sources/APIs/UploadTokensAPI.swift @@ -214,7 +214,7 @@ open class UploadTokensAPI { /** List all active upload tokens - - parameter sortBy: (query) Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. (optional) + - parameter sortBy: (query) Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-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) @@ -236,7 +236,7 @@ open class UploadTokensAPI { /** List all active upload tokens - - parameter sortBy: (query) Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. (optional) + - parameter sortBy: (query) Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-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) @@ -254,7 +254,7 @@ open class UploadTokensAPI { - GET /upload-tokens - Retrieve a list of all currently active delegated tokens. - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - - parameter sortBy: (query) Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. (optional) + - parameter sortBy: (query) Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. (optional) - parameter sortOrder: (query) Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-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) diff --git a/Sources/APIs/VideosAPI.swift b/Sources/APIs/VideosAPI.swift index 1f1bf5e..30a872f 100644 --- a/Sources/APIs/VideosAPI.swift +++ b/Sources/APIs/VideosAPI.swift @@ -685,7 +685,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo /** Delete a video object - DELETE /videos/{videoId} - - If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. + - If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - parameter videoId: (path) The video ID for the video you want to delete. - returns: RequestBuilder @@ -735,7 +735,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo - parameter title: (query) The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. (optional) - parameter tags: (query) A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. (optional) - - parameter metadata: (query) Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. (optional) + - parameter metadata: (query) Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. (optional) - parameter description: (query) Retrieve video objects by `description`. (optional) - parameter liveStreamId: (query) Retrieve video objects that were recorded from a live stream by `liveStreamId`. (optional) - parameter sortBy: (query) Use this parameter to sort videos by the their created time, published time, updated time, or by title. (optional) @@ -762,7 +762,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo - parameter title: (query) The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. (optional) - parameter tags: (query) A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. (optional) - - parameter metadata: (query) Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. (optional) + - parameter metadata: (query) Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. (optional) - parameter description: (query) Retrieve video objects by `description`. (optional) - parameter liveStreamId: (query) Retrieve video objects that were recorded from a live stream by `liveStreamId`. (optional) - parameter sortBy: (query) Use this parameter to sort videos by the their created time, published time, updated time, or by title. (optional) @@ -785,7 +785,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - parameter title: (query) The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. (optional) - parameter tags: (query) A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. (optional) - - parameter metadata: (query) Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. (optional) + - parameter metadata: (query) Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. (optional) - parameter description: (query) Retrieve video objects by `description`. (optional) - parameter liveStreamId: (query) Retrieve video objects that were recorded from a live stream by `liveStreamId`. (optional) - parameter sortBy: (query) Use this parameter to sort videos by the their created time, published time, updated time, or by title. (optional) @@ -981,6 +981,68 @@ There may be a short delay for the thumbnail to update. } + /** + Retrieve a discarded video object + + - parameter videoId: (path) The unique identifier for the video you want details about. + - 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 getDiscarded(videoId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: Video?, _ error: Error?) -> Void)) -> RequestTask { + return getDiscarded(videoId: videoId, apiResponseQueue: apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Retrieve a discarded video object + + - parameter videoId: (path) The unique identifier for the video you want details about. + - 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 getDiscarded(videoId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return getDiscardedWithRequestBuilder(videoId: videoId).execute(apiResponseQueue, completion) + } + + + /** + Retrieve a discarded video object + - GET /discarded/videos/{videoId} + - This call provides the same information provided on video creation. For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL. + - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] + - parameter videoId: (path) The unique identifier for the video you want details about. + - returns: RequestBuilder