|
| 1 | +// |
| 2 | +// TagsAPI.swift |
| 3 | +// |
| 4 | +// Generated by openapi-generator |
| 5 | +// https://openapi-generator.tech |
| 6 | +// |
| 7 | + |
| 8 | +import Foundation |
| 9 | +#if canImport(AnyCodable) |
| 10 | +import AnyCodable |
| 11 | +#endif |
| 12 | + |
| 13 | +open class TagsAPI { |
| 14 | + |
| 15 | + /** |
| 16 | + * enum for parameter sortBy |
| 17 | + */ |
| 18 | + public enum SortByList: String, CaseIterable { |
| 19 | + case value = "value" |
| 20 | + case videocount = "videoCount" |
| 21 | + } |
| 22 | + |
| 23 | + /** |
| 24 | + * enum for parameter sortOrder |
| 25 | + */ |
| 26 | + public enum SortOrderList: String, CaseIterable { |
| 27 | + case asc = "asc" |
| 28 | + case desc = "desc" |
| 29 | + } |
| 30 | + |
| 31 | + /** |
| 32 | + List all video tags |
| 33 | + |
| 34 | + - 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) |
| 35 | + - 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) |
| 36 | + - 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) |
| 37 | + - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) |
| 38 | + - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) |
| 39 | + - parameter apiResponseQueue: The queue on which api response is dispatched. |
| 40 | + - parameter completion: completion handler to receive the data and the error objects. |
| 41 | + */ |
| 42 | + @discardableResult |
| 43 | + 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 { |
| 44 | + return list(value: value, sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize, apiResponseQueue: apiResponseQueue) { result in |
| 45 | + switch result { |
| 46 | + case let .success(response): |
| 47 | + completion(response.body, nil) |
| 48 | + case let .failure(error): |
| 49 | + completion(nil, error) |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + List all video tags |
| 56 | + |
| 57 | + - 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) |
| 58 | + - 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) |
| 59 | + - 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) |
| 60 | + - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) |
| 61 | + - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) |
| 62 | + - parameter apiResponseQueue: The queue on which api response is dispatched. |
| 63 | + - parameter completion: completion handler to receive the result of the request (incl. headers). |
| 64 | + */ |
| 65 | + @discardableResult |
| 66 | + 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 { |
| 67 | + return listWithRequestBuilder(value: value, sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue, completion) |
| 68 | + } |
| 69 | + |
| 70 | + |
| 71 | + /** |
| 72 | + List all video tags |
| 73 | + - GET /tags |
| 74 | + - 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. |
| 75 | + - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] |
| 76 | + - 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) |
| 77 | + - 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) |
| 78 | + - 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) |
| 79 | + - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) |
| 80 | + - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) |
| 81 | + - returns: RequestBuilder<ListTagsResponse> |
| 82 | + */ |
| 83 | + internal class func listWithRequestBuilder(value: String? = nil, sortBy: SortByList? = nil, sortOrder: SortOrderList? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder<ListTagsResponse> { |
| 84 | + let localVariablePath = "/tags" |
| 85 | + let localVariableURLString = ApiVideoClient.basePath + localVariablePath |
| 86 | + let localVariableParameters: [String: Any]? = nil |
| 87 | + |
| 88 | + var localVariableUrlComponents = URLComponents(string: localVariableURLString) |
| 89 | + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ |
| 90 | + "value": value?.encodeToJSON(), |
| 91 | + "sortBy": sortBy?.encodeToJSON(), |
| 92 | + "sortOrder": sortOrder?.encodeToJSON(), |
| 93 | + "currentPage": currentPage?.encodeToJSON(), |
| 94 | + "pageSize": pageSize?.encodeToJSON(), |
| 95 | + ]) |
| 96 | + |
| 97 | + |
| 98 | + let localVariableNillableHeaders: [String: Any?] = [ |
| 99 | + : |
| 100 | + ] |
| 101 | + |
| 102 | + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) |
| 103 | + |
| 104 | + let localVariableRequestBuilder: RequestBuilder<ListTagsResponse>.Type = ApiVideoClient.requestBuilderFactory.getBuilder() |
| 105 | + |
| 106 | + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) |
| 107 | + } |
| 108 | + |
| 109 | +} |
0 commit comments