Skip to content

Commit

Permalink
Merge pull request #59 from apivideo/bugfix/swift5_progressive_upload…
Browse files Browse the repository at this point in the history
…_token_video_id

fix(swift5): pass videoId to progressive upload with upload token con…
  • Loading branch information
bot-api-video authored Aug 25, 2023
2 parents 00039a9 + 93b4d1e commit ebd726b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 28 deletions.
4 changes: 2 additions & 2 deletions ApiVideoClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '[email protected]' }
s.license = { :type => 'MIT' }
s.homepage = 'https://docs.api.video'
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion Sources/APIs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions Sources/APIs/AnalyticsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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):
Expand All @@ -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<AnalyticsPlaysResponse>
*/
open class func getLiveStreamsPlaysWithRequestBuilder(from: Date, dimension: Dimension_getLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<AnalyticsPlaysResponse> {
open class func getLiveStreamsPlaysWithRequestBuilder(from: Date, dimension: DimensionGetLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<AnalyticsPlaysResponse> {
let localVariablePath = "/analytics/live-streams/plays"
let localVariableURLString = ApiVideoClient.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand Down Expand Up @@ -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"
Expand All @@ -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):
Expand All @@ -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<AnalyticsPlaysResponse>
*/
open class func getVideosPlaysWithRequestBuilder(from: Date, dimension: Dimension_getVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<AnalyticsPlaysResponse> {
open class func getVideosPlaysWithRequestBuilder(from: Date, dimension: DimensionGetVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<AnalyticsPlaysResponse> {
let localVariablePath = "/analytics/videos/plays"
let localVariableURLString = ApiVideoClient.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand Down
6 changes: 3 additions & 3 deletions Sources/APIs/LiveStreamsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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):
Expand All @@ -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<LiveStreamListResponse>
*/
open class func listWithRequestBuilder(streamKey: String? = nil, name: String? = nil, sortBy: String? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<LiveStreamListResponse> {
open class func listWithRequestBuilder(streamKey: String? = nil, name: String? = nil, sortBy: String? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<LiveStreamListResponse> {
let localVariablePath = "/live-streams"
let localVariableURLString = ApiVideoClient.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand Down
8 changes: 4 additions & 4 deletions Sources/APIs/PlayerThemesAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
}
Expand All @@ -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):
Expand All @@ -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<PlayerThemesListResponse>
*/
open class func listWithRequestBuilder(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<PlayerThemesListResponse> {
open class func listWithRequestBuilder(sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<PlayerThemesListResponse> {
let localVariablePath = "/players"
let localVariableURLString = ApiVideoClient.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand Down
8 changes: 4 additions & 4 deletions Sources/APIs/UploadTokensAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ open class UploadTokensAPI {
/**
* enum for parameter sortBy
*/
public enum SortBy_list: String, CaseIterable {
public enum SortByList: String, CaseIterable {
case createdat = "createdAt"
case ttl = "ttl"
}

/**
* enum for parameter sortOrder
*/
public enum SortOrder_list: String, CaseIterable {
public enum SortOrderList: String, CaseIterable {
case asc = "asc"
case desc = "desc"
}
Expand All @@ -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):
Expand All @@ -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<TokenListResponse>
*/
open class func listWithRequestBuilder(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<TokenListResponse> {
open class func listWithRequestBuilder(sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<TokenListResponse> {
let localVariablePath = "/upload-tokens"
let localVariableURLString = ApiVideoClient.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand Down
10 changes: 5 additions & 5 deletions Sources/APIs/VideosAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Video>, ProgressiveUploadSessionProtocol {
Expand Down Expand Up @@ -601,7 +601,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo
/**
* enum for parameter sortBy
*/
public enum SortBy_list: String, CaseIterable {
public enum SortByList: String, CaseIterable {
case title = "title"
case createdat = "createdAt"
case publishedat = "publishedAt"
Expand All @@ -611,7 +611,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo
/**
* enum for parameter sortOrder
*/
public enum SortOrder_list: String, CaseIterable {
public enum SortOrderList: String, CaseIterable {
case asc = "asc"
case desc = "desc"
}
Expand All @@ -632,7 +632,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo
- parameter completion: completion handler to receive the data and the error objects.
*/
@discardableResult
open class func list(title: String? = nil, tags: [String]? = nil, metadata: [String: String]? = nil, description: String? = nil, liveStreamId: String? = nil, sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: VideosListResponse?, _ error: Error?) -> Void)) -> RequestTask {
open class func list(title: String? = nil, tags: [String]? = nil, metadata: [String: String]? = nil, description: String? = nil, liveStreamId: String? = nil, sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: VideosListResponse?, _ error: Error?) -> Void)) -> RequestTask {
return listWithRequestBuilder(title: title, tags: tags, metadata: metadata, description: description, liveStreamId: liveStreamId, sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
Expand All @@ -659,7 +659,7 @@ NOTE: If you are updating an array, you must provide the entire array as what yo
- parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25)
- returns: RequestBuilder<VideosListResponse>
*/
open class func listWithRequestBuilder(title: String? = nil, tags: [String]? = nil, metadata: [String: String]? = nil, description: String? = nil, liveStreamId: String? = nil, sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<VideosListResponse> {
open class func listWithRequestBuilder(title: String? = nil, tags: [String]? = nil, metadata: [String: String]? = nil, description: String? = nil, liveStreamId: String? = nil, sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<VideosListResponse> {
let localVariablePath = "/videos"
let localVariableURLString = ApiVideoClient.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand Down
2 changes: 1 addition & 1 deletion project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ targets:
sources: [Sources]
info:
path: ./Info.plist
version: 1.2.0
version: 1.2.1
settings:
APPLICATION_EXTENSION_API_ONLY: true
scheme: {}
Expand Down

0 comments on commit ebd726b

Please sign in to comment.