diff --git a/ApiVideoClient.podspec b/ApiVideoClient.podspec index c06722b..0ff9ec0 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.2.0' - s.source = { :git => 'https://github.com/apivideo/api.video-ios-client', :tag => 'v1.2.0' } + s.version = '1.2.1' + s.source = { :git => 'https://github.com/apivideo/api.video-ios-client', :tag => 'v1.2.1' } 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 b541065..f80c81e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All changes to this project will be documented in this file. +## [1.2.1] - 2023-08-25 +- Fix progressive upload with upload token and video id +- Use pascal case for enums + ## [1.2.0] - 2023-06-28 - Introducing new live streams restream feature - Introducing new analytics endpoints diff --git a/README.md b/README.md index b985b93..2baea16 100644 --- a/README.md +++ b/README.md @@ -43,14 +43,14 @@ api.video's iOS streamlines the coding process. Chunking files is handled for y Specify it in your `Cartfile`: ``` -github "apivideo/api.video-ios-client" ~> 1.2.0 +github "apivideo/api.video-ios-client" ~> 1.2.1 ``` Run `carthage update` ### CocoaPods -Add `pod 'ApiVideoClient', '1.2.0'` in your `Podfile` +Add `pod 'ApiVideoClient', '1.2.1'` in your `Podfile` Run `pod install` diff --git a/Sources/APIs.swift b/Sources/APIs.swift index 50a7938..1a471c0 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": "ios:1.2.0"] + internal static var customHeaders:[String: String] = ["AV-Origin-Client": "ios:1.2.1"] private static var chunkSize: Int = 50 * 1024 * 1024 internal static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() internal static var credential = ApiVideoCredential() diff --git a/Sources/APIs/AnalyticsAPI.swift b/Sources/APIs/AnalyticsAPI.swift index 0f7d401..0a69a07 100644 --- a/Sources/APIs/AnalyticsAPI.swift +++ b/Sources/APIs/AnalyticsAPI.swift @@ -15,7 +15,7 @@ open class AnalyticsAPI { /** * enum for parameter dimension */ - public enum Dimension_getLiveStreamsPlays: String, CaseIterable { + public enum DimensionGetLiveStreamsPlays: String, CaseIterable { case livestreamid = "liveStreamId" case emittedat = "emittedAt" case country = "country" @@ -37,7 +37,7 @@ open class AnalyticsAPI { - parameter completion: completion handler to receive the data and the error objects. */ @discardableResult - open class func getLiveStreamsPlays(from: Date, dimension: Dimension_getLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void)) -> RequestTask { + open class func getLiveStreamsPlays(from: Date, dimension: DimensionGetLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void)) -> RequestTask { return getLiveStreamsPlaysWithRequestBuilder(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class AnalyticsAPI { - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - returns: RequestBuilder */ - open class func getLiveStreamsPlaysWithRequestBuilder(from: Date, dimension: Dimension_getLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + open class func getLiveStreamsPlaysWithRequestBuilder(from: Date, dimension: DimensionGetLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { let localVariablePath = "/analytics/live-streams/plays" let localVariableURLString = ApiVideoClient.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil @@ -91,7 +91,7 @@ open class AnalyticsAPI { /** * enum for parameter dimension */ - public enum Dimension_getVideosPlays: String, CaseIterable { + public enum DimensionGetVideosPlays: String, CaseIterable { case videoid = "videoId" case emittedat = "emittedAt" case country = "country" @@ -113,7 +113,7 @@ open class AnalyticsAPI { - parameter completion: completion handler to receive the data and the error objects. */ @discardableResult - open class func getVideosPlays(from: Date, dimension: Dimension_getVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void)) -> RequestTask { + open class func getVideosPlays(from: Date, dimension: DimensionGetVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void)) -> RequestTask { return getVideosPlaysWithRequestBuilder(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -137,7 +137,7 @@ open class AnalyticsAPI { - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - returns: RequestBuilder */ - open class func getVideosPlaysWithRequestBuilder(from: Date, dimension: Dimension_getVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + open class func getVideosPlaysWithRequestBuilder(from: Date, dimension: DimensionGetVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { let localVariablePath = "/analytics/videos/plays" let localVariableURLString = ApiVideoClient.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/APIs/LiveStreamsAPI.swift b/Sources/APIs/LiveStreamsAPI.swift index 4d70a10..0dc9798 100644 --- a/Sources/APIs/LiveStreamsAPI.swift +++ b/Sources/APIs/LiveStreamsAPI.swift @@ -210,7 +210,7 @@ open class LiveStreamsAPI { /** * enum for parameter sortOrder */ - public enum SortOrder_list: String, CaseIterable { + public enum SortOrderList: String, CaseIterable { case asc = "asc" case desc = "desc" } @@ -228,7 +228,7 @@ open class LiveStreamsAPI { - parameter completion: completion handler to receive the data and the error objects. */ @discardableResult - open class func list(streamKey: String? = nil, name: String? = nil, sortBy: String? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: LiveStreamListResponse?, _ error: Error?) -> Void)) -> RequestTask { + open class func list(streamKey: String? = nil, name: String? = nil, sortBy: String? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: LiveStreamListResponse?, _ error: Error?) -> Void)) -> RequestTask { return listWithRequestBuilder(streamKey: streamKey, name: name, sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -252,7 +252,7 @@ open class LiveStreamsAPI { - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - returns: RequestBuilder */ - open class func listWithRequestBuilder(streamKey: String? = nil, name: String? = nil, sortBy: String? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + open class func listWithRequestBuilder(streamKey: String? = nil, name: String? = nil, sortBy: String? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { let localVariablePath = "/live-streams" let localVariableURLString = ApiVideoClient.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/APIs/PlayerThemesAPI.swift b/Sources/APIs/PlayerThemesAPI.swift index e21fea6..4fd0ead 100644 --- a/Sources/APIs/PlayerThemesAPI.swift +++ b/Sources/APIs/PlayerThemesAPI.swift @@ -210,7 +210,7 @@ open class PlayerThemesAPI { /** * enum for parameter sortBy */ - public enum SortBy_list: String, CaseIterable { + public enum SortByList: String, CaseIterable { case name = "name" case createdat = "createdAt" case updatedat = "updatedAt" @@ -219,7 +219,7 @@ open class PlayerThemesAPI { /** * enum for parameter sortOrder */ - public enum SortOrder_list: String, CaseIterable { + public enum SortOrderList: String, CaseIterable { case asc = "asc" case desc = "desc" } @@ -235,7 +235,7 @@ open class PlayerThemesAPI { - parameter completion: completion handler to receive the data and the error objects. */ @discardableResult - open class func list(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: PlayerThemesListResponse?, _ error: Error?) -> Void)) -> RequestTask { + open class func list(sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: PlayerThemesListResponse?, _ error: Error?) -> Void)) -> RequestTask { return listWithRequestBuilder(sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -257,7 +257,7 @@ open class PlayerThemesAPI { - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - returns: RequestBuilder */ - open class func listWithRequestBuilder(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + open class func listWithRequestBuilder(sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { let localVariablePath = "/players" let localVariableURLString = ApiVideoClient.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/APIs/UploadTokensAPI.swift b/Sources/APIs/UploadTokensAPI.swift index 22bdb11..1b07f23 100644 --- a/Sources/APIs/UploadTokensAPI.swift +++ b/Sources/APIs/UploadTokensAPI.swift @@ -159,7 +159,7 @@ open class UploadTokensAPI { /** * enum for parameter sortBy */ - public enum SortBy_list: String, CaseIterable { + public enum SortByList: String, CaseIterable { case createdat = "createdAt" case ttl = "ttl" } @@ -167,7 +167,7 @@ open class UploadTokensAPI { /** * enum for parameter sortOrder */ - public enum SortOrder_list: String, CaseIterable { + public enum SortOrderList: String, CaseIterable { case asc = "asc" case desc = "desc" } @@ -183,7 +183,7 @@ open class UploadTokensAPI { - parameter completion: completion handler to receive the data and the error objects. */ @discardableResult - open class func list(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: TokenListResponse?, _ error: Error?) -> Void)) -> RequestTask { + open class func list(sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: TokenListResponse?, _ error: Error?) -> Void)) -> RequestTask { return listWithRequestBuilder(sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -205,7 +205,7 @@ open class UploadTokensAPI { - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - returns: RequestBuilder */ - open class func listWithRequestBuilder(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + open class func listWithRequestBuilder(sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { let localVariablePath = "/upload-tokens" let localVariableURLString = ApiVideoClient.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/APIs/VideosAPI.swift b/Sources/APIs/VideosAPI.swift index 9e94f5b..409ec4d 100644 --- a/Sources/APIs/VideosAPI.swift +++ b/Sources/APIs/VideosAPI.swift @@ -284,7 +284,7 @@ The latter allows you to split a video source into X chunks and send those chunk - returns: a progressive uploadWithUploadToken session */ public class func buildProgressiveUploadWithUploadTokenSession(token: String, videoId: String? = nil) -> ProgressiveUploadWithUploadTokenSession { - ProgressiveUploadWithUploadTokenSession(token: token) + ProgressiveUploadWithUploadTokenSession(token: token, videoId: videoId) } public class ProgressiveUploadWithUploadTokenSession: RequestTaskQueue