From c0c278d28e0adeca56be88a0deb696df2a950d55 Mon Sep 17 00:00:00 2001 From: Cassius Pacheco Date: Tue, 8 Nov 2022 16:05:04 +1100 Subject: [PATCH] feat!: make clients internal by using nonPublicApi When using the 'nonPublicApi' flag in OpenAPI generator, all clients are made internal by default. This aims to keep the interface consistent, allowing us to expose only the method we see fit through ImmutableX instead of relying on devs using the clients directly. --- CHANGELOG.md | 2 +- .../ImmutableXCore/Generated/APIHelper.swift | 12 +++--- Sources/ImmutableXCore/Generated/APIs.swift | 38 +++++++++---------- .../Generated/APIs/AssetsAPI.swift | 12 +++--- .../Generated/APIs/BalancesAPI.swift | 10 ++--- .../Generated/APIs/CollectionsAPI.swift | 24 ++++++------ .../Generated/APIs/DepositsAPI.swift | 14 +++---- .../Generated/APIs/EncodingAPI.swift | 6 +-- .../Generated/APIs/MetadataAPI.swift | 14 +++---- .../Generated/APIs/MintsAPI.swift | 18 ++++----- .../Generated/APIs/OrdersAPI.swift | 30 +++++++-------- .../Generated/APIs/ProjectsAPI.swift | 14 +++---- .../Generated/APIs/TokensAPI.swift | 10 ++--- .../Generated/APIs/TradesAPI.swift | 18 ++++----- .../Generated/APIs/TransfersAPI.swift | 30 +++++++-------- .../Generated/APIs/UsersAPI.swift | 18 ++++----- .../Generated/APIs/WithdrawalsAPI.swift | 18 ++++----- .../Generated/CodableHelper.swift | 12 +++--- .../Generated/Configuration.swift | 4 +- .../ImmutableXCore/Generated/Extensions.swift | 14 +++---- .../Generated/JSONDataEncoding.swift | 6 +-- .../Generated/JSONEncodingHelper.swift | 6 +-- Sources/ImmutableXCore/Generated/Models.swift | 9 ++++- .../Generated/OpenISO8601DateFormatter.swift | 4 +- .../Generated/URLSessionImplementations.swift | 30 +++++++-------- generateapi.sh | 2 +- 26 files changed, 190 insertions(+), 185 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 714ae45..7899922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ for soon-to-be removed features. ### Removed -for now removed features. +- (Breaking): all clients have been removed in favour of direct methods in the ImmutableX instance. ### Fixed diff --git a/Sources/ImmutableXCore/Generated/APIHelper.swift b/Sources/ImmutableXCore/Generated/APIHelper.swift index 049b7f6..83d36bb 100644 --- a/Sources/ImmutableXCore/Generated/APIHelper.swift +++ b/Sources/ImmutableXCore/Generated/APIHelper.swift @@ -6,8 +6,8 @@ import Foundation -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { +internal struct APIHelper { + internal static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { result, item in if let value = item.value { result[item.key] = value @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -35,7 +35,7 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + internal static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -50,7 +50,7 @@ public struct APIHelper { } } - public static func mapValueToPathItem(_ source: Any) -> Any { + internal static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { return collection .compactMap { value in @@ -62,7 +62,7 @@ public struct APIHelper { return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { collection diff --git a/Sources/ImmutableXCore/Generated/APIs.swift b/Sources/ImmutableXCore/Generated/APIs.swift index ce80066..ddfc876 100644 --- a/Sources/ImmutableXCore/Generated/APIs.swift +++ b/Sources/ImmutableXCore/Generated/APIs.swift @@ -11,33 +11,33 @@ import Foundation // If you are affected by this issue, please consider removing the following two lines, // By setting the option removeMigrationProjectNameClass to true in the generator @available(*, deprecated, renamed: "OpenAPIClientAPI") -public typealias OpenAPIClient = OpenAPIClientAPI +internal typealias OpenAPIClient = OpenAPIClientAPI -open class OpenAPIClientAPI { - public static var customHeaders: [String: String] = ["x-sdk-version": "imx-core-sdk-swift-\(ImmutableX.shared.sdkVersion)"] - public static var credential: URLCredential? - public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main +internal class OpenAPIClientAPI { + internal static var customHeaders: [String: String] = ["x-sdk-version": "imx-core-sdk-swift-\(ImmutableX.shared.sdkVersion)"] + internal static var credential: URLCredential? + internal static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() + internal static var apiResponseQueue: DispatchQueue = .main - public static var basePath: String { + internal static var basePath: String { return ImmutableX.shared.base.publicApiUrl } } -open class RequestBuilder { +internal class RequestBuilder { var credential: URLCredential? var headers: [String: String] - public let parameters: [String: Any]? - public let method: String - public let URLString: String - public let requestTask: RequestTask = RequestTask() + internal let parameters: [String: Any]? + internal let method: String + internal let URLString: String + internal let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + internal var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -46,31 +46,31 @@ open class RequestBuilder { addHeaders(OpenAPIClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + internal func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + internal func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { return requestTask } - public func addHeader(name: String, value: String) -> Self { + internal func addHeader(name: String, value: String) -> Self { if !value.isEmpty { headers[name] = value } return self } - open func addCredential() -> Self { + internal func addCredential() -> Self { credential = OpenAPIClientAPI.credential return self } } -public protocol RequestBuilderFactory { +internal protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type func getBuilder() -> RequestBuilder.Type } diff --git a/Sources/ImmutableXCore/Generated/APIs/AssetsAPI.swift b/Sources/ImmutableXCore/Generated/APIs/AssetsAPI.swift index 71e978d..f17807c 100644 --- a/Sources/ImmutableXCore/Generated/APIs/AssetsAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/AssetsAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class AssetsAPI { +internal class AssetsAPI { /** Get details of an asset @@ -21,7 +21,7 @@ open class AssetsAPI { - returns: Asset */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getAsset(tokenAddress: String, tokenId: String, includeFees: Bool? = nil) async throws -> Asset { + internal class func getAsset(tokenAddress: String, tokenId: String, includeFees: Bool? = nil) async throws -> Asset { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -54,7 +54,7 @@ open class AssetsAPI { - parameter includeFees: (query) Set flag to include fees associated with the asset (optional) - returns: RequestBuilder */ - open class func getAssetWithRequestBuilder(tokenAddress: String, tokenId: String, includeFees: Bool? = nil) -> RequestBuilder { + internal class func getAssetWithRequestBuilder(tokenAddress: String, tokenId: String, includeFees: Bool? = nil) -> RequestBuilder { var localVariablePath = "/v1/assets/{token_address}/{token_id}" let tokenAddressPreEscape = "\(APIHelper.mapValueToPathItem(tokenAddress))" let tokenAddressPostEscape = tokenAddressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -84,7 +84,7 @@ open class AssetsAPI { /** * enum for parameter orderBy */ - public enum OrderBy_listAssets: String, CaseIterable { + internal enum OrderBy_listAssets: String, CaseIterable { case updatedAt = "updated_at" case name = "name" } @@ -111,7 +111,7 @@ open class AssetsAPI { - returns: ListAssetsResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listAssets(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listAssets? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, name: String? = nil, metadata: String? = nil, sellOrders: Bool? = nil, buyOrders: Bool? = nil, includeFees: Bool? = nil, collection: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) async throws -> ListAssetsResponse { + internal class func listAssets(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listAssets? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, name: String? = nil, metadata: String? = nil, sellOrders: Bool? = nil, buyOrders: Bool? = nil, includeFees: Bool? = nil, collection: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) async throws -> ListAssetsResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -157,7 +157,7 @@ open class AssetsAPI { - parameter auxiliaryFeeRecipients: (query) Comma separated string of fee recipients that are to be paired with auxiliary_fee_percentages (optional) - returns: RequestBuilder */ - open class func listAssetsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listAssets? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, name: String? = nil, metadata: String? = nil, sellOrders: Bool? = nil, buyOrders: Bool? = nil, includeFees: Bool? = nil, collection: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) -> RequestBuilder { + internal class func listAssetsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listAssets? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, name: String? = nil, metadata: String? = nil, sellOrders: Bool? = nil, buyOrders: Bool? = nil, includeFees: Bool? = nil, collection: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/assets" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/APIs/BalancesAPI.swift b/Sources/ImmutableXCore/Generated/APIs/BalancesAPI.swift index 5cc0d91..56a3cab 100644 --- a/Sources/ImmutableXCore/Generated/APIs/BalancesAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/BalancesAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class BalancesAPI { +internal class BalancesAPI { /** Fetches the token balances of the user @@ -20,7 +20,7 @@ open class BalancesAPI { - returns: Balance */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getBalance(owner: String, address: String) async throws -> Balance { + internal class func getBalance(owner: String, address: String) async throws -> Balance { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -52,7 +52,7 @@ open class BalancesAPI { - parameter address: (path) Token address - returns: RequestBuilder */ - open class func getBalanceWithRequestBuilder(owner: String, address: String) -> RequestBuilder { + internal class func getBalanceWithRequestBuilder(owner: String, address: String) -> RequestBuilder { var localVariablePath = "/v2/balances/{owner}/{address}" let ownerPreEscape = "\(APIHelper.mapValueToPathItem(owner))" let ownerPostEscape = ownerPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -83,7 +83,7 @@ open class BalancesAPI { - returns: ListBalancesResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listBalances(owner: String) async throws -> ListBalancesResponse { + internal class func listBalances(owner: String) async throws -> ListBalancesResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -114,7 +114,7 @@ open class BalancesAPI { - parameter owner: (path) Ethereum wallet address for user - returns: RequestBuilder */ - open class func listBalancesWithRequestBuilder(owner: String) -> RequestBuilder { + internal class func listBalancesWithRequestBuilder(owner: String) -> RequestBuilder { var localVariablePath = "/v2/balances/{owner}" let ownerPreEscape = "\(APIHelper.mapValueToPathItem(owner))" let ownerPostEscape = ownerPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" diff --git a/Sources/ImmutableXCore/Generated/APIs/CollectionsAPI.swift b/Sources/ImmutableXCore/Generated/APIs/CollectionsAPI.swift index 42efd9e..bdbcf32 100644 --- a/Sources/ImmutableXCore/Generated/APIs/CollectionsAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/CollectionsAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class CollectionsAPI { +internal class CollectionsAPI { /** Create collection @@ -21,7 +21,7 @@ open class CollectionsAPI { - returns: Collection */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func createCollection(iMXSignature: String, iMXTimestamp: String, createCollectionRequest: CreateCollectionRequest) async throws -> Collection { + internal class func createCollection(iMXSignature: String, iMXTimestamp: String, createCollectionRequest: CreateCollectionRequest) async throws -> Collection { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -55,7 +55,7 @@ open class CollectionsAPI { - parameter createCollectionRequest: (body) create a collection - returns: RequestBuilder */ - open class func createCollectionWithRequestBuilder(iMXSignature: String, iMXTimestamp: String, createCollectionRequest: CreateCollectionRequest) -> RequestBuilder { + internal class func createCollectionWithRequestBuilder(iMXSignature: String, iMXTimestamp: String, createCollectionRequest: CreateCollectionRequest) -> RequestBuilder { let localVariablePath = "/v1/collections" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createCollectionRequest) @@ -81,7 +81,7 @@ open class CollectionsAPI { - returns: Collection */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getCollection(address: String) async throws -> Collection { + internal class func getCollection(address: String) async throws -> Collection { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -112,7 +112,7 @@ open class CollectionsAPI { - parameter address: (path) Collection contract address - returns: RequestBuilder */ - open class func getCollectionWithRequestBuilder(address: String) -> RequestBuilder { + internal class func getCollectionWithRequestBuilder(address: String) -> RequestBuilder { var localVariablePath = "/v1/collections/{address}" let addressPreEscape = "\(APIHelper.mapValueToPathItem(address))" let addressPostEscape = addressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -142,7 +142,7 @@ open class CollectionsAPI { - returns: CollectionFilter */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listCollectionFilters(address: String, pageSize: Int? = nil, nextPageToken: String? = nil) async throws -> CollectionFilter { + internal class func listCollectionFilters(address: String, pageSize: Int? = nil, nextPageToken: String? = nil) async throws -> CollectionFilter { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -175,7 +175,7 @@ open class CollectionsAPI { - parameter nextPageToken: (query) Next page token (optional) - returns: RequestBuilder */ - open class func listCollectionFiltersWithRequestBuilder(address: String, pageSize: Int? = nil, nextPageToken: String? = nil) -> RequestBuilder { + internal class func listCollectionFiltersWithRequestBuilder(address: String, pageSize: Int? = nil, nextPageToken: String? = nil) -> RequestBuilder { var localVariablePath = "/v1/collections/{address}/filters" let addressPreEscape = "\(APIHelper.mapValueToPathItem(address))" let addressPostEscape = addressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -203,7 +203,7 @@ open class CollectionsAPI { /** * enum for parameter orderBy */ - public enum OrderBy_listCollections: String, CaseIterable { + internal enum OrderBy_listCollections: String, CaseIterable { case name = "name" case address = "address" case projectId = "project_id" @@ -224,7 +224,7 @@ open class CollectionsAPI { - returns: ListCollectionsResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listCollections(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listCollections? = nil, direction: String? = nil, blacklist: String? = nil, whitelist: String? = nil, keyword: String? = nil) async throws -> ListCollectionsResponse { + internal class func listCollections(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listCollections? = nil, direction: String? = nil, blacklist: String? = nil, whitelist: String? = nil, keyword: String? = nil) async throws -> ListCollectionsResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -261,7 +261,7 @@ open class CollectionsAPI { - parameter keyword: (query) Keyword to search in collection name and description (optional) - returns: RequestBuilder */ - open class func listCollectionsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listCollections? = nil, direction: String? = nil, blacklist: String? = nil, whitelist: String? = nil, keyword: String? = nil) -> RequestBuilder { + internal class func listCollectionsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listCollections? = nil, direction: String? = nil, blacklist: String? = nil, whitelist: String? = nil, keyword: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/collections" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil @@ -298,7 +298,7 @@ open class CollectionsAPI { - returns: Collection */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func updateCollection(address: String, iMXSignature: String, iMXTimestamp: String, updateCollectionRequest: UpdateCollectionRequest) async throws -> Collection { + internal class func updateCollection(address: String, iMXSignature: String, iMXTimestamp: String, updateCollectionRequest: UpdateCollectionRequest) async throws -> Collection { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -332,7 +332,7 @@ open class CollectionsAPI { - parameter updateCollectionRequest: (body) update a collection - returns: RequestBuilder */ - open class func updateCollectionWithRequestBuilder(address: String, iMXSignature: String, iMXTimestamp: String, updateCollectionRequest: UpdateCollectionRequest) -> RequestBuilder { + internal class func updateCollectionWithRequestBuilder(address: String, iMXSignature: String, iMXTimestamp: String, updateCollectionRequest: UpdateCollectionRequest) -> RequestBuilder { var localVariablePath = "/v1/collections/{address}" let addressPreEscape = "\(APIHelper.mapValueToPathItem(address))" let addressPostEscape = addressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" diff --git a/Sources/ImmutableXCore/Generated/APIs/DepositsAPI.swift b/Sources/ImmutableXCore/Generated/APIs/DepositsAPI.swift index 95e0fb1..e4fbf63 100644 --- a/Sources/ImmutableXCore/Generated/APIs/DepositsAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/DepositsAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class DepositsAPI { +internal class DepositsAPI { /** Get details of a deposit with the given ID @@ -19,7 +19,7 @@ open class DepositsAPI { - returns: Deposit */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getDeposit(id: String) async throws -> Deposit { + internal class func getDeposit(id: String) async throws -> Deposit { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -50,7 +50,7 @@ open class DepositsAPI { - parameter id: (path) Deposit ID - returns: RequestBuilder */ - open class func getDepositWithRequestBuilder(id: String) -> RequestBuilder { + internal class func getDepositWithRequestBuilder(id: String) -> RequestBuilder { var localVariablePath = "/v1/deposits/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -78,7 +78,7 @@ open class DepositsAPI { - returns: GetSignableDepositResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableDeposit(getSignableDepositRequest: GetSignableDepositRequest) async throws -> GetSignableDepositResponse { + internal class func getSignableDeposit(getSignableDepositRequest: GetSignableDepositRequest) async throws -> GetSignableDepositResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -109,7 +109,7 @@ open class DepositsAPI { - parameter getSignableDepositRequest: (body) Get details of signable deposit - returns: RequestBuilder */ - open class func getSignableDepositWithRequestBuilder(getSignableDepositRequest: GetSignableDepositRequest) -> RequestBuilder { + internal class func getSignableDepositWithRequestBuilder(getSignableDepositRequest: GetSignableDepositRequest) -> RequestBuilder { let localVariablePath = "/v1/signable-deposit-details" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableDepositRequest) @@ -149,7 +149,7 @@ open class DepositsAPI { - returns: ListDepositsResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listDeposits(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListDepositsResponse { + internal class func listDeposits(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListDepositsResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -195,7 +195,7 @@ open class DepositsAPI { - parameter metadata: (query) JSON-encoded metadata filters for the deposited asset (optional) - returns: RequestBuilder */ - open class func listDepositsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { + internal class func listDepositsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/deposits" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/APIs/EncodingAPI.swift b/Sources/ImmutableXCore/Generated/APIs/EncodingAPI.swift index baa161e..64492e9 100644 --- a/Sources/ImmutableXCore/Generated/APIs/EncodingAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/EncodingAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class EncodingAPI { +internal class EncodingAPI { /** Retrieves the Starkex Encoded format for a given asset @@ -20,7 +20,7 @@ open class EncodingAPI { - returns: EncodeAssetResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func encodeAsset(assetType: String, encodeAssetRequest: EncodeAssetRequest) async throws -> EncodeAssetResponse { + internal class func encodeAsset(assetType: String, encodeAssetRequest: EncodeAssetRequest) async throws -> EncodeAssetResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -52,7 +52,7 @@ open class EncodingAPI { - parameter encodeAssetRequest: (body) Encode Asset - returns: RequestBuilder */ - open class func encodeAssetWithRequestBuilder(assetType: String, encodeAssetRequest: EncodeAssetRequest) -> RequestBuilder { + internal class func encodeAssetWithRequestBuilder(assetType: String, encodeAssetRequest: EncodeAssetRequest) -> RequestBuilder { var localVariablePath = "/v1/encode/{assetType}" let assetTypePreEscape = "\(APIHelper.mapValueToPathItem(assetType))" let assetTypePostEscape = assetTypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" diff --git a/Sources/ImmutableXCore/Generated/APIs/MetadataAPI.swift b/Sources/ImmutableXCore/Generated/APIs/MetadataAPI.swift index 3e2d748..f7404cb 100644 --- a/Sources/ImmutableXCore/Generated/APIs/MetadataAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/MetadataAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class MetadataAPI { +internal class MetadataAPI { /** Add metadata schema to collection @@ -22,7 +22,7 @@ open class MetadataAPI { - returns: SuccessResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func addMetadataSchemaToCollection(address: String, iMXSignature: String, iMXTimestamp: String, addMetadataSchemaToCollectionRequest: AddMetadataSchemaToCollectionRequest) async throws -> SuccessResponse { + internal class func addMetadataSchemaToCollection(address: String, iMXSignature: String, iMXTimestamp: String, addMetadataSchemaToCollectionRequest: AddMetadataSchemaToCollectionRequest) async throws -> SuccessResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -56,7 +56,7 @@ open class MetadataAPI { - parameter addMetadataSchemaToCollectionRequest: (body) add metadata schema to a collection - returns: RequestBuilder */ - open class func addMetadataSchemaToCollectionWithRequestBuilder(address: String, iMXSignature: String, iMXTimestamp: String, addMetadataSchemaToCollectionRequest: AddMetadataSchemaToCollectionRequest) -> RequestBuilder { + internal class func addMetadataSchemaToCollectionWithRequestBuilder(address: String, iMXSignature: String, iMXTimestamp: String, addMetadataSchemaToCollectionRequest: AddMetadataSchemaToCollectionRequest) -> RequestBuilder { var localVariablePath = "/v1/collections/{address}/metadata-schema" let addressPreEscape = "\(APIHelper.mapValueToPathItem(address))" let addressPostEscape = addressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -85,7 +85,7 @@ open class MetadataAPI { - returns: [MetadataSchemaProperty] */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getMetadataSchema(address: String) async throws -> [MetadataSchemaProperty] { + internal class func getMetadataSchema(address: String) async throws -> [MetadataSchemaProperty] { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -116,7 +116,7 @@ open class MetadataAPI { - parameter address: (path) Collection contract address - returns: RequestBuilder<[MetadataSchemaProperty]> */ - open class func getMetadataSchemaWithRequestBuilder(address: String) -> RequestBuilder<[MetadataSchemaProperty]> { + internal class func getMetadataSchemaWithRequestBuilder(address: String) -> RequestBuilder<[MetadataSchemaProperty]> { var localVariablePath = "/v1/collections/{address}/metadata-schema" let addressPreEscape = "\(APIHelper.mapValueToPathItem(address))" let addressPostEscape = addressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -148,7 +148,7 @@ open class MetadataAPI { - returns: SuccessResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func updateMetadataSchemaByName(address: String, name: String, iMXSignature: String, iMXTimestamp: String, metadataSchemaRequest: MetadataSchemaRequest) async throws -> SuccessResponse { + internal class func updateMetadataSchemaByName(address: String, name: String, iMXSignature: String, iMXTimestamp: String, metadataSchemaRequest: MetadataSchemaRequest) async throws -> SuccessResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -183,7 +183,7 @@ open class MetadataAPI { - parameter metadataSchemaRequest: (body) update metadata schema - returns: RequestBuilder */ - open class func updateMetadataSchemaByNameWithRequestBuilder(address: String, name: String, iMXSignature: String, iMXTimestamp: String, metadataSchemaRequest: MetadataSchemaRequest) -> RequestBuilder { + internal class func updateMetadataSchemaByNameWithRequestBuilder(address: String, name: String, iMXSignature: String, iMXTimestamp: String, metadataSchemaRequest: MetadataSchemaRequest) -> RequestBuilder { var localVariablePath = "/v1/collections/{address}/metadata-schema/{name}" let addressPreEscape = "\(APIHelper.mapValueToPathItem(address))" let addressPostEscape = addressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" diff --git a/Sources/ImmutableXCore/Generated/APIs/MintsAPI.swift b/Sources/ImmutableXCore/Generated/APIs/MintsAPI.swift index 615554c..a42f39f 100644 --- a/Sources/ImmutableXCore/Generated/APIs/MintsAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/MintsAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class MintsAPI { +internal class MintsAPI { /** Get details of a mint with the given ID @@ -19,7 +19,7 @@ open class MintsAPI { - returns: Mint */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getMint(id: String) async throws -> Mint { + internal class func getMint(id: String) async throws -> Mint { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -50,7 +50,7 @@ open class MintsAPI { - parameter id: (path) Mint ID. This is the transaction_id returned from listMints - returns: RequestBuilder */ - open class func getMintWithRequestBuilder(id: String) -> RequestBuilder { + internal class func getMintWithRequestBuilder(id: String) -> RequestBuilder { var localVariablePath = "/v1/mints/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -79,7 +79,7 @@ open class MintsAPI { - returns: MintableTokenDetails */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getMintableTokenDetailsByClientTokenId(tokenAddress: String, tokenId: String) async throws -> MintableTokenDetails { + internal class func getMintableTokenDetailsByClientTokenId(tokenAddress: String, tokenId: String) async throws -> MintableTokenDetails { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -111,7 +111,7 @@ open class MintsAPI { - parameter tokenId: (path) ERC721 token ID - returns: RequestBuilder */ - open class func getMintableTokenDetailsByClientTokenIdWithRequestBuilder(tokenAddress: String, tokenId: String) -> RequestBuilder { + internal class func getMintableTokenDetailsByClientTokenIdWithRequestBuilder(tokenAddress: String, tokenId: String) -> RequestBuilder { var localVariablePath = "/v1/mintable-token/{token_address}/{token_id}" let tokenAddressPreEscape = "\(APIHelper.mapValueToPathItem(tokenAddress))" let tokenAddressPostEscape = tokenAddressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -157,7 +157,7 @@ open class MintsAPI { - returns: ListMintsResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listMints(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenName: String? = nil, tokenAddress: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListMintsResponse { + internal class func listMints(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenName: String? = nil, tokenAddress: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListMintsResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -203,7 +203,7 @@ open class MintsAPI { - parameter metadata: (query) JSON-encoded metadata filters for the minted asset (optional) - returns: RequestBuilder */ - open class func listMintsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenName: String? = nil, tokenAddress: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { + internal class func listMintsWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenName: String? = nil, tokenAddress: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/mints" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil @@ -246,7 +246,7 @@ open class MintsAPI { - returns: MintTokensResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func mintTokens(mintTokensRequestV2: [MintRequest]) async throws -> MintTokensResponse { + internal class func mintTokens(mintTokensRequestV2: [MintRequest]) async throws -> MintTokensResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -278,7 +278,7 @@ open class MintsAPI { - parameter mintTokensRequestV2: (body) details of tokens to mint - returns: RequestBuilder */ - open class func mintTokensWithRequestBuilder(mintTokensRequestV2: [MintRequest]) -> RequestBuilder { + internal class func mintTokensWithRequestBuilder(mintTokensRequestV2: [MintRequest]) -> RequestBuilder { let localVariablePath = "/v2/mints" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: mintTokensRequestV2) diff --git a/Sources/ImmutableXCore/Generated/APIs/OrdersAPI.swift b/Sources/ImmutableXCore/Generated/APIs/OrdersAPI.swift index 6e283d3..5554b30 100644 --- a/Sources/ImmutableXCore/Generated/APIs/OrdersAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/OrdersAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class OrdersAPI { +internal class OrdersAPI { /** Cancel an order @@ -22,7 +22,7 @@ open class OrdersAPI { - returns: CancelOrderResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func cancelOrder(xImxEthAddress: String, xImxEthSignature: String, id: String, cancelOrderRequest: CancelOrderRequest) async throws -> CancelOrderResponse { + internal class func cancelOrder(xImxEthAddress: String, xImxEthSignature: String, id: String, cancelOrderRequest: CancelOrderRequest) async throws -> CancelOrderResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -56,7 +56,7 @@ open class OrdersAPI { - parameter cancelOrderRequest: (body) cancel an order - returns: RequestBuilder */ - open class func cancelOrderWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, id: String, cancelOrderRequest: CancelOrderRequest) -> RequestBuilder { + internal class func cancelOrderWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, id: String, cancelOrderRequest: CancelOrderRequest) -> RequestBuilder { var localVariablePath = "/v1/orders/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -87,7 +87,7 @@ open class OrdersAPI { - returns: CreateOrderResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func createOrder(xImxEthAddress: String, xImxEthSignature: String, createOrderRequest: CreateOrderRequest) async throws -> CreateOrderResponse { + internal class func createOrder(xImxEthAddress: String, xImxEthSignature: String, createOrderRequest: CreateOrderRequest) async throws -> CreateOrderResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -120,7 +120,7 @@ open class OrdersAPI { - parameter createOrderRequest: (body) create an order - returns: RequestBuilder */ - open class func createOrderWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createOrderRequest: CreateOrderRequest) -> RequestBuilder { + internal class func createOrderWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createOrderRequest: CreateOrderRequest) -> RequestBuilder { let localVariablePath = "/v1/orders" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createOrderRequest) @@ -149,7 +149,7 @@ open class OrdersAPI { - returns: Order */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getOrder(id: String, includeFees: Bool? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) async throws -> Order { + internal class func getOrder(id: String, includeFees: Bool? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) async throws -> Order { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -183,7 +183,7 @@ open class OrdersAPI { - parameter auxiliaryFeeRecipients: (query) Comma separated string of fee recipients that are to be paired with auxiliary_fee_percentages (optional) - returns: RequestBuilder */ - open class func getOrderWithRequestBuilder(id: String, includeFees: Bool? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) -> RequestBuilder { + internal class func getOrderWithRequestBuilder(id: String, includeFees: Bool? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil) -> RequestBuilder { var localVariablePath = "/v1/orders/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -216,7 +216,7 @@ open class OrdersAPI { - returns: GetSignableCancelOrderResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableCancelOrder(getSignableCancelOrderRequest: GetSignableCancelOrderRequest) async throws -> GetSignableCancelOrderResponse { + internal class func getSignableCancelOrder(getSignableCancelOrderRequest: GetSignableCancelOrderRequest) async throws -> GetSignableCancelOrderResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -247,7 +247,7 @@ open class OrdersAPI { - parameter getSignableCancelOrderRequest: (body) get a signable cancel order - returns: RequestBuilder */ - open class func getSignableCancelOrderWithRequestBuilder(getSignableCancelOrderRequest: GetSignableCancelOrderRequest) -> RequestBuilder { + internal class func getSignableCancelOrderWithRequestBuilder(getSignableCancelOrderRequest: GetSignableCancelOrderRequest) -> RequestBuilder { let localVariablePath = "/v1/signable-cancel-order-details" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableCancelOrderRequest) @@ -272,7 +272,7 @@ open class OrdersAPI { - returns: GetSignableOrderResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableOrder(getSignableOrderRequestV3: GetSignableOrderRequest) async throws -> GetSignableOrderResponse { + internal class func getSignableOrder(getSignableOrderRequestV3: GetSignableOrderRequest) async throws -> GetSignableOrderResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -303,7 +303,7 @@ open class OrdersAPI { - parameter getSignableOrderRequestV3: (body) get a signable order - returns: RequestBuilder */ - open class func getSignableOrderWithRequestBuilder(getSignableOrderRequestV3: GetSignableOrderRequest) -> RequestBuilder { + internal class func getSignableOrderWithRequestBuilder(getSignableOrderRequestV3: GetSignableOrderRequest) -> RequestBuilder { let localVariablePath = "/v3/signable-order-details" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableOrderRequestV3) @@ -324,7 +324,7 @@ open class OrdersAPI { /** * enum for parameter orderBy */ - public enum OrderBy_listOrders: String, CaseIterable { + internal enum OrderBy_listOrders: String, CaseIterable { case createdAt = "created_at" case expiredAt = "expired_at" case sellQuantity = "sell_quantity" @@ -336,7 +336,7 @@ open class OrdersAPI { /** * enum for parameter status */ - public enum Status_listOrders: String, CaseIterable { + internal enum Status_listOrders: String, CaseIterable { case active = "active" case filled = "filled" case cancelled = "cancelled" @@ -379,7 +379,7 @@ open class OrdersAPI { - returns: ListOrdersResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listOrders(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listOrders? = nil, direction: String? = nil, user: String? = nil, status: Status_listOrders? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, buyTokenType: String? = nil, buyTokenId: String? = nil, buyAssetId: String? = nil, buyTokenAddress: String? = nil, buyTokenName: String? = nil, buyMinQuantity: String? = nil, buyMaxQuantity: String? = nil, buyMetadata: String? = nil, sellTokenType: String? = nil, sellTokenId: String? = nil, sellAssetId: String? = nil, sellTokenAddress: String? = nil, sellTokenName: String? = nil, sellMinQuantity: String? = nil, sellMaxQuantity: String? = nil, sellMetadata: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil, includeFees: Bool? = nil) async throws -> ListOrdersResponse { + internal class func listOrders(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listOrders? = nil, direction: String? = nil, user: String? = nil, status: Status_listOrders? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, buyTokenType: String? = nil, buyTokenId: String? = nil, buyAssetId: String? = nil, buyTokenAddress: String? = nil, buyTokenName: String? = nil, buyMinQuantity: String? = nil, buyMaxQuantity: String? = nil, buyMetadata: String? = nil, sellTokenType: String? = nil, sellTokenId: String? = nil, sellAssetId: String? = nil, sellTokenAddress: String? = nil, sellTokenName: String? = nil, sellMinQuantity: String? = nil, sellMaxQuantity: String? = nil, sellMetadata: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil, includeFees: Bool? = nil) async throws -> ListOrdersResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -438,7 +438,7 @@ open class OrdersAPI { - parameter includeFees: (query) Set flag to true to include fee object for orders (optional) - returns: RequestBuilder */ - open class func listOrdersWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listOrders? = nil, direction: String? = nil, user: String? = nil, status: Status_listOrders? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, buyTokenType: String? = nil, buyTokenId: String? = nil, buyAssetId: String? = nil, buyTokenAddress: String? = nil, buyTokenName: String? = nil, buyMinQuantity: String? = nil, buyMaxQuantity: String? = nil, buyMetadata: String? = nil, sellTokenType: String? = nil, sellTokenId: String? = nil, sellAssetId: String? = nil, sellTokenAddress: String? = nil, sellTokenName: String? = nil, sellMinQuantity: String? = nil, sellMaxQuantity: String? = nil, sellMetadata: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil, includeFees: Bool? = nil) -> RequestBuilder { + internal class func listOrdersWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listOrders? = nil, direction: String? = nil, user: String? = nil, status: Status_listOrders? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, updatedMinTimestamp: String? = nil, updatedMaxTimestamp: String? = nil, buyTokenType: String? = nil, buyTokenId: String? = nil, buyAssetId: String? = nil, buyTokenAddress: String? = nil, buyTokenName: String? = nil, buyMinQuantity: String? = nil, buyMaxQuantity: String? = nil, buyMetadata: String? = nil, sellTokenType: String? = nil, sellTokenId: String? = nil, sellAssetId: String? = nil, sellTokenAddress: String? = nil, sellTokenName: String? = nil, sellMinQuantity: String? = nil, sellMaxQuantity: String? = nil, sellMetadata: String? = nil, auxiliaryFeePercentages: String? = nil, auxiliaryFeeRecipients: String? = nil, includeFees: Bool? = nil) -> RequestBuilder { let localVariablePath = "/v1/orders" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/APIs/ProjectsAPI.swift b/Sources/ImmutableXCore/Generated/APIs/ProjectsAPI.swift index b6a2967..3064e0e 100644 --- a/Sources/ImmutableXCore/Generated/APIs/ProjectsAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/ProjectsAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class ProjectsAPI { +internal class ProjectsAPI { /** Create a project @@ -21,7 +21,7 @@ open class ProjectsAPI { - returns: CreateProjectResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func createProject(iMXSignature: String, iMXTimestamp: String, createProjectRequest: CreateProjectRequest) async throws -> CreateProjectResponse { + internal class func createProject(iMXSignature: String, iMXTimestamp: String, createProjectRequest: CreateProjectRequest) async throws -> CreateProjectResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -54,7 +54,7 @@ open class ProjectsAPI { - parameter createProjectRequest: (body) create a project - returns: RequestBuilder */ - open class func createProjectWithRequestBuilder(iMXSignature: String, iMXTimestamp: String, createProjectRequest: CreateProjectRequest) -> RequestBuilder { + internal class func createProjectWithRequestBuilder(iMXSignature: String, iMXTimestamp: String, createProjectRequest: CreateProjectRequest) -> RequestBuilder { let localVariablePath = "/v1/projects" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createProjectRequest) @@ -82,7 +82,7 @@ open class ProjectsAPI { - returns: Project */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getProject(id: String, iMXSignature: String, iMXTimestamp: String) async throws -> Project { + internal class func getProject(id: String, iMXSignature: String, iMXTimestamp: String) async throws -> Project { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -115,7 +115,7 @@ open class ProjectsAPI { - parameter iMXTimestamp: (header) Unix Epoc timestamp - returns: RequestBuilder */ - open class func getProjectWithRequestBuilder(id: String, iMXSignature: String, iMXTimestamp: String) -> RequestBuilder { + internal class func getProjectWithRequestBuilder(id: String, iMXSignature: String, iMXTimestamp: String) -> RequestBuilder { var localVariablePath = "/v1/projects/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -149,7 +149,7 @@ open class ProjectsAPI { - returns: GetProjectsResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getProjects(iMXSignature: String, iMXTimestamp: String, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil) async throws -> GetProjectsResponse { + internal class func getProjects(iMXSignature: String, iMXTimestamp: String, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil) async throws -> GetProjectsResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -185,7 +185,7 @@ open class ProjectsAPI { - parameter direction: (query) Direction to sort (asc/desc) (optional) - returns: RequestBuilder */ - open class func getProjectsWithRequestBuilder(iMXSignature: String, iMXTimestamp: String, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil) -> RequestBuilder { + internal class func getProjectsWithRequestBuilder(iMXSignature: String, iMXTimestamp: String, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/projects" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/APIs/TokensAPI.swift b/Sources/ImmutableXCore/Generated/APIs/TokensAPI.swift index 488ae02..eda7247 100644 --- a/Sources/ImmutableXCore/Generated/APIs/TokensAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/TokensAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class TokensAPI { +internal class TokensAPI { /** Get details of a token @@ -19,7 +19,7 @@ open class TokensAPI { - returns: TokenDetails */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getToken(address: String) async throws -> TokenDetails { + internal class func getToken(address: String) async throws -> TokenDetails { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -50,7 +50,7 @@ open class TokensAPI { - parameter address: (path) Token Contract Address - returns: RequestBuilder */ - open class func getTokenWithRequestBuilder(address: String) -> RequestBuilder { + internal class func getTokenWithRequestBuilder(address: String) -> RequestBuilder { var localVariablePath = "/v1/tokens/{address}" let addressPreEscape = "\(APIHelper.mapValueToPathItem(address))" let addressPostEscape = addressPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -79,7 +79,7 @@ open class TokensAPI { - returns: ListTokensResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listTokens(address: String? = nil, symbols: String? = nil) async throws -> ListTokensResponse { + internal class func listTokens(address: String? = nil, symbols: String? = nil) async throws -> ListTokensResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -111,7 +111,7 @@ open class TokensAPI { - parameter symbols: (query) Token symbols for the token, e.g. ?symbols=IMX,ETH (optional) - returns: RequestBuilder */ - open class func listTokensWithRequestBuilder(address: String? = nil, symbols: String? = nil) -> RequestBuilder { + internal class func listTokensWithRequestBuilder(address: String? = nil, symbols: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/tokens" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/APIs/TradesAPI.swift b/Sources/ImmutableXCore/Generated/APIs/TradesAPI.swift index e5e5d5b..ab84b09 100644 --- a/Sources/ImmutableXCore/Generated/APIs/TradesAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/TradesAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class TradesAPI { +internal class TradesAPI { /** Create a Trade between two parties @@ -21,7 +21,7 @@ open class TradesAPI { - returns: CreateTradeResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func createTrade(xImxEthAddress: String, xImxEthSignature: String, createTradeRequest: CreateTradeRequestV1) async throws -> CreateTradeResponse { + internal class func createTrade(xImxEthAddress: String, xImxEthSignature: String, createTradeRequest: CreateTradeRequestV1) async throws -> CreateTradeResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -54,7 +54,7 @@ open class TradesAPI { - parameter createTradeRequest: (body) create a trade - returns: RequestBuilder */ - open class func createTradeWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createTradeRequest: CreateTradeRequestV1) -> RequestBuilder { + internal class func createTradeWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createTradeRequest: CreateTradeRequestV1) -> RequestBuilder { let localVariablePath = "/v1/trades" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createTradeRequest) @@ -80,7 +80,7 @@ open class TradesAPI { - returns: GetSignableTradeResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableTrade(getSignableTradeRequest: GetSignableTradeRequest) async throws -> GetSignableTradeResponse { + internal class func getSignableTrade(getSignableTradeRequest: GetSignableTradeRequest) async throws -> GetSignableTradeResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -111,7 +111,7 @@ open class TradesAPI { - parameter getSignableTradeRequest: (body) get a signable trade - returns: RequestBuilder */ - open class func getSignableTradeWithRequestBuilder(getSignableTradeRequest: GetSignableTradeRequest) -> RequestBuilder { + internal class func getSignableTradeWithRequestBuilder(getSignableTradeRequest: GetSignableTradeRequest) -> RequestBuilder { let localVariablePath = "/v3/signable-trade-details" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableTradeRequest) @@ -136,7 +136,7 @@ open class TradesAPI { - returns: Trade */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getTrade(id: String) async throws -> Trade { + internal class func getTrade(id: String) async throws -> Trade { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -167,7 +167,7 @@ open class TradesAPI { - parameter id: (path) Trade ID - returns: RequestBuilder */ - open class func getTradeWithRequestBuilder(id: String) -> RequestBuilder { + internal class func getTradeWithRequestBuilder(id: String) -> RequestBuilder { var localVariablePath = "/v1/trades/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -207,7 +207,7 @@ open class TradesAPI { - returns: ListTradesResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listTrades(partyAOrderId: String? = nil, partyATokenType: String? = nil, partyATokenAddress: String? = nil, partyBOrderId: String? = nil, partyBTokenType: String? = nil, partyBTokenAddress: String? = nil, partyBTokenId: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil) async throws -> ListTradesResponse { + internal class func listTrades(partyAOrderId: String? = nil, partyATokenType: String? = nil, partyATokenAddress: String? = nil, partyBOrderId: String? = nil, partyBTokenType: String? = nil, partyBTokenAddress: String? = nil, partyBTokenId: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil) async throws -> ListTradesResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -250,7 +250,7 @@ open class TradesAPI { - parameter maxTimestamp: (query) Maximum timestamp for this trade, in ISO 8601 UTC format. Example: '2022-05-27T00:10:22Z' (optional) - returns: RequestBuilder */ - open class func listTradesWithRequestBuilder(partyAOrderId: String? = nil, partyATokenType: String? = nil, partyATokenAddress: String? = nil, partyBOrderId: String? = nil, partyBTokenType: String? = nil, partyBTokenAddress: String? = nil, partyBTokenId: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil) -> RequestBuilder { + internal class func listTradesWithRequestBuilder(partyAOrderId: String? = nil, partyATokenType: String? = nil, partyATokenAddress: String? = nil, partyBOrderId: String? = nil, partyBTokenType: String? = nil, partyBTokenAddress: String? = nil, partyBTokenId: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/trades" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/APIs/TransfersAPI.swift b/Sources/ImmutableXCore/Generated/APIs/TransfersAPI.swift index 7f94122..d2d777a 100644 --- a/Sources/ImmutableXCore/Generated/APIs/TransfersAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/TransfersAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class TransfersAPI { +internal class TransfersAPI { /** Creates a transfer of multiple tokens between two parties @@ -21,7 +21,7 @@ open class TransfersAPI { - returns: CreateTransferResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func createTransfer(xImxEthAddress: String, xImxEthSignature: String, createTransferRequestV2: CreateTransferRequest) async throws -> CreateTransferResponse { + internal class func createTransfer(xImxEthAddress: String, xImxEthSignature: String, createTransferRequestV2: CreateTransferRequest) async throws -> CreateTransferResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -54,7 +54,7 @@ open class TransfersAPI { - parameter createTransferRequestV2: (body) Create transfer - returns: RequestBuilder */ - open class func createTransferWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createTransferRequestV2: CreateTransferRequest) -> RequestBuilder { + internal class func createTransferWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createTransferRequestV2: CreateTransferRequest) -> RequestBuilder { let localVariablePath = "/v2/transfers" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createTransferRequestV2) @@ -82,7 +82,7 @@ open class TransfersAPI { - returns: CreateTransferResponseV1 */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func createTransferV1(xImxEthAddress: String, xImxEthSignature: String, createTransferRequest: CreateTransferRequestV1) async throws -> CreateTransferResponseV1 { + internal class func createTransferV1(xImxEthAddress: String, xImxEthSignature: String, createTransferRequest: CreateTransferRequestV1) async throws -> CreateTransferResponseV1 { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -115,7 +115,7 @@ open class TransfersAPI { - parameter createTransferRequest: (body) Create transfer - returns: RequestBuilder */ - open class func createTransferV1WithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createTransferRequest: CreateTransferRequestV1) -> RequestBuilder { + internal class func createTransferV1WithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createTransferRequest: CreateTransferRequestV1) -> RequestBuilder { let localVariablePath = "/v1/transfers" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createTransferRequest) @@ -141,7 +141,7 @@ open class TransfersAPI { - returns: GetSignableTransferResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableTransfer(getSignableTransferRequestV2: GetSignableTransferRequest) async throws -> GetSignableTransferResponse { + internal class func getSignableTransfer(getSignableTransferRequestV2: GetSignableTransferRequest) async throws -> GetSignableTransferResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -172,7 +172,7 @@ open class TransfersAPI { - parameter getSignableTransferRequestV2: (body) get details of signable transfer - returns: RequestBuilder */ - open class func getSignableTransferWithRequestBuilder(getSignableTransferRequestV2: GetSignableTransferRequest) -> RequestBuilder { + internal class func getSignableTransferWithRequestBuilder(getSignableTransferRequestV2: GetSignableTransferRequest) -> RequestBuilder { let localVariablePath = "/v2/signable-transfer-details" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableTransferRequestV2) @@ -197,7 +197,7 @@ open class TransfersAPI { - returns: GetSignableTransferResponseV1 */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableTransferV1(getSignableTransferRequest: GetSignableTransferRequestV1) async throws -> GetSignableTransferResponseV1 { + internal class func getSignableTransferV1(getSignableTransferRequest: GetSignableTransferRequestV1) async throws -> GetSignableTransferResponseV1 { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -228,7 +228,7 @@ open class TransfersAPI { - parameter getSignableTransferRequest: (body) get details of signable transfer - returns: RequestBuilder */ - open class func getSignableTransferV1WithRequestBuilder(getSignableTransferRequest: GetSignableTransferRequestV1) -> RequestBuilder { + internal class func getSignableTransferV1WithRequestBuilder(getSignableTransferRequest: GetSignableTransferRequestV1) -> RequestBuilder { let localVariablePath = "/v1/signable-transfer-details" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableTransferRequest) @@ -253,7 +253,7 @@ open class TransfersAPI { - returns: Transfer */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getTransfer(id: String) async throws -> Transfer { + internal class func getTransfer(id: String) async throws -> Transfer { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -284,7 +284,7 @@ open class TransfersAPI { - parameter id: (path) Transfer ID - returns: RequestBuilder */ - open class func getTransferWithRequestBuilder(id: String) -> RequestBuilder { + internal class func getTransferWithRequestBuilder(id: String) -> RequestBuilder { var localVariablePath = "/v1/transfers/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -308,7 +308,7 @@ open class TransfersAPI { /** * enum for parameter orderBy */ - public enum OrderBy_listTransfers: String, CaseIterable { + internal enum OrderBy_listTransfers: String, CaseIterable { case transactionId = "transaction_id" case updatedAt = "updated_at" case createdAt = "created_at" @@ -319,7 +319,7 @@ open class TransfersAPI { /** * enum for parameter status */ - public enum Status_listTransfers: String, CaseIterable { + internal enum Status_listTransfers: String, CaseIterable { case success = "success" case failure = "failure" } @@ -347,7 +347,7 @@ open class TransfersAPI { - returns: ListTransfersResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listTransfers(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listTransfers? = nil, direction: String? = nil, user: String? = nil, receiver: String? = nil, status: Status_listTransfers? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListTransfersResponse { + internal class func listTransfers(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listTransfers? = nil, direction: String? = nil, user: String? = nil, receiver: String? = nil, status: Status_listTransfers? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListTransfersResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -394,7 +394,7 @@ open class TransfersAPI { - parameter metadata: (query) JSON-encoded metadata filters for the transferred asset (optional) - returns: RequestBuilder */ - open class func listTransfersWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listTransfers? = nil, direction: String? = nil, user: String? = nil, receiver: String? = nil, status: Status_listTransfers? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { + internal class func listTransfersWithRequestBuilder(pageSize: Int? = nil, cursor: String? = nil, orderBy: OrderBy_listTransfers? = nil, direction: String? = nil, user: String? = nil, receiver: String? = nil, status: Status_listTransfers? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/transfers" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/APIs/UsersAPI.swift b/Sources/ImmutableXCore/Generated/APIs/UsersAPI.swift index 8fec3c1..a462c35 100644 --- a/Sources/ImmutableXCore/Generated/APIs/UsersAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/UsersAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class UsersAPI { +internal class UsersAPI { /** Get operator signature to allow clients to register the user @@ -19,7 +19,7 @@ open class UsersAPI { - returns: GetSignableRegistrationResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableRegistration(getSignableRegistrationRequest: GetSignableRegistrationRequest) async throws -> GetSignableRegistrationResponse { + internal class func getSignableRegistration(getSignableRegistrationRequest: GetSignableRegistrationRequest) async throws -> GetSignableRegistrationResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -50,7 +50,7 @@ open class UsersAPI { - parameter getSignableRegistrationRequest: (body) Register User - returns: RequestBuilder */ - open class func getSignableRegistrationWithRequestBuilder(getSignableRegistrationRequest: GetSignableRegistrationRequest) -> RequestBuilder { + internal class func getSignableRegistrationWithRequestBuilder(getSignableRegistrationRequest: GetSignableRegistrationRequest) -> RequestBuilder { let localVariablePath = "/v1/signable-registration" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableRegistrationRequest) @@ -75,7 +75,7 @@ open class UsersAPI { - returns: GetSignableRegistrationOffchainResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableRegistrationOffchain(getSignableRegistrationRequest: GetSignableRegistrationRequest) async throws -> GetSignableRegistrationOffchainResponse { + internal class func getSignableRegistrationOffchain(getSignableRegistrationRequest: GetSignableRegistrationRequest) async throws -> GetSignableRegistrationOffchainResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -106,7 +106,7 @@ open class UsersAPI { - parameter getSignableRegistrationRequest: (body) Register User Offchain - returns: RequestBuilder */ - open class func getSignableRegistrationOffchainWithRequestBuilder(getSignableRegistrationRequest: GetSignableRegistrationRequest) -> RequestBuilder { + internal class func getSignableRegistrationOffchainWithRequestBuilder(getSignableRegistrationRequest: GetSignableRegistrationRequest) -> RequestBuilder { let localVariablePath = "/v1/signable-registration-offchain" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableRegistrationRequest) @@ -131,7 +131,7 @@ open class UsersAPI { - returns: GetUsersApiResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getUsers(user: String) async throws -> GetUsersApiResponse { + internal class func getUsers(user: String) async throws -> GetUsersApiResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -162,7 +162,7 @@ open class UsersAPI { - parameter user: (path) User - returns: RequestBuilder */ - open class func getUsersWithRequestBuilder(user: String) -> RequestBuilder { + internal class func getUsersWithRequestBuilder(user: String) -> RequestBuilder { var localVariablePath = "/v1/users/{user}" let userPreEscape = "\(APIHelper.mapValueToPathItem(user))" let userPostEscape = userPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -190,7 +190,7 @@ open class UsersAPI { - returns: RegisterUserResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func registerUser(registerUserRequest: RegisterUserRequest) async throws -> RegisterUserResponse { + internal class func registerUser(registerUserRequest: RegisterUserRequest) async throws -> RegisterUserResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -221,7 +221,7 @@ open class UsersAPI { - parameter registerUserRequest: (body) Register User - returns: RequestBuilder */ - open class func registerUserWithRequestBuilder(registerUserRequest: RegisterUserRequest) -> RequestBuilder { + internal class func registerUserWithRequestBuilder(registerUserRequest: RegisterUserRequest) -> RequestBuilder { let localVariablePath = "/v1/users" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: registerUserRequest) diff --git a/Sources/ImmutableXCore/Generated/APIs/WithdrawalsAPI.swift b/Sources/ImmutableXCore/Generated/APIs/WithdrawalsAPI.swift index 52611b4..93858fc 100644 --- a/Sources/ImmutableXCore/Generated/APIs/WithdrawalsAPI.swift +++ b/Sources/ImmutableXCore/Generated/APIs/WithdrawalsAPI.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -open class WithdrawalsAPI { +internal class WithdrawalsAPI { /** Creates a withdrawal of a token @@ -21,7 +21,7 @@ open class WithdrawalsAPI { - returns: CreateWithdrawalResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func createWithdrawal(xImxEthAddress: String, xImxEthSignature: String, createWithdrawalRequest: CreateWithdrawalRequest) async throws -> CreateWithdrawalResponse { + internal class func createWithdrawal(xImxEthAddress: String, xImxEthSignature: String, createWithdrawalRequest: CreateWithdrawalRequest) async throws -> CreateWithdrawalResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -54,7 +54,7 @@ open class WithdrawalsAPI { - parameter createWithdrawalRequest: (body) create a withdrawal - returns: RequestBuilder */ - open class func createWithdrawalWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createWithdrawalRequest: CreateWithdrawalRequest) -> RequestBuilder { + internal class func createWithdrawalWithRequestBuilder(xImxEthAddress: String, xImxEthSignature: String, createWithdrawalRequest: CreateWithdrawalRequest) -> RequestBuilder { let localVariablePath = "/v1/withdrawals" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createWithdrawalRequest) @@ -80,7 +80,7 @@ open class WithdrawalsAPI { - returns: GetSignableWithdrawalResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getSignableWithdrawal(getSignableWithdrawalRequest: GetSignableWithdrawalRequest) async throws -> GetSignableWithdrawalResponse { + internal class func getSignableWithdrawal(getSignableWithdrawalRequest: GetSignableWithdrawalRequest) async throws -> GetSignableWithdrawalResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -111,7 +111,7 @@ open class WithdrawalsAPI { - parameter getSignableWithdrawalRequest: (body) get details of signable withdrawal - returns: RequestBuilder */ - open class func getSignableWithdrawalWithRequestBuilder(getSignableWithdrawalRequest: GetSignableWithdrawalRequest) -> RequestBuilder { + internal class func getSignableWithdrawalWithRequestBuilder(getSignableWithdrawalRequest: GetSignableWithdrawalRequest) -> RequestBuilder { let localVariablePath = "/v1/signable-withdrawal-details" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: getSignableWithdrawalRequest) @@ -136,7 +136,7 @@ open class WithdrawalsAPI { - returns: Withdrawal */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getWithdrawal(id: String) async throws -> Withdrawal { + internal class func getWithdrawal(id: String) async throws -> Withdrawal { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -167,7 +167,7 @@ open class WithdrawalsAPI { - parameter id: (path) Withdrawal ID - returns: RequestBuilder */ - open class func getWithdrawalWithRequestBuilder(id: String) -> RequestBuilder { + internal class func getWithdrawalWithRequestBuilder(id: String) -> RequestBuilder { var localVariablePath = "/v1/withdrawals/{id}" let idPreEscape = "\(APIHelper.mapValueToPathItem(id))" let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" @@ -212,7 +212,7 @@ open class WithdrawalsAPI { - returns: ListWithdrawalsResponse */ @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func listWithdrawals(withdrawnToWallet: Bool? = nil, rollupStatus: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListWithdrawalsResponse { + internal class func listWithdrawals(withdrawnToWallet: Bool? = nil, rollupStatus: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) async throws -> ListWithdrawalsResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -260,7 +260,7 @@ open class WithdrawalsAPI { - parameter metadata: (query) JSON-encoded metadata filters for the withdrawn asset (optional) - returns: RequestBuilder */ - open class func listWithdrawalsWithRequestBuilder(withdrawnToWallet: Bool? = nil, rollupStatus: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { + internal class func listWithdrawalsWithRequestBuilder(withdrawnToWallet: Bool? = nil, rollupStatus: String? = nil, pageSize: Int? = nil, cursor: String? = nil, orderBy: String? = nil, direction: String? = nil, user: String? = nil, status: String? = nil, minTimestamp: String? = nil, maxTimestamp: String? = nil, tokenType: String? = nil, tokenId: String? = nil, assetId: String? = nil, tokenAddress: String? = nil, tokenName: String? = nil, minQuantity: String? = nil, maxQuantity: String? = nil, metadata: String? = nil) -> RequestBuilder { let localVariablePath = "/v1/withdrawals" let localVariableURLString = OpenAPIClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/Sources/ImmutableXCore/Generated/CodableHelper.swift b/Sources/ImmutableXCore/Generated/CodableHelper.swift index 09c82e5..5055cd5 100644 --- a/Sources/ImmutableXCore/Generated/CodableHelper.swift +++ b/Sources/ImmutableXCore/Generated/CodableHelper.swift @@ -7,7 +7,7 @@ import Foundation -open class CodableHelper { +internal class CodableHelper { private static var customDateFormatter: DateFormatter? private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter() @@ -26,24 +26,24 @@ open class CodableHelper { return encoder }() - public static var dateFormatter: DateFormatter { + internal static var dateFormatter: DateFormatter { get { return customDateFormatter ?? defaultDateFormatter } set { customDateFormatter = newValue } } - public static var jsonDecoder: JSONDecoder { + internal static var jsonDecoder: JSONDecoder { get { return customJSONDecoder ?? defaultJSONDecoder } set { customJSONDecoder = newValue } } - public static var jsonEncoder: JSONEncoder { + internal static var jsonEncoder: JSONEncoder { get { return customJSONEncoder ?? defaultJSONEncoder } set { customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + internal class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { return Swift.Result { try jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Swift.Result where T: Encodable { + internal class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try jsonEncoder.encode(value) } } } diff --git a/Sources/ImmutableXCore/Generated/Configuration.swift b/Sources/ImmutableXCore/Generated/Configuration.swift index 8fb0533..5be96e4 100644 --- a/Sources/ImmutableXCore/Generated/Configuration.swift +++ b/Sources/ImmutableXCore/Generated/Configuration.swift @@ -6,10 +6,10 @@ import Foundation -open class Configuration { +internal class Configuration { // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" } diff --git a/Sources/ImmutableXCore/Generated/Extensions.swift b/Sources/ImmutableXCore/Generated/Extensions.swift index 0b17438..c7e2df5 100644 --- a/Sources/ImmutableXCore/Generated/Extensions.swift +++ b/Sources/ImmutableXCore/Generated/Extensions.swift @@ -122,24 +122,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -149,7 +149,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -161,7 +161,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { var tmpArray: [T]? if contains(key) { @@ -171,7 +171,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { var map: [Self.Key: T] = [:] for key in allKeys { diff --git a/Sources/ImmutableXCore/Generated/JSONDataEncoding.swift b/Sources/ImmutableXCore/Generated/JSONDataEncoding.swift index b79e9f5..6b69f3b 100644 --- a/Sources/ImmutableXCore/Generated/JSONDataEncoding.swift +++ b/Sources/ImmutableXCore/Generated/JSONDataEncoding.swift @@ -7,7 +7,7 @@ import Foundation -public struct JSONDataEncoding { +internal struct JSONDataEncoding { // MARK: Properties @@ -24,7 +24,7 @@ public struct JSONDataEncoding { /// - throws: An `Error` if the encoding process encounters an error. /// /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { + internal func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { var urlRequest = urlRequest guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { @@ -40,7 +40,7 @@ public struct JSONDataEncoding { return urlRequest } - public static func encodingParameters(jsonData: Data?) -> [String: Any]? { + internal static func encodingParameters(jsonData: Data?) -> [String: Any]? { var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] diff --git a/Sources/ImmutableXCore/Generated/JSONEncodingHelper.swift b/Sources/ImmutableXCore/Generated/JSONEncodingHelper.swift index 02f78ff..7d8f433 100644 --- a/Sources/ImmutableXCore/Generated/JSONEncodingHelper.swift +++ b/Sources/ImmutableXCore/Generated/JSONEncodingHelper.swift @@ -7,9 +7,9 @@ import Foundation -open class JSONEncodingHelper { +internal class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + internal class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { var params: [String: Any]? // Encode the Encodable object @@ -26,7 +26,7 @@ open class JSONEncodingHelper { return params } - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { + internal class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { var params: [String: Any]? if let encodableObj = encodableObj { diff --git a/Sources/ImmutableXCore/Generated/Models.swift b/Sources/ImmutableXCore/Generated/Models.swift index 21aad0c..da991b0 100644 --- a/Sources/ImmutableXCore/Generated/Models.swift +++ b/Sources/ImmutableXCore/Generated/Models.swift @@ -82,7 +82,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } -open class Response { +internal class Response { public let statusCode: Int public let header: [String: String] public let body: T @@ -105,14 +105,19 @@ open class Response { } } -public final class RequestTask { +public final class RequestTask: @unchecked Sendable { + private var lock = NSRecursiveLock() private var task: URLSessionTask? internal func set(task: URLSessionTask) { + lock.lock() + defer { lock.unlock() } self.task = task } public func cancel() { + lock.lock() + defer { lock.unlock() } task?.cancel() task = nil } diff --git a/Sources/ImmutableXCore/Generated/OpenISO8601DateFormatter.swift b/Sources/ImmutableXCore/Generated/OpenISO8601DateFormatter.swift index e062080..cc04b4e 100644 --- a/Sources/ImmutableXCore/Generated/OpenISO8601DateFormatter.swift +++ b/Sources/ImmutableXCore/Generated/OpenISO8601DateFormatter.swift @@ -8,7 +8,7 @@ import Foundation // https://stackoverflow.com/a/50281094/976628 -public class OpenISO8601DateFormatter: DateFormatter { +internal class OpenISO8601DateFormatter: DateFormatter { static let withoutSeconds: DateFormatter = { let formatter = DateFormatter() formatter.calendar = Calendar(identifier: .iso8601) @@ -35,7 +35,7 @@ public class OpenISO8601DateFormatter: DateFormatter { setup() } - override public func date(from string: String) -> Date? { + override internal func date(from string: String) -> Date? { if let result = super.date(from: string) { return result } diff --git a/Sources/ImmutableXCore/Generated/URLSessionImplementations.swift b/Sources/ImmutableXCore/Generated/URLSessionImplementations.swift index 90e35b6..917e03a 100644 --- a/Sources/ImmutableXCore/Generated/URLSessionImplementations.swift +++ b/Sources/ImmutableXCore/Generated/URLSessionImplementations.swift @@ -10,7 +10,7 @@ import os.log import MobileCoreServices #endif -public protocol URLSessionProtocol { +internal protocol URLSessionProtocol { func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask } @@ -26,7 +26,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { } } -public typealias OpenAPIClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) +internal typealias OpenAPIClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) // Store the URLSession's delegate to retain its reference private let sessionDelegate = SessionDelegate() @@ -40,12 +40,12 @@ private var challengeHandlerStore = SynchronizedDictionary() -open class URLSessionRequestBuilder: RequestBuilder { +internal class URLSessionRequestBuilder: RequestBuilder { /** May be assigned if you want to control the authentication challenges. */ - public var taskDidReceiveChallenge: OpenAPIClientAPIChallengeHandler? + internal var taskDidReceiveChallenge: OpenAPIClientAPIChallengeHandler? /** May be assigned if you want to do any of those things: @@ -53,9 +53,9 @@ open class URLSessionRequestBuilder: RequestBuilder { - intercept and handle errors like authorization - retry the request. */ - public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? + internal var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, headers: headers) } @@ -63,7 +63,7 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLSession configuration. */ - open func createURLSession() -> URLSessionProtocol { + internal func createURLSession() -> URLSessionProtocol { return defaultURLSession } @@ -74,7 +74,7 @@ open class URLSessionRequestBuilder: RequestBuilder { Return nil to use the default behavior (inferring the Content-Type from the file extension). Return the desired Content-Type otherwise. */ - open func contentTypeForFormPart(fileURL: URL) -> String? { + internal func contentTypeForFormPart(fileURL: URL) -> String? { return nil } @@ -82,7 +82,7 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSessionProtocol, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + internal func createURLRequest(urlSession: URLSessionProtocol, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL @@ -106,7 +106,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + override internal func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -219,7 +219,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - open func buildHeaders() -> [String: String] { + internal func buildHeaders() -> [String: String] { var httpHeaders: [String: String] = [:] for (key, value) in headers { httpHeaders[key] = value @@ -283,7 +283,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { if let error = error { @@ -401,7 +401,7 @@ private class SessionDelegate: NSObject, URLSessionTaskDelegate { } } -public enum HTTPMethod: String { +internal enum HTTPMethod: String { case options = "OPTIONS" case get = "GET" case head = "HEAD" @@ -413,7 +413,7 @@ public enum HTTPMethod: String { case connect = "CONNECT" } -public protocol ParameterEncoding { +internal protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } @@ -725,4 +725,4 @@ private struct Logger { ) #endif } -} +} \ No newline at end of file diff --git a/generateapi.sh b/generateapi.sh index e159102..b81390b 100755 --- a/generateapi.sh +++ b/generateapi.sh @@ -1,6 +1,6 @@ #!/bin/bash -openapi-generator generate -i openapi.json -g swift5 -t .openapi-generator/templates/swift5 -o Generated/ --additional-properties=useJsonEncodable=false,readonlyProperties=true,responseAs=AsyncAwait,useSPMFileStructure=true +openapi-generator generate -i openapi.json -g swift5 -t .openapi-generator/templates/swift5 -o Generated/ --additional-properties=useJsonEncodable=false,readonlyProperties=true,responseAs=AsyncAwait,useSPMFileStructure=true,nonPublicApi=true rm -rf Sources/ImmutableXCore/Generated cp -R Generated/Sources/OpenAPIClient Sources/ImmutableXCore/Generated