-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
olivierapivideo
authored
Sep 27, 2024
1 parent
b716f83
commit 350f38d
Showing
15 changed files
with
339 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
17ac0a7b292afb851962592fd7280e7727bb901d5d4e2a3f75808aa76a1ecdf5 | ||
3fd917525a7ff151e1d54f6eb1cced24739639393e8718ebf6da4058a67d8131 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// | ||
// TagsAPI.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
open class TagsAPI { | ||
|
||
/** | ||
* enum for parameter sortBy | ||
*/ | ||
public enum SortByList: String, CaseIterable { | ||
case value = "value" | ||
case videocount = "videoCount" | ||
} | ||
|
||
/** | ||
* enum for parameter sortOrder | ||
*/ | ||
public enum SortOrderList: String, CaseIterable { | ||
case asc = "asc" | ||
case desc = "desc" | ||
} | ||
|
||
/** | ||
List all video tags | ||
- parameter value: (query) Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. (optional) | ||
- parameter sortBy: (query) Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `value`: Sorts the results based on tag values in alphabetic order. - `videoCount`: Sorts the results based on the number of times a video tag is used. (optional) | ||
- parameter sortOrder: (query) Use this parameter to sort results. `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(value: String? = nil, sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: ListTagsResponse?, _ error: Error?) -> Void)) -> RequestTask { | ||
return list(value: value, 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 all video tags | ||
- parameter value: (query) Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. (optional) | ||
- parameter sortBy: (query) Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `value`: Sorts the results based on tag values in alphabetic order. - `videoCount`: Sorts the results based on the number of times a video tag is used. (optional) | ||
- parameter sortOrder: (query) Use this parameter to sort results. `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(value: String? = nil, sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result<Response<ListTagsResponse>, ErrorResponse>) -> Void) -> RequestTask { | ||
return listWithRequestBuilder(value: value, sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue, completion) | ||
} | ||
|
||
|
||
/** | ||
List all video tags | ||
- GET /tags | ||
- This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project. | ||
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] | ||
- parameter value: (query) Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. (optional) | ||
- parameter sortBy: (query) Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `value`: Sorts the results based on tag values in alphabetic order. - `videoCount`: Sorts the results based on the number of times a video tag is used. (optional) | ||
- parameter sortOrder: (query) Use this parameter to sort results. `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<ListTagsResponse> | ||
*/ | ||
internal class func listWithRequestBuilder(value: String? = nil, sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<ListTagsResponse> { | ||
let localVariablePath = "/tags" | ||
let localVariableURLString = ApiVideoClient.basePath + localVariablePath | ||
let localVariableParameters: [String: Any]? = nil | ||
|
||
var localVariableUrlComponents = URLComponents(string: localVariableURLString) | ||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ | ||
"value": value?.encodeToJSON(), | ||
"sortBy": sortBy?.encodeToJSON(), | ||
"sortOrder": sortOrder?.encodeToJSON(), | ||
"currentPage": currentPage?.encodeToJSON(), | ||
"pageSize": pageSize?.encodeToJSON(), | ||
]) | ||
|
||
|
||
let localVariableNillableHeaders: [String: Any?] = [ | ||
: | ||
] | ||
|
||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) | ||
|
||
let localVariableRequestBuilder: RequestBuilder<ListTagsResponse>.Type = ApiVideoClient.requestBuilderFactory.getBuilder() | ||
|
||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// ListTagsResponse.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct ListTagsResponse: Codable, Hashable { | ||
|
||
public var data: [ListTagsResponseData]? | ||
public var pagination: Pagination? | ||
|
||
public init(data: [ListTagsResponseData]? = nil, pagination: Pagination? = nil) { | ||
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.encodeIfPresent(data, forKey: .data) | ||
try container.encodeIfPresent(pagination, forKey: .pagination) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// ListTagsResponseData.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct ListTagsResponseData: Codable, Hashable { | ||
|
||
/** Returns the value of a video tag used in your project. */ | ||
public var value: String? | ||
/** Returns the number of times a video tag is used. */ | ||
public var videoCount: Int? | ||
|
||
public init(value: String? = nil, videoCount: Int? = nil) { | ||
self.value = value | ||
self.videoCount = videoCount | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case value | ||
case videoCount | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(value, forKey: .value) | ||
try container.encodeIfPresent(videoCount, forKey: .videoCount) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"data" : [ { | ||
"value" : "maths", | ||
"videoCount" : "33" | ||
}, { | ||
"value" : "tutorials", | ||
"videoCount" : "10" | ||
} ], | ||
"pagination" : { | ||
"currentPage" : 1, | ||
"pageSize" : 25, | ||
"pagesTotal" : 1, | ||
"itemsTotal" : 2, | ||
"currentPageItems" : 2, | ||
"links" : [ { | ||
"rel" : "self", | ||
"uri" : "https://ws.api.video/watermarks?currentPage=1" | ||
}, { | ||
"rel" : "first", | ||
"uri" : "https://ws.api.video/watermarks?currentPage=1" | ||
}, { | ||
"rel" : "last", | ||
"uri" : "https://ws.api.video/watermarks?currentPage=1" | ||
} ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type" : "https://docs.api.video/reference/too-many-requests", | ||
"title" : "Too many requests.", | ||
"status" : 429 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ListTagsResponse | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**data** | [ListTagsResponseData] | | [optional] | ||
**pagination** | [**Pagination**](Pagination.md) | | [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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ListTagsResponseData | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**value** | **String** | Returns the value of a video tag used in your project. | [optional] | ||
**videoCount** | **Int** | Returns the number of times a video tag is used. | [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) | ||
|
||
|
Oops, something went wrong.