mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 19:46:10 +00:00
Merge remote-tracking branch 'origin/5.3.x' into 6.0.x
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/swift,xcode
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=swift,xcode
|
||||
|
||||
### Swift ###
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
## User settings
|
||||
xcuserdata/
|
||||
|
||||
## Various settings
|
||||
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
|
||||
*.xcscmblueprint
|
||||
*.xccheckout
|
||||
|
||||
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
|
||||
build/
|
||||
DerivedData/
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
@@ -15,49 +25,81 @@ DerivedData
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
|
||||
## App packaging
|
||||
*.ipa
|
||||
*.dSYM.zip
|
||||
*.dSYM
|
||||
|
||||
## Playgrounds
|
||||
timeline.xctimeline
|
||||
playground.xcworkspace
|
||||
|
||||
# Swift Package Manager
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
|
||||
# Packages/
|
||||
# Package.pins
|
||||
# Package.resolved
|
||||
# *.xcodeproj
|
||||
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
|
||||
# hence it is not needed unless you have added a package configuration file to your project
|
||||
# .swiftpm
|
||||
|
||||
.build/
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||
#
|
||||
# Pods/
|
||||
# Add this line if you want to avoid checking in source code from the Xcode workspace
|
||||
# *.xcworkspace
|
||||
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
Carthage/Build/
|
||||
|
||||
# Add this lines if you are using Accio dependency management (Deprecated since Xcode 12)
|
||||
# Dependencies/
|
||||
# .accio/
|
||||
|
||||
# fastlane
|
||||
#
|
||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||
# screenshots whenever they are needed.
|
||||
# It is recommended to not store the screenshots in the git repo.
|
||||
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
|
||||
# For more information about the recommended setup visit:
|
||||
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
|
||||
# https://docs.fastlane.tools/best-practices/source-control/#source-control
|
||||
|
||||
fastlane/report.xml
|
||||
fastlane/screenshots
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots/**/*.png
|
||||
fastlane/test_output
|
||||
|
||||
# Code Injection
|
||||
# After new code Injection tools there's a generated folder /iOSInjectionProject
|
||||
# https://github.com/johnno1962/injectionforxcode
|
||||
|
||||
iOSInjectionProject/
|
||||
|
||||
### Xcode ###
|
||||
# Xcode
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
|
||||
|
||||
|
||||
## Gcc Patch
|
||||
/*.gcno
|
||||
|
||||
### Xcode Patch ###
|
||||
*.xcodeproj/*
|
||||
!*.xcodeproj/project.pbxproj
|
||||
!*.xcodeproj/xcshareddata/
|
||||
!*.xcworkspace/contents.xcworkspacedata
|
||||
**/xcshareddata/WorkspaceSettings.xcsettings
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/swift,xcode
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
6.0.0-SNAPSHOT
|
||||
<<<<<<< HEAD
|
||||
6.0.0-SNAPSHOT
|
||||
=======
|
||||
5.3.0-SNAPSHOT
|
||||
>>>>>>> origin/5.3.x
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,2 +1,2 @@
|
||||
|
||||
github "Flight-School/AnyCodable" ~> 0.4.0
|
||||
github "Flight-School/AnyCodable" ~> 0.6.1
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"object": {
|
||||
"pins": [
|
||||
{
|
||||
"package": "AnyCodable",
|
||||
"repositoryURL": "https://github.com/Flight-School/AnyCodable",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "69261f239f0fffaf51495dadc4f8483fbfe97025",
|
||||
"version": "0.6.1"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 1
|
||||
}
|
||||
@@ -19,7 +19,7 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
.package(url: "https://github.com/Flight-School/AnyCodable", .exact("0.4.0")),
|
||||
.package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.1"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
|
||||
@@ -11,5 +11,5 @@ Pod::Spec.new do |s|
|
||||
s.homepage = 'https://github.com/openapitools/openapi-generator'
|
||||
s.summary = 'PetstoreClient'
|
||||
s.source_files = 'Sources/PetstoreClient/**/*.swift'
|
||||
s.dependency 'AnyCodable-FlightSchool', '~> 0.4.0'
|
||||
s.dependency 'AnyCodable-FlightSchool', '~> 0.6.1'
|
||||
end
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
// APIHelper.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct APIHelper {
|
||||
public 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
|
||||
}
|
||||
}
|
||||
|
||||
if destination.isEmpty {
|
||||
return nil
|
||||
}
|
||||
return destination
|
||||
}
|
||||
|
||||
public 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.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",")
|
||||
} else if let value: Any = item.value {
|
||||
result[item.key] = "\(value)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? {
|
||||
guard let source = source else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return source.reduce(into: [String: Any]()) { result, item in
|
||||
switch item.value {
|
||||
case let x as Bool:
|
||||
result[item.key] = x.description
|
||||
default:
|
||||
result[item.key] = item.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static func mapValueToPathItem(_ source: Any) -> Any {
|
||||
if let collection = source as? [Any?] {
|
||||
return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",")
|
||||
}
|
||||
return source
|
||||
}
|
||||
|
||||
public 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.filter { $0 != nil }.map { "\($0!)" }.forEach { value in
|
||||
result.append(URLQueryItem(name: item.key, value: value))
|
||||
}
|
||||
} else if let value = item.value {
|
||||
result.append(URLQueryItem(name: item.key, value: "\(value)"))
|
||||
}
|
||||
}
|
||||
|
||||
if destination.isEmpty {
|
||||
return nil
|
||||
}
|
||||
return destination
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
// APIs.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class PetstoreClientAPI {
|
||||
public static var basePath = "http://petstore.swagger.io:80/v2"
|
||||
public static var credential: URLCredential?
|
||||
public static var customHeaders: [String: String] = [:]
|
||||
public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory()
|
||||
public static var apiResponseQueue: DispatchQueue = .main
|
||||
}
|
||||
|
||||
open class RequestBuilder<T> {
|
||||
var credential: URLCredential?
|
||||
var headers: [String: String]
|
||||
public let parameters: [String: Any]?
|
||||
public let method: String
|
||||
public let URLString: String
|
||||
|
||||
/// 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)?
|
||||
|
||||
required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) {
|
||||
self.method = method
|
||||
self.URLString = URLString
|
||||
self.parameters = parameters
|
||||
self.headers = headers
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
for (header, value) in aHeaders {
|
||||
headers[header] = value
|
||||
}
|
||||
}
|
||||
|
||||
open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) { }
|
||||
|
||||
public func addHeader(name: String, value: String) -> Self {
|
||||
if !value.isEmpty {
|
||||
headers[name] = value
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
credential = PetstoreClientAPI.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
public protocol RequestBuilderFactory {
|
||||
func getNonDecodableBuilder<T>() -> RequestBuilder<T>.Type
|
||||
func getBuilder<T: Decodable>() -> RequestBuilder<T>.Type
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
//
|
||||
// AnotherFakeAPI.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class AnotherFakeAPI {
|
||||
/**
|
||||
To test special tags
|
||||
|
||||
- parameter body: (body) client model
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
To test special tags
|
||||
- PATCH /another-fake/dummy
|
||||
- To test special tags and operation ID starting with number
|
||||
- parameter body: (body) client model
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/another-fake/dummy"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,684 +0,0 @@
|
||||
//
|
||||
// FakeAPI.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class FakeAPI {
|
||||
/**
|
||||
|
||||
- parameter body: (body) Input boolean as post body (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) {
|
||||
fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- POST /fake/outer/boolean
|
||||
- Test serialization of outer boolean types
|
||||
- parameter body: (body) Input boolean as post body (optional)
|
||||
- returns: RequestBuilder<Bool>
|
||||
*/
|
||||
open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder<Bool> {
|
||||
let path = "/fake/outer/boolean"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Bool>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
- parameter body: (body) Input composite as post body (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) {
|
||||
fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- POST /fake/outer/composite
|
||||
- Test serialization of object with outer number type
|
||||
- parameter body: (body) Input composite as post body (optional)
|
||||
- returns: RequestBuilder<OuterComposite>
|
||||
*/
|
||||
open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder<OuterComposite> {
|
||||
let path = "/fake/outer/composite"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<OuterComposite>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
- parameter body: (body) Input number as post body (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) {
|
||||
fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- POST /fake/outer/number
|
||||
- Test serialization of outer number types
|
||||
- parameter body: (body) Input number as post body (optional)
|
||||
- returns: RequestBuilder<Double>
|
||||
*/
|
||||
open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder<Double> {
|
||||
let path = "/fake/outer/number"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Double>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
- parameter body: (body) Input string as post body (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) {
|
||||
fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- POST /fake/outer/string
|
||||
- Test serialization of outer string types
|
||||
- parameter body: (body) Input string as post body (optional)
|
||||
- returns: RequestBuilder<String>
|
||||
*/
|
||||
open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder<String> {
|
||||
let path = "/fake/outer/string"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<String>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
- parameter body: (body)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- PUT /fake/body-with-file-schema
|
||||
- For this test, the body for this request much reference a schema named `File`.
|
||||
- parameter body: (body)
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder<Void> {
|
||||
let path = "/fake/body-with-file-schema"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
- parameter query: (query)
|
||||
- parameter body: (body)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- PUT /fake/body-with-query-params
|
||||
- parameter query: (query)
|
||||
- parameter body: (body)
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder<Void> {
|
||||
let path = "/fake/body-with-query-params"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"query": query.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
To test \"client\" model
|
||||
|
||||
- parameter body: (body) client model
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
To test \"client\" model
|
||||
- PATCH /fake
|
||||
- To test \"client\" model
|
||||
- parameter body: (body) client model
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
- parameter number: (form) None
|
||||
- parameter double: (form) None
|
||||
- parameter patternWithoutDelimiter: (form) None
|
||||
- parameter byte: (form) None
|
||||
- parameter integer: (form) None (optional)
|
||||
- parameter int32: (form) None (optional)
|
||||
- parameter int64: (form) None (optional)
|
||||
- parameter float: (form) None (optional)
|
||||
- parameter string: (form) None (optional)
|
||||
- parameter binary: (form) None (optional)
|
||||
- parameter date: (form) None (optional)
|
||||
- parameter dateTime: (form) None (optional)
|
||||
- parameter password: (form) None (optional)
|
||||
- parameter callback: (form) None (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
- POST /fake
|
||||
- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
- BASIC:
|
||||
- type: http
|
||||
- name: http_basic_test
|
||||
- parameter number: (form) None
|
||||
- parameter double: (form) None
|
||||
- parameter patternWithoutDelimiter: (form) None
|
||||
- parameter byte: (form) None
|
||||
- parameter integer: (form) None (optional)
|
||||
- parameter int32: (form) None (optional)
|
||||
- parameter int64: (form) None (optional)
|
||||
- parameter float: (form) None (optional)
|
||||
- parameter string: (form) None (optional)
|
||||
- parameter binary: (form) None (optional)
|
||||
- parameter date: (form) None (optional)
|
||||
- parameter dateTime: (form) None (optional)
|
||||
- parameter password: (form) None (optional)
|
||||
- parameter callback: (form) None (optional)
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
"integer": integer?.encodeToJSON(),
|
||||
"int32": int32?.encodeToJSON(),
|
||||
"int64": int64?.encodeToJSON(),
|
||||
"number": number.encodeToJSON(),
|
||||
"float": float?.encodeToJSON(),
|
||||
"double": double.encodeToJSON(),
|
||||
"string": string?.encodeToJSON(),
|
||||
"pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(),
|
||||
"byte": byte.encodeToJSON(),
|
||||
"binary": binary?.encodeToJSON(),
|
||||
"date": date?.encodeToJSON(),
|
||||
"dateTime": dateTime?.encodeToJSON(),
|
||||
"password": password?.encodeToJSON(),
|
||||
"callback": callback?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumHeaderStringArray
|
||||
*/
|
||||
public enum EnumHeaderStringArray_testEnumParameters: String, CaseIterable {
|
||||
case greaterThan = ">"
|
||||
case dollar = "$"
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumHeaderString
|
||||
*/
|
||||
public enum EnumHeaderString_testEnumParameters: String, CaseIterable {
|
||||
case abc = "_abc"
|
||||
case efg = "-efg"
|
||||
case xyz = "(xyz)"
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumQueryStringArray
|
||||
*/
|
||||
public enum EnumQueryStringArray_testEnumParameters: String, CaseIterable {
|
||||
case greaterThan = ">"
|
||||
case dollar = "$"
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumQueryString
|
||||
*/
|
||||
public enum EnumQueryString_testEnumParameters: String, CaseIterable {
|
||||
case abc = "_abc"
|
||||
case efg = "-efg"
|
||||
case xyz = "(xyz)"
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumQueryInteger
|
||||
*/
|
||||
public enum EnumQueryInteger_testEnumParameters: Int, CaseIterable {
|
||||
case _1 = 1
|
||||
case number2 = -2
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumQueryDouble
|
||||
*/
|
||||
public enum EnumQueryDouble_testEnumParameters: Double, CaseIterable {
|
||||
case _11 = 1.1
|
||||
case number12 = -1.2
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumFormStringArray
|
||||
*/
|
||||
public enum EnumFormStringArray_testEnumParameters: String, CaseIterable {
|
||||
case greaterThan = ">"
|
||||
case dollar = "$"
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter enumFormString
|
||||
*/
|
||||
public enum EnumFormString_testEnumParameters: String, CaseIterable {
|
||||
case abc = "_abc"
|
||||
case efg = "-efg"
|
||||
case xyz = "(xyz)"
|
||||
}
|
||||
|
||||
/**
|
||||
To test enum parameters
|
||||
|
||||
- parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional)
|
||||
- parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg)
|
||||
- parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional)
|
||||
- parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg)
|
||||
- parameter enumQueryInteger: (query) Query parameter enum test (double) (optional)
|
||||
- parameter enumQueryDouble: (query) Query parameter enum test (double) (optional)
|
||||
- parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar)
|
||||
- parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
To test enum parameters
|
||||
- GET /fake
|
||||
- To test enum parameters
|
||||
- parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional)
|
||||
- parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg)
|
||||
- parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional)
|
||||
- parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg)
|
||||
- parameter enumQueryInteger: (query) Query parameter enum test (double) (optional)
|
||||
- parameter enumQueryDouble: (query) Query parameter enum test (double) (optional)
|
||||
- parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar)
|
||||
- parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg)
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder<Void> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
"enum_form_string_array": enumFormStringArray?.encodeToJSON(),
|
||||
"enum_form_string": enumFormString?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"enum_query_string_array": enumQueryStringArray?.encodeToJSON(),
|
||||
"enum_query_string": enumQueryString?.encodeToJSON(),
|
||||
"enum_query_integer": enumQueryInteger?.encodeToJSON(),
|
||||
"enum_query_double": enumQueryDouble?.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"enum_header_string_array": enumHeaderStringArray?.encodeToJSON(),
|
||||
"enum_header_string": enumHeaderString?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
- parameter requiredStringGroup: (query) Required String in group parameters
|
||||
- parameter requiredBooleanGroup: (header) Required Boolean in group parameters
|
||||
- parameter requiredInt64Group: (query) Required Integer in group parameters
|
||||
- parameter stringGroup: (query) String in group parameters (optional)
|
||||
- parameter booleanGroup: (header) Boolean in group parameters (optional)
|
||||
- parameter int64Group: (query) Integer in group parameters (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Fake endpoint to test group parameters (optional)
|
||||
- DELETE /fake
|
||||
- Fake endpoint to test group parameters (optional)
|
||||
- parameter requiredStringGroup: (query) Required String in group parameters
|
||||
- parameter requiredBooleanGroup: (header) Required Boolean in group parameters
|
||||
- parameter requiredInt64Group: (query) Required Integer in group parameters
|
||||
- parameter stringGroup: (query) String in group parameters (optional)
|
||||
- parameter booleanGroup: (header) Boolean in group parameters (optional)
|
||||
- parameter int64Group: (query) Integer in group parameters (optional)
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder<Void> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"required_string_group": requiredStringGroup.encodeToJSON(),
|
||||
"required_int64_group": requiredInt64Group.encodeToJSON(),
|
||||
"string_group": stringGroup?.encodeToJSON(),
|
||||
"int64_group": int64Group?.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"required_boolean_group": requiredBooleanGroup.encodeToJSON(),
|
||||
"boolean_group": booleanGroup?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
|
||||
- parameter param: (body) request body
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
- POST /fake/inline-additionalProperties
|
||||
- parameter param: (body) request body
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder<Void> {
|
||||
let path = "/fake/inline-additionalProperties"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
|
||||
- parameter param: (form) field1
|
||||
- parameter param2: (form) field2
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
- GET /fake/jsonFormData
|
||||
- parameter param: (form) field1
|
||||
- parameter param2: (form) field2
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder<Void> {
|
||||
let path = "/fake/jsonFormData"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
"param": param.encodeToJSON(),
|
||||
"param2": param2.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
//
|
||||
// FakeClassnameTags123API.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class FakeClassnameTags123API {
|
||||
/**
|
||||
To test class name in snake case
|
||||
|
||||
- parameter body: (body) client model
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
To test class name in snake case
|
||||
- PATCH /fake_classname_test
|
||||
- To test class name in snake case
|
||||
- API Key:
|
||||
- type: apiKey api_key_query (QUERY)
|
||||
- name: api_key_query
|
||||
- parameter body: (body) client model
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/fake_classname_test"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,483 +0,0 @@
|
||||
//
|
||||
// PetAPI.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class PetAPI {
|
||||
/**
|
||||
Add a new pet to the store
|
||||
|
||||
- parameter body: (body) Pet object that needs to be added to the store
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Add a new pet to the store
|
||||
- POST /pet
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter body: (body) Pet object that needs to be added to the store
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder<Void> {
|
||||
let path = "/pet"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Deletes a pet
|
||||
|
||||
- parameter petId: (path) Pet id to delete
|
||||
- parameter apiKey: (header) (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Deletes a pet
|
||||
- DELETE /pet/{petId}
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter petId: (path) Pet id to delete
|
||||
- parameter apiKey: (header) (optional)
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder<Void> {
|
||||
var path = "/pet/{petId}"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"api_key": apiKey?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
* enum for parameter status
|
||||
*/
|
||||
public enum Status_findPetsByStatus: String, CaseIterable {
|
||||
case available = "available"
|
||||
case pending = "pending"
|
||||
case sold = "sold"
|
||||
}
|
||||
|
||||
/**
|
||||
Finds Pets by status
|
||||
|
||||
- parameter status: (query) Status values that need to be considered for filter
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) {
|
||||
findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Finds Pets by status
|
||||
- GET /pet/findByStatus
|
||||
- Multiple status values can be provided with comma separated strings
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter status: (query) Status values that need to be considered for filter
|
||||
- returns: RequestBuilder<[Pet]>
|
||||
*/
|
||||
open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> {
|
||||
let path = "/pet/findByStatus"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"status": status.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Finds Pets by tags
|
||||
|
||||
- parameter tags: (query) Tags to filter by
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
@available(*, deprecated, message: "This operation is deprecated.")
|
||||
open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) {
|
||||
findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Finds Pets by tags
|
||||
- GET /pet/findByTags
|
||||
- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter tags: (query) Tags to filter by
|
||||
- returns: RequestBuilder<[Pet]>
|
||||
*/
|
||||
@available(*, deprecated, message: "This operation is deprecated.")
|
||||
open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> {
|
||||
let path = "/pet/findByTags"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"tags": tags.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Find pet by ID
|
||||
|
||||
- parameter petId: (path) ID of pet to return
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) {
|
||||
getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Find pet by ID
|
||||
- GET /pet/{petId}
|
||||
- Returns a single pet
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- parameter petId: (path) ID of pet to return
|
||||
- returns: RequestBuilder<Pet>
|
||||
*/
|
||||
open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder<Pet> {
|
||||
var path = "/pet/{petId}"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Pet>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Update an existing pet
|
||||
|
||||
- parameter body: (body) Pet object that needs to be added to the store
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Update an existing pet
|
||||
- PUT /pet
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter body: (body) Pet object that needs to be added to the store
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder<Void> {
|
||||
let path = "/pet"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Updates a pet in the store with form data
|
||||
|
||||
- parameter petId: (path) ID of pet that needs to be updated
|
||||
- parameter name: (form) Updated name of the pet (optional)
|
||||
- parameter status: (form) Updated status of the pet (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Updates a pet in the store with form data
|
||||
- POST /pet/{petId}
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter petId: (path) ID of pet that needs to be updated
|
||||
- parameter name: (form) Updated name of the pet (optional)
|
||||
- parameter status: (form) Updated status of the pet (optional)
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder<Void> {
|
||||
var path = "/pet/{petId}"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
"name": name?.encodeToJSON(),
|
||||
"status": status?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
uploads an image
|
||||
|
||||
- parameter petId: (path) ID of pet to update
|
||||
- parameter additionalMetadata: (form) Additional data to pass to server (optional)
|
||||
- parameter file: (form) file to upload (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) {
|
||||
uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
uploads an image
|
||||
- POST /pet/{petId}/uploadImage
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter petId: (path) ID of pet to update
|
||||
- parameter additionalMetadata: (form) Additional data to pass to server (optional)
|
||||
- parameter file: (form) file to upload (optional)
|
||||
- returns: RequestBuilder<ApiResponse>
|
||||
*/
|
||||
open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder<ApiResponse> {
|
||||
var path = "/pet/{petId}/uploadImage"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(),
|
||||
"file": file?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<ApiResponse>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
uploads an image (required)
|
||||
|
||||
- parameter petId: (path) ID of pet to update
|
||||
- parameter requiredFile: (form) file to upload
|
||||
- parameter additionalMetadata: (form) Additional data to pass to server (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) {
|
||||
uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
uploads an image (required)
|
||||
- POST /fake/{petId}/uploadImageWithRequiredFile
|
||||
- OAuth:
|
||||
- type: oauth2
|
||||
- name: petstore_auth
|
||||
- parameter petId: (path) ID of pet to update
|
||||
- parameter requiredFile: (form) file to upload
|
||||
- parameter additionalMetadata: (form) Additional data to pass to server (optional)
|
||||
- returns: RequestBuilder<ApiResponse>
|
||||
*/
|
||||
open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder<ApiResponse> {
|
||||
var path = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(),
|
||||
"requiredFile": requiredFile.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<ApiResponse>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
//
|
||||
// StoreAPI.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class StoreAPI {
|
||||
/**
|
||||
Delete purchase order by ID
|
||||
|
||||
- parameter orderId: (path) ID of the order that needs to be deleted
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Delete purchase order by ID
|
||||
- DELETE /store/order/{order_id}
|
||||
- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
- parameter orderId: (path) ID of the order that needs to be deleted
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder<Void> {
|
||||
var path = "/store/order/{order_id}"
|
||||
let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))"
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Returns pet inventories by status
|
||||
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) {
|
||||
getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns pet inventories by status
|
||||
- GET /store/inventory
|
||||
- Returns a map of status codes to quantities
|
||||
- API Key:
|
||||
- type: apiKey api_key
|
||||
- name: api_key
|
||||
- returns: RequestBuilder<[String: Int]>
|
||||
*/
|
||||
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> {
|
||||
let path = "/store/inventory"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Find purchase order by ID
|
||||
|
||||
- parameter orderId: (path) ID of pet that needs to be fetched
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) {
|
||||
getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Find purchase order by ID
|
||||
- GET /store/order/{order_id}
|
||||
- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
- parameter orderId: (path) ID of pet that needs to be fetched
|
||||
- returns: RequestBuilder<Order>
|
||||
*/
|
||||
open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder<Order> {
|
||||
var path = "/store/order/{order_id}"
|
||||
let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))"
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Order>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Place an order for a pet
|
||||
|
||||
- parameter body: (body) order placed for purchasing the pet
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) {
|
||||
placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Place an order for a pet
|
||||
- POST /store/order
|
||||
- parameter body: (body) order placed for purchasing the pet
|
||||
- returns: RequestBuilder<Order>
|
||||
*/
|
||||
open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder<Order> {
|
||||
let path = "/store/order"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Order>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,366 +0,0 @@
|
||||
//
|
||||
// UserAPI.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class UserAPI {
|
||||
/**
|
||||
Create user
|
||||
|
||||
- parameter body: (body) Created user object
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Create user
|
||||
- POST /user
|
||||
- This can only be done by the logged in user.
|
||||
- parameter body: (body) Created user object
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func createUserWithRequestBuilder(body: User) -> RequestBuilder<Void> {
|
||||
let path = "/user"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Creates list of users with given input array
|
||||
|
||||
- parameter body: (body) List of user object
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Creates list of users with given input array
|
||||
- POST /user/createWithArray
|
||||
- parameter body: (body) List of user object
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder<Void> {
|
||||
let path = "/user/createWithArray"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Creates list of users with given input array
|
||||
|
||||
- parameter body: (body) List of user object
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Creates list of users with given input array
|
||||
- POST /user/createWithList
|
||||
- parameter body: (body) List of user object
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder<Void> {
|
||||
let path = "/user/createWithList"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Delete user
|
||||
|
||||
- parameter username: (path) The name that needs to be deleted
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Delete user
|
||||
- DELETE /user/{username}
|
||||
- This can only be done by the logged in user.
|
||||
- parameter username: (path) The name that needs to be deleted
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder<Void> {
|
||||
var path = "/user/{username}"
|
||||
let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))"
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Get user by user name
|
||||
|
||||
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) {
|
||||
getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Get user by user name
|
||||
- GET /user/{username}
|
||||
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
|
||||
- returns: RequestBuilder<User>
|
||||
*/
|
||||
open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder<User> {
|
||||
var path = "/user/{username}"
|
||||
let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))"
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<User>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Logs user into the system
|
||||
|
||||
- parameter username: (query) The user name for login
|
||||
- parameter password: (query) The password for login in clear text
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) {
|
||||
loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
completion(response.body, nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Logs user into the system
|
||||
- GET /user/login
|
||||
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
|
||||
- parameter username: (query) The user name for login
|
||||
- parameter password: (query) The password for login in clear text
|
||||
- returns: RequestBuilder<String>
|
||||
*/
|
||||
open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder<String> {
|
||||
let path = "/user/login"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"username": username.encodeToJSON(),
|
||||
"password": password.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<String>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Logs out current logged in user session
|
||||
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Logs out current logged in user session
|
||||
- GET /user/logout
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func logoutUserWithRequestBuilder() -> RequestBuilder<Void> {
|
||||
let path = "/user/logout"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
Updated user
|
||||
|
||||
- parameter username: (path) name that need to be deleted
|
||||
- parameter body: (body) Updated user object
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
completion((), nil)
|
||||
case let .failure(error):
|
||||
completion(nil, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Updated user
|
||||
- PUT /user/{username}
|
||||
- This can only be done by the logged in user.
|
||||
- parameter username: (path) name that need to be deleted
|
||||
- parameter body: (body) Updated user object
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder<Void> {
|
||||
var path = "/user/{username}"
|
||||
let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))"
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
//
|
||||
// CodableHelper.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class CodableHelper {
|
||||
private static var customDateFormatter: DateFormatter?
|
||||
private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter()
|
||||
|
||||
private static var customJSONDecoder: JSONDecoder?
|
||||
private static var defaultJSONDecoder: JSONDecoder = {
|
||||
let decoder = JSONDecoder()
|
||||
decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter)
|
||||
return decoder
|
||||
}()
|
||||
|
||||
private static var customJSONEncoder: JSONEncoder?
|
||||
private static var defaultJSONEncoder: JSONEncoder = {
|
||||
let encoder = JSONEncoder()
|
||||
encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter)
|
||||
encoder.outputFormatting = .prettyPrinted
|
||||
return encoder
|
||||
}()
|
||||
|
||||
public static var dateFormatter: DateFormatter {
|
||||
get { return customDateFormatter ?? defaultDateFormatter }
|
||||
set { customDateFormatter = newValue }
|
||||
}
|
||||
public static var jsonDecoder: JSONDecoder {
|
||||
get { return customJSONDecoder ?? defaultJSONDecoder }
|
||||
set { customJSONDecoder = newValue }
|
||||
}
|
||||
public static var jsonEncoder: JSONEncoder {
|
||||
get { return customJSONEncoder ?? defaultJSONEncoder }
|
||||
set { customJSONEncoder = newValue }
|
||||
}
|
||||
|
||||
open class func decode<T>(_ type: T.Type, from data: Data) -> Swift.Result<T, Error> where T: Decodable {
|
||||
return Swift.Result { try jsonDecoder.decode(type, from: data) }
|
||||
}
|
||||
|
||||
open class func encode<T>(_ value: T) -> Swift.Result<Data, Error> where T: Encodable {
|
||||
return Swift.Result { try jsonEncoder.encode(value) }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// Configuration.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open 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"
|
||||
}
|
||||
@@ -1,227 +0,0 @@
|
||||
// Extensions.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
extension Bool: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self as Any }
|
||||
}
|
||||
|
||||
extension Float: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self as Any }
|
||||
}
|
||||
|
||||
extension Int: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self as Any }
|
||||
}
|
||||
|
||||
extension Int32: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return NSNumber(value: self as Int32) }
|
||||
}
|
||||
|
||||
extension Int64: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return NSNumber(value: self as Int64) }
|
||||
}
|
||||
|
||||
extension Double: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self as Any }
|
||||
}
|
||||
|
||||
extension String: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self as Any }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self.rawValue as Any }
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T>(_ object: T) -> Any {
|
||||
if let encodableObject = object as? JSONEncodable {
|
||||
return encodableObject.encodeToJSON()
|
||||
} else {
|
||||
return object as Any
|
||||
}
|
||||
}
|
||||
|
||||
extension Array: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return self.map(encodeIfPossible)
|
||||
}
|
||||
}
|
||||
|
||||
extension Set: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return Array(self).encodeToJSON()
|
||||
}
|
||||
}
|
||||
|
||||
extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
for (key, value) in self {
|
||||
dictionary[key] = encodeIfPossible(value)
|
||||
}
|
||||
return dictionary as Any
|
||||
}
|
||||
}
|
||||
|
||||
extension Data: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return self.base64EncodedString(options: Data.Base64EncodingOptions())
|
||||
}
|
||||
}
|
||||
|
||||
extension Date: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return CodableHelper.dateFormatter.string(from: self) as Any
|
||||
}
|
||||
}
|
||||
|
||||
extension URL: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
extension UUID: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return self.uuidString
|
||||
}
|
||||
}
|
||||
|
||||
extension String: CodingKey {
|
||||
|
||||
public var stringValue: String {
|
||||
return self
|
||||
}
|
||||
|
||||
public init?(stringValue: String) {
|
||||
self.init(stringLiteral: stringValue)
|
||||
}
|
||||
|
||||
public var intValue: Int? {
|
||||
return nil
|
||||
}
|
||||
|
||||
public init?(intValue: Int) {
|
||||
return nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension KeyedEncodingContainerProtocol {
|
||||
|
||||
public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable {
|
||||
var arrayContainer = nestedUnkeyedContainer(forKey: key)
|
||||
try arrayContainer.encode(contentsOf: values)
|
||||
}
|
||||
|
||||
public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable {
|
||||
if let values = values {
|
||||
try encodeArray(values, forKey: key)
|
||||
}
|
||||
}
|
||||
|
||||
public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable {
|
||||
for (key, value) in pairs {
|
||||
try encode(value, forKey: key)
|
||||
}
|
||||
}
|
||||
|
||||
public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable {
|
||||
if let pairs = pairs {
|
||||
try encodeMap(pairs)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension KeyedDecodingContainerProtocol {
|
||||
|
||||
public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable {
|
||||
var tmpArray = [T]()
|
||||
|
||||
var nestedContainer = try nestedUnkeyedContainer(forKey: key)
|
||||
while !nestedContainer.isAtEnd {
|
||||
let arrayValue = try nestedContainer.decode(T.self)
|
||||
tmpArray.append(arrayValue)
|
||||
}
|
||||
|
||||
return tmpArray
|
||||
}
|
||||
|
||||
public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable {
|
||||
var tmpArray: [T]?
|
||||
|
||||
if contains(key) {
|
||||
tmpArray = try decodeArray(T.self, forKey: key)
|
||||
}
|
||||
|
||||
return tmpArray
|
||||
}
|
||||
|
||||
public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable {
|
||||
var map: [Self.Key: T] = [:]
|
||||
|
||||
for key in allKeys {
|
||||
if !excludedKeys.contains(key) {
|
||||
let value = try decode(T.self, forKey: key)
|
||||
map[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
return map
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension HTTPURLResponse {
|
||||
var isStatusCodeSuccessful: Bool {
|
||||
return Array(200 ..< 300).contains(statusCode)
|
||||
}
|
||||
}
|
||||
|
||||
extension AnyCodable: Hashable {
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
switch value {
|
||||
case let value as Bool:
|
||||
hasher.combine(value)
|
||||
case let value as Int:
|
||||
hasher.combine(value)
|
||||
case let value as Int8:
|
||||
hasher.combine(value)
|
||||
case let value as Int16:
|
||||
hasher.combine(value)
|
||||
case let value as Int32:
|
||||
hasher.combine(value)
|
||||
case let value as Int64:
|
||||
hasher.combine(value)
|
||||
case let value as UInt:
|
||||
hasher.combine(value)
|
||||
case let value as UInt8:
|
||||
hasher.combine(value)
|
||||
case let value as UInt16:
|
||||
hasher.combine(value)
|
||||
case let value as UInt32:
|
||||
hasher.combine(value)
|
||||
case let value as UInt64:
|
||||
hasher.combine(value)
|
||||
case let value as Float:
|
||||
hasher.combine(value)
|
||||
case let value as Double:
|
||||
hasher.combine(value)
|
||||
case let value as String:
|
||||
hasher.combine(value)
|
||||
case let value as [String: AnyCodable]:
|
||||
hasher.combine(value)
|
||||
case let value as [AnyCodable]:
|
||||
hasher.combine(value)
|
||||
default:
|
||||
hasher.combine(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// JSONDataEncoding.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct JSONDataEncoding {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
private static let jsonDataKey = "jsonData"
|
||||
|
||||
// MARK: Encoding
|
||||
|
||||
/// Creates a URL request by encoding parameters and applying them onto an existing request.
|
||||
///
|
||||
/// - parameter urlRequest: The request to have parameters applied.
|
||||
/// - parameter parameters: The parameters to apply. This should have a single key/value
|
||||
/// pair with "jsonData" as the key and a Data object as the value.
|
||||
///
|
||||
/// - throws: An `Error` if the encoding process encounters an error.
|
||||
///
|
||||
/// - returns: The encoded request.
|
||||
public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest {
|
||||
var urlRequest = urlRequest
|
||||
|
||||
guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else {
|
||||
return urlRequest
|
||||
}
|
||||
|
||||
if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil {
|
||||
urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
|
||||
}
|
||||
|
||||
urlRequest.httpBody = jsonData
|
||||
|
||||
return urlRequest
|
||||
}
|
||||
|
||||
public static func encodingParameters(jsonData: Data?) -> [String: Any]? {
|
||||
var returnedParams: [String: Any]?
|
||||
if let jsonData = jsonData, !jsonData.isEmpty {
|
||||
var params: [String: Any] = [:]
|
||||
params[jsonDataKey] = jsonData
|
||||
returnedParams = params
|
||||
}
|
||||
return returnedParams
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
//
|
||||
// JSONEncodingHelper.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class JSONEncodingHelper {
|
||||
|
||||
open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
|
||||
// Encode the Encodable object
|
||||
if let encodableObj = encodableObj {
|
||||
let encodeResult = CodableHelper.encode(encodableObj)
|
||||
do {
|
||||
let data = try encodeResult.get()
|
||||
params = JSONDataEncoding.encodingParameters(jsonData: data)
|
||||
} catch {
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
|
||||
if let encodableObj = encodableObj {
|
||||
do {
|
||||
let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted)
|
||||
params = JSONDataEncoding.encodingParameters(jsonData: data)
|
||||
} catch {
|
||||
print(error.localizedDescription)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
// Models.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol JSONEncodable {
|
||||
func encodeToJSON() -> Any
|
||||
}
|
||||
|
||||
public enum ErrorResponse: Error {
|
||||
case error(Int, Data?, URLResponse?, Error)
|
||||
}
|
||||
|
||||
public enum DownloadException: Error {
|
||||
case responseDataMissing
|
||||
case responseFailed
|
||||
case requestMissing
|
||||
case requestMissingPath
|
||||
case requestMissingURL
|
||||
}
|
||||
|
||||
public enum DecodableRequestBuilderError: Error {
|
||||
case emptyDataResponse
|
||||
case nilHTTPResponse
|
||||
case unsuccessfulHTTPStatusCode
|
||||
case jsonDecoding(DecodingError)
|
||||
case generalError(Error)
|
||||
}
|
||||
|
||||
open class Response<T> {
|
||||
public let statusCode: Int
|
||||
public let header: [String: String]
|
||||
public let body: T?
|
||||
|
||||
public init(statusCode: Int, header: [String: String], body: T?) {
|
||||
self.statusCode = statusCode
|
||||
self.header = header
|
||||
self.body = body
|
||||
}
|
||||
|
||||
public convenience init(response: HTTPURLResponse, body: T?) {
|
||||
let rawHeader = response.allHeaderFields
|
||||
var header = [String: String]()
|
||||
for (key, value) in rawHeader {
|
||||
if let key = key.base as? String, let value = value as? String {
|
||||
header[key] = value
|
||||
}
|
||||
}
|
||||
self.init(statusCode: response.statusCode, header: header, body: body)
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// AdditionalPropertiesClass.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class AdditionalPropertiesClass: Codable, Hashable {
|
||||
|
||||
public var mapString: [String: String]?
|
||||
public var mapMapString: [String: [String: String]]?
|
||||
|
||||
public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) {
|
||||
self.mapString = mapString
|
||||
self.mapMapString = mapMapString
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case mapString = "map_string"
|
||||
case mapMapString = "map_map_string"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(mapString, forKey: .mapString)
|
||||
try container.encodeIfPresent(mapMapString, forKey: .mapMapString)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: AdditionalPropertiesClass, rhs: AdditionalPropertiesClass) -> Bool {
|
||||
lhs.mapString == rhs.mapString &&
|
||||
lhs.mapMapString == rhs.mapMapString
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(mapString?.hashValue)
|
||||
hasher.combine(mapMapString?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// Animal.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Animal: Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
||||
public init(className: String, color: String? = "red") {
|
||||
self.className = className
|
||||
self.color = color
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case className
|
||||
case color
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(className, forKey: .className)
|
||||
try container.encodeIfPresent(color, forKey: .color)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Animal, rhs: Animal) -> Bool {
|
||||
lhs.className == rhs.className &&
|
||||
lhs.color == rhs.color
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(className.hashValue)
|
||||
hasher.combine(color?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//
|
||||
// AnimalFarm.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public typealias AnimalFarm = [Animal]
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// ApiResponse.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class ApiResponse: Codable, Hashable {
|
||||
|
||||
public var code: Int?
|
||||
public var type: String?
|
||||
public var message: String?
|
||||
|
||||
public init(code: Int? = nil, type: String? = nil, message: String? = nil) {
|
||||
self.code = code
|
||||
self.type = type
|
||||
self.message = message
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case code
|
||||
case type
|
||||
case message
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(code, forKey: .code)
|
||||
try container.encodeIfPresent(type, forKey: .type)
|
||||
try container.encodeIfPresent(message, forKey: .message)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ApiResponse, rhs: ApiResponse) -> Bool {
|
||||
lhs.code == rhs.code &&
|
||||
lhs.type == rhs.type &&
|
||||
lhs.message == rhs.message
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(code?.hashValue)
|
||||
hasher.combine(type?.hashValue)
|
||||
hasher.combine(message?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// ArrayOfArrayOfNumberOnly.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class ArrayOfArrayOfNumberOnly: Codable, Hashable {
|
||||
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
public init(arrayArrayNumber: [[Double]]? = nil) {
|
||||
self.arrayArrayNumber = arrayArrayNumber
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case arrayArrayNumber = "ArrayArrayNumber"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ArrayOfArrayOfNumberOnly, rhs: ArrayOfArrayOfNumberOnly) -> Bool {
|
||||
lhs.arrayArrayNumber == rhs.arrayArrayNumber
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(arrayArrayNumber?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// ArrayOfNumberOnly.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class ArrayOfNumberOnly: Codable, Hashable {
|
||||
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
public init(arrayNumber: [Double]? = nil) {
|
||||
self.arrayNumber = arrayNumber
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case arrayNumber = "ArrayNumber"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ArrayOfNumberOnly, rhs: ArrayOfNumberOnly) -> Bool {
|
||||
lhs.arrayNumber == rhs.arrayNumber
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(arrayNumber?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// ArrayTest.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class ArrayTest: Codable, Hashable {
|
||||
|
||||
public var arrayOfString: [String]?
|
||||
public var arrayArrayOfInteger: [[Int64]]?
|
||||
public var arrayArrayOfModel: [[ReadOnlyFirst]]?
|
||||
|
||||
public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) {
|
||||
self.arrayOfString = arrayOfString
|
||||
self.arrayArrayOfInteger = arrayArrayOfInteger
|
||||
self.arrayArrayOfModel = arrayArrayOfModel
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case arrayOfString = "array_of_string"
|
||||
case arrayArrayOfInteger = "array_array_of_integer"
|
||||
case arrayArrayOfModel = "array_array_of_model"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(arrayOfString, forKey: .arrayOfString)
|
||||
try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger)
|
||||
try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ArrayTest, rhs: ArrayTest) -> Bool {
|
||||
lhs.arrayOfString == rhs.arrayOfString &&
|
||||
lhs.arrayArrayOfInteger == rhs.arrayArrayOfInteger &&
|
||||
lhs.arrayArrayOfModel == rhs.arrayArrayOfModel
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(arrayOfString?.hashValue)
|
||||
hasher.combine(arrayArrayOfInteger?.hashValue)
|
||||
hasher.combine(arrayArrayOfModel?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
//
|
||||
// Capitalization.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Capitalization: Codable, Hashable {
|
||||
|
||||
public var smallCamel: String?
|
||||
public var capitalCamel: String?
|
||||
public var smallSnake: String?
|
||||
public var capitalSnake: String?
|
||||
public var sCAETHFlowPoints: String?
|
||||
/** Name of the pet */
|
||||
public var ATT_NAME: String?
|
||||
|
||||
public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) {
|
||||
self.smallCamel = smallCamel
|
||||
self.capitalCamel = capitalCamel
|
||||
self.smallSnake = smallSnake
|
||||
self.capitalSnake = capitalSnake
|
||||
self.sCAETHFlowPoints = sCAETHFlowPoints
|
||||
self.ATT_NAME = ATT_NAME
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case smallCamel
|
||||
case capitalCamel = "CapitalCamel"
|
||||
case smallSnake = "small_Snake"
|
||||
case capitalSnake = "Capital_Snake"
|
||||
case sCAETHFlowPoints = "SCA_ETH_Flow_Points"
|
||||
case ATT_NAME
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(smallCamel, forKey: .smallCamel)
|
||||
try container.encodeIfPresent(capitalCamel, forKey: .capitalCamel)
|
||||
try container.encodeIfPresent(smallSnake, forKey: .smallSnake)
|
||||
try container.encodeIfPresent(capitalSnake, forKey: .capitalSnake)
|
||||
try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints)
|
||||
try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Capitalization, rhs: Capitalization) -> Bool {
|
||||
lhs.smallCamel == rhs.smallCamel &&
|
||||
lhs.capitalCamel == rhs.capitalCamel &&
|
||||
lhs.smallSnake == rhs.smallSnake &&
|
||||
lhs.capitalSnake == rhs.capitalSnake &&
|
||||
lhs.sCAETHFlowPoints == rhs.sCAETHFlowPoints &&
|
||||
lhs.ATT_NAME == rhs.ATT_NAME
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(smallCamel?.hashValue)
|
||||
hasher.combine(capitalCamel?.hashValue)
|
||||
hasher.combine(smallSnake?.hashValue)
|
||||
hasher.combine(capitalSnake?.hashValue)
|
||||
hasher.combine(sCAETHFlowPoints?.hashValue)
|
||||
hasher.combine(ATT_NAME?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// Cat.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Cat: Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
public var declawed: Bool?
|
||||
|
||||
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
|
||||
self.className = className
|
||||
self.color = color
|
||||
self.declawed = declawed
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case className
|
||||
case color
|
||||
case declawed
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(className, forKey: .className)
|
||||
try container.encodeIfPresent(color, forKey: .color)
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Cat, rhs: Cat) -> Bool {
|
||||
lhs.className == rhs.className &&
|
||||
lhs.color == rhs.color &&
|
||||
lhs.declawed == rhs.declawed
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(className.hashValue)
|
||||
hasher.combine(color?.hashValue)
|
||||
hasher.combine(declawed?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// CatAllOf.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class CatAllOf: Codable, Hashable {
|
||||
|
||||
public var declawed: Bool?
|
||||
|
||||
public init(declawed: Bool? = nil) {
|
||||
self.declawed = declawed
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case declawed
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: CatAllOf, rhs: CatAllOf) -> Bool {
|
||||
lhs.declawed == rhs.declawed
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(declawed?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// Category.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Category: Codable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String? = "default-name"
|
||||
|
||||
public init(id: Int64? = nil, name: String? = "default-name") {
|
||||
self.id = id
|
||||
self.name = name
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case id
|
||||
case name
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(id, forKey: .id)
|
||||
try container.encode(name, forKey: .name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Category, rhs: Category) -> Bool {
|
||||
lhs.id == rhs.id &&
|
||||
lhs.name == rhs.name
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(id?.hashValue)
|
||||
hasher.combine(name.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// ClassModel.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/** Model for testing model with \"_class\" property */
|
||||
public struct ClassModel: Codable, Hashable {
|
||||
|
||||
public var `class`: String?
|
||||
|
||||
public init(`class`: String? = nil) {
|
||||
self.`class` = `class`
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case `class` = "_class"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// Client.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Client: Codable, Hashable {
|
||||
|
||||
public var client: String?
|
||||
|
||||
public init(client: String? = nil) {
|
||||
self.client = client
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case client
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(client, forKey: .client)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Client, rhs: Client) -> Bool {
|
||||
lhs.client == rhs.client
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(client?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// Dog.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Dog: Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
public var breed: String?
|
||||
|
||||
public init(className: String, color: String? = "red", breed: String? = nil) {
|
||||
self.className = className
|
||||
self.color = color
|
||||
self.breed = breed
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case className
|
||||
case color
|
||||
case breed
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(className, forKey: .className)
|
||||
try container.encodeIfPresent(color, forKey: .color)
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Dog, rhs: Dog) -> Bool {
|
||||
lhs.className == rhs.className &&
|
||||
lhs.color == rhs.color &&
|
||||
lhs.breed == rhs.breed
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(className.hashValue)
|
||||
hasher.combine(color?.hashValue)
|
||||
hasher.combine(breed?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// DogAllOf.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class DogAllOf: Codable, Hashable {
|
||||
|
||||
public var breed: String?
|
||||
|
||||
public init(breed: String? = nil) {
|
||||
self.breed = breed
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case breed
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: DogAllOf, rhs: DogAllOf) -> Bool {
|
||||
lhs.breed == rhs.breed
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(breed?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
//
|
||||
// EnumArrays.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class EnumArrays: Codable, Hashable {
|
||||
|
||||
public enum JustSymbol: String, Codable, CaseIterable {
|
||||
case greaterThanOrEqualTo = ">="
|
||||
case dollar = "$"
|
||||
}
|
||||
public enum ArrayEnum: String, Codable, CaseIterable {
|
||||
case fish = "fish"
|
||||
case crab = "crab"
|
||||
}
|
||||
public var justSymbol: JustSymbol?
|
||||
public var arrayEnum: [ArrayEnum]?
|
||||
|
||||
public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) {
|
||||
self.justSymbol = justSymbol
|
||||
self.arrayEnum = arrayEnum
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case justSymbol = "just_symbol"
|
||||
case arrayEnum = "array_enum"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(justSymbol, forKey: .justSymbol)
|
||||
try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: EnumArrays, rhs: EnumArrays) -> Bool {
|
||||
lhs.justSymbol == rhs.justSymbol &&
|
||||
lhs.arrayEnum == rhs.arrayEnum
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(justSymbol?.hashValue)
|
||||
hasher.combine(arrayEnum?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// EnumClass.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public enum EnumClass: String, Codable, CaseIterable {
|
||||
case abc = "_abc"
|
||||
case efg = "-efg"
|
||||
case xyz = "(xyz)"
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
//
|
||||
// EnumTest.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class EnumTest: Codable, Hashable {
|
||||
|
||||
public enum EnumString: String, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
case lower = "lower"
|
||||
case empty = ""
|
||||
}
|
||||
public enum EnumStringRequired: String, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
case lower = "lower"
|
||||
case empty = ""
|
||||
}
|
||||
public enum EnumInteger: Int, Codable, CaseIterable {
|
||||
case _1 = 1
|
||||
case number1 = -1
|
||||
}
|
||||
public enum EnumNumber: Double, Codable, CaseIterable {
|
||||
case _11 = 1.1
|
||||
case number12 = -1.2
|
||||
}
|
||||
public var enumString: EnumString?
|
||||
public var enumStringRequired: EnumStringRequired
|
||||
public var enumInteger: EnumInteger?
|
||||
public var enumNumber: EnumNumber?
|
||||
public var outerEnum: OuterEnum?
|
||||
|
||||
public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) {
|
||||
self.enumString = enumString
|
||||
self.enumStringRequired = enumStringRequired
|
||||
self.enumInteger = enumInteger
|
||||
self.enumNumber = enumNumber
|
||||
self.outerEnum = outerEnum
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case enumString = "enum_string"
|
||||
case enumStringRequired = "enum_string_required"
|
||||
case enumInteger = "enum_integer"
|
||||
case enumNumber = "enum_number"
|
||||
case outerEnum
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(enumString, forKey: .enumString)
|
||||
try container.encode(enumStringRequired, forKey: .enumStringRequired)
|
||||
try container.encodeIfPresent(enumInteger, forKey: .enumInteger)
|
||||
try container.encodeIfPresent(enumNumber, forKey: .enumNumber)
|
||||
try container.encodeIfPresent(outerEnum, forKey: .outerEnum)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: EnumTest, rhs: EnumTest) -> Bool {
|
||||
lhs.enumString == rhs.enumString &&
|
||||
lhs.enumStringRequired == rhs.enumStringRequired &&
|
||||
lhs.enumInteger == rhs.enumInteger &&
|
||||
lhs.enumNumber == rhs.enumNumber &&
|
||||
lhs.outerEnum == rhs.outerEnum
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(enumString?.hashValue)
|
||||
hasher.combine(enumStringRequired.hashValue)
|
||||
hasher.combine(enumInteger?.hashValue)
|
||||
hasher.combine(enumNumber?.hashValue)
|
||||
hasher.combine(outerEnum?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
//
|
||||
// File.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
/** Must be named `File` for test. */
|
||||
public final class File: Codable, Hashable {
|
||||
|
||||
/** Test capitalization */
|
||||
public var sourceURI: String?
|
||||
|
||||
public init(sourceURI: String? = nil) {
|
||||
self.sourceURI = sourceURI
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case sourceURI
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(sourceURI, forKey: .sourceURI)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: File, rhs: File) -> Bool {
|
||||
lhs.sourceURI == rhs.sourceURI
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(sourceURI?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// FileSchemaTestClass.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class FileSchemaTestClass: Codable, Hashable {
|
||||
|
||||
public var file: File?
|
||||
public var files: [File]?
|
||||
|
||||
public init(file: File? = nil, files: [File]? = nil) {
|
||||
self.file = file
|
||||
self.files = files
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case file
|
||||
case files
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(file, forKey: .file)
|
||||
try container.encodeIfPresent(files, forKey: .files)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: FileSchemaTestClass, rhs: FileSchemaTestClass) -> Bool {
|
||||
lhs.file == rhs.file &&
|
||||
lhs.files == rhs.files
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(file?.hashValue)
|
||||
hasher.combine(files?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
//
|
||||
// FormatTest.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class FormatTest: Codable, Hashable {
|
||||
|
||||
public var integer: Int?
|
||||
public var int32: Int?
|
||||
public var int64: Int64?
|
||||
public var number: Double
|
||||
public var float: Float?
|
||||
public var double: Double?
|
||||
public var string: String?
|
||||
public var byte: Data
|
||||
public var binary: URL?
|
||||
public var date: Date
|
||||
public var dateTime: Date?
|
||||
public var uuid: UUID?
|
||||
public var password: String
|
||||
|
||||
public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) {
|
||||
self.integer = integer
|
||||
self.int32 = int32
|
||||
self.int64 = int64
|
||||
self.number = number
|
||||
self.float = float
|
||||
self.double = double
|
||||
self.string = string
|
||||
self.byte = byte
|
||||
self.binary = binary
|
||||
self.date = date
|
||||
self.dateTime = dateTime
|
||||
self.uuid = uuid
|
||||
self.password = password
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case integer
|
||||
case int32
|
||||
case int64
|
||||
case number
|
||||
case float
|
||||
case double
|
||||
case string
|
||||
case byte
|
||||
case binary
|
||||
case date
|
||||
case dateTime
|
||||
case uuid
|
||||
case password
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(integer, forKey: .integer)
|
||||
try container.encodeIfPresent(int32, forKey: .int32)
|
||||
try container.encodeIfPresent(int64, forKey: .int64)
|
||||
try container.encode(number, forKey: .number)
|
||||
try container.encodeIfPresent(float, forKey: .float)
|
||||
try container.encodeIfPresent(double, forKey: .double)
|
||||
try container.encodeIfPresent(string, forKey: .string)
|
||||
try container.encode(byte, forKey: .byte)
|
||||
try container.encodeIfPresent(binary, forKey: .binary)
|
||||
try container.encode(date, forKey: .date)
|
||||
try container.encodeIfPresent(dateTime, forKey: .dateTime)
|
||||
try container.encodeIfPresent(uuid, forKey: .uuid)
|
||||
try container.encode(password, forKey: .password)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: FormatTest, rhs: FormatTest) -> Bool {
|
||||
lhs.integer == rhs.integer &&
|
||||
lhs.int32 == rhs.int32 &&
|
||||
lhs.int64 == rhs.int64 &&
|
||||
lhs.number == rhs.number &&
|
||||
lhs.float == rhs.float &&
|
||||
lhs.double == rhs.double &&
|
||||
lhs.string == rhs.string &&
|
||||
lhs.byte == rhs.byte &&
|
||||
lhs.binary == rhs.binary &&
|
||||
lhs.date == rhs.date &&
|
||||
lhs.dateTime == rhs.dateTime &&
|
||||
lhs.uuid == rhs.uuid &&
|
||||
lhs.password == rhs.password
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(integer?.hashValue)
|
||||
hasher.combine(int32?.hashValue)
|
||||
hasher.combine(int64?.hashValue)
|
||||
hasher.combine(number.hashValue)
|
||||
hasher.combine(float?.hashValue)
|
||||
hasher.combine(double?.hashValue)
|
||||
hasher.combine(string?.hashValue)
|
||||
hasher.combine(byte.hashValue)
|
||||
hasher.combine(binary?.hashValue)
|
||||
hasher.combine(date.hashValue)
|
||||
hasher.combine(dateTime?.hashValue)
|
||||
hasher.combine(uuid?.hashValue)
|
||||
hasher.combine(password.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// HasOnlyReadOnly.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class HasOnlyReadOnly: Codable, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var foo: String?
|
||||
|
||||
public init(bar: String? = nil, foo: String? = nil) {
|
||||
self.bar = bar
|
||||
self.foo = foo
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case bar
|
||||
case foo
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(bar, forKey: .bar)
|
||||
try container.encodeIfPresent(foo, forKey: .foo)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: HasOnlyReadOnly, rhs: HasOnlyReadOnly) -> Bool {
|
||||
lhs.bar == rhs.bar &&
|
||||
lhs.foo == rhs.foo
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(bar?.hashValue)
|
||||
hasher.combine(foo?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// List.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class List: Codable, Hashable {
|
||||
|
||||
public var _123list: String?
|
||||
|
||||
public init(_123list: String? = nil) {
|
||||
self._123list = _123list
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case _123list = "123-list"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(_123list, forKey: ._123list)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: List, rhs: List) -> Bool {
|
||||
lhs._123list == rhs._123list
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(_123list?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
//
|
||||
// MapTest.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class MapTest: Codable, Hashable {
|
||||
|
||||
public enum MapOfEnumString: String, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
case lower = "lower"
|
||||
}
|
||||
public var mapMapOfString: [String: [String: String]]?
|
||||
public var mapOfEnumString: [String: String]?
|
||||
public var directMap: [String: Bool]?
|
||||
public var indirectMap: StringBooleanMap?
|
||||
|
||||
public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) {
|
||||
self.mapMapOfString = mapMapOfString
|
||||
self.mapOfEnumString = mapOfEnumString
|
||||
self.directMap = directMap
|
||||
self.indirectMap = indirectMap
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case mapMapOfString = "map_map_of_string"
|
||||
case mapOfEnumString = "map_of_enum_string"
|
||||
case directMap = "direct_map"
|
||||
case indirectMap = "indirect_map"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(mapMapOfString, forKey: .mapMapOfString)
|
||||
try container.encodeIfPresent(mapOfEnumString, forKey: .mapOfEnumString)
|
||||
try container.encodeIfPresent(directMap, forKey: .directMap)
|
||||
try container.encodeIfPresent(indirectMap, forKey: .indirectMap)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: MapTest, rhs: MapTest) -> Bool {
|
||||
lhs.mapMapOfString == rhs.mapMapOfString &&
|
||||
lhs.mapOfEnumString == rhs.mapOfEnumString &&
|
||||
lhs.directMap == rhs.directMap &&
|
||||
lhs.indirectMap == rhs.indirectMap
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(mapMapOfString?.hashValue)
|
||||
hasher.combine(mapOfEnumString?.hashValue)
|
||||
hasher.combine(directMap?.hashValue)
|
||||
hasher.combine(indirectMap?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// MixedPropertiesAndAdditionalPropertiesClass.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable {
|
||||
|
||||
public var uuid: UUID?
|
||||
public var dateTime: Date?
|
||||
public var map: [String: Animal]?
|
||||
|
||||
public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) {
|
||||
self.uuid = uuid
|
||||
self.dateTime = dateTime
|
||||
self.map = map
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case uuid
|
||||
case dateTime
|
||||
case map
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(uuid, forKey: .uuid)
|
||||
try container.encodeIfPresent(dateTime, forKey: .dateTime)
|
||||
try container.encodeIfPresent(map, forKey: .map)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: MixedPropertiesAndAdditionalPropertiesClass, rhs: MixedPropertiesAndAdditionalPropertiesClass) -> Bool {
|
||||
lhs.uuid == rhs.uuid &&
|
||||
lhs.dateTime == rhs.dateTime &&
|
||||
lhs.map == rhs.map
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(uuid?.hashValue)
|
||||
hasher.combine(dateTime?.hashValue)
|
||||
hasher.combine(map?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
//
|
||||
// Model200Response.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/** Model for testing model name starting with number */
|
||||
public struct Model200Response: Codable, Hashable {
|
||||
|
||||
public var name: Int?
|
||||
public var `class`: String?
|
||||
|
||||
public init(name: Int? = nil, `class`: String? = nil) {
|
||||
self.name = name
|
||||
self.`class` = `class`
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case name
|
||||
case `class` = "class"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
//
|
||||
// Name.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
/** Model for testing model name same as property name */
|
||||
public final class Name: Codable, Hashable {
|
||||
|
||||
public var name: Int
|
||||
public var snakeCase: Int?
|
||||
public var property: String?
|
||||
public var _123number: Int?
|
||||
|
||||
public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) {
|
||||
self.name = name
|
||||
self.snakeCase = snakeCase
|
||||
self.property = property
|
||||
self._123number = _123number
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case name
|
||||
case snakeCase = "snake_case"
|
||||
case property
|
||||
case _123number = "123Number"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(name, forKey: .name)
|
||||
try container.encodeIfPresent(snakeCase, forKey: .snakeCase)
|
||||
try container.encodeIfPresent(property, forKey: .property)
|
||||
try container.encodeIfPresent(_123number, forKey: ._123number)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Name, rhs: Name) -> Bool {
|
||||
lhs.name == rhs.name &&
|
||||
lhs.snakeCase == rhs.snakeCase &&
|
||||
lhs.property == rhs.property &&
|
||||
lhs._123number == rhs._123number
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(name.hashValue)
|
||||
hasher.combine(snakeCase?.hashValue)
|
||||
hasher.combine(property?.hashValue)
|
||||
hasher.combine(_123number?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// NumberOnly.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class NumberOnly: Codable, Hashable {
|
||||
|
||||
public var justNumber: Double?
|
||||
|
||||
public init(justNumber: Double? = nil) {
|
||||
self.justNumber = justNumber
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case justNumber = "JustNumber"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(justNumber, forKey: .justNumber)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: NumberOnly, rhs: NumberOnly) -> Bool {
|
||||
lhs.justNumber == rhs.justNumber
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(justNumber?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
//
|
||||
// Order.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Order: Codable, Hashable {
|
||||
|
||||
public enum Status: String, Codable, CaseIterable {
|
||||
case placed = "placed"
|
||||
case approved = "approved"
|
||||
case delivered = "delivered"
|
||||
}
|
||||
public var id: Int64?
|
||||
public var petId: Int64?
|
||||
public var quantity: Int?
|
||||
public var shipDate: Date?
|
||||
/** Order Status */
|
||||
public var status: Status?
|
||||
public var complete: Bool? = false
|
||||
|
||||
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
|
||||
self.id = id
|
||||
self.petId = petId
|
||||
self.quantity = quantity
|
||||
self.shipDate = shipDate
|
||||
self.status = status
|
||||
self.complete = complete
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case id
|
||||
case petId
|
||||
case quantity
|
||||
case shipDate
|
||||
case status
|
||||
case complete
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(id, forKey: .id)
|
||||
try container.encodeIfPresent(petId, forKey: .petId)
|
||||
try container.encodeIfPresent(quantity, forKey: .quantity)
|
||||
try container.encodeIfPresent(shipDate, forKey: .shipDate)
|
||||
try container.encodeIfPresent(status, forKey: .status)
|
||||
try container.encodeIfPresent(complete, forKey: .complete)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Order, rhs: Order) -> Bool {
|
||||
lhs.id == rhs.id &&
|
||||
lhs.petId == rhs.petId &&
|
||||
lhs.quantity == rhs.quantity &&
|
||||
lhs.shipDate == rhs.shipDate &&
|
||||
lhs.status == rhs.status &&
|
||||
lhs.complete == rhs.complete
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(id?.hashValue)
|
||||
hasher.combine(petId?.hashValue)
|
||||
hasher.combine(quantity?.hashValue)
|
||||
hasher.combine(shipDate?.hashValue)
|
||||
hasher.combine(status?.hashValue)
|
||||
hasher.combine(complete?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// OuterComposite.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class OuterComposite: Codable, Hashable {
|
||||
|
||||
public var myNumber: Double?
|
||||
public var myString: String?
|
||||
public var myBoolean: Bool?
|
||||
|
||||
public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) {
|
||||
self.myNumber = myNumber
|
||||
self.myString = myString
|
||||
self.myBoolean = myBoolean
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case myNumber = "my_number"
|
||||
case myString = "my_string"
|
||||
case myBoolean = "my_boolean"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(myNumber, forKey: .myNumber)
|
||||
try container.encodeIfPresent(myString, forKey: .myString)
|
||||
try container.encodeIfPresent(myBoolean, forKey: .myBoolean)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: OuterComposite, rhs: OuterComposite) -> Bool {
|
||||
lhs.myNumber == rhs.myNumber &&
|
||||
lhs.myString == rhs.myString &&
|
||||
lhs.myBoolean == rhs.myBoolean
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(myNumber?.hashValue)
|
||||
hasher.combine(myString?.hashValue)
|
||||
hasher.combine(myBoolean?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// OuterEnum.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public enum OuterEnum: String, Codable, CaseIterable {
|
||||
case placed = "placed"
|
||||
case approved = "approved"
|
||||
case delivered = "delivered"
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
//
|
||||
// Pet.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Pet: Codable, Hashable {
|
||||
|
||||
public enum Status: String, Codable, CaseIterable {
|
||||
case available = "available"
|
||||
case pending = "pending"
|
||||
case sold = "sold"
|
||||
}
|
||||
public var id: Int64?
|
||||
public var category: Category?
|
||||
public var name: String
|
||||
public var photoUrls: [String]
|
||||
public var tags: [Tag]?
|
||||
/** pet status in the store */
|
||||
public var status: Status?
|
||||
|
||||
public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) {
|
||||
self.id = id
|
||||
self.category = category
|
||||
self.name = name
|
||||
self.photoUrls = photoUrls
|
||||
self.tags = tags
|
||||
self.status = status
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case id
|
||||
case category
|
||||
case name
|
||||
case photoUrls
|
||||
case tags
|
||||
case status
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(id, forKey: .id)
|
||||
try container.encodeIfPresent(category, forKey: .category)
|
||||
try container.encode(name, forKey: .name)
|
||||
try container.encode(photoUrls, forKey: .photoUrls)
|
||||
try container.encodeIfPresent(tags, forKey: .tags)
|
||||
try container.encodeIfPresent(status, forKey: .status)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Pet, rhs: Pet) -> Bool {
|
||||
lhs.id == rhs.id &&
|
||||
lhs.category == rhs.category &&
|
||||
lhs.name == rhs.name &&
|
||||
lhs.photoUrls == rhs.photoUrls &&
|
||||
lhs.tags == rhs.tags &&
|
||||
lhs.status == rhs.status
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(id?.hashValue)
|
||||
hasher.combine(category?.hashValue)
|
||||
hasher.combine(name.hashValue)
|
||||
hasher.combine(photoUrls.hashValue)
|
||||
hasher.combine(tags?.hashValue)
|
||||
hasher.combine(status?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// ReadOnlyFirst.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class ReadOnlyFirst: Codable, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var baz: String?
|
||||
|
||||
public init(bar: String? = nil, baz: String? = nil) {
|
||||
self.bar = bar
|
||||
self.baz = baz
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case bar
|
||||
case baz
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(bar, forKey: .bar)
|
||||
try container.encodeIfPresent(baz, forKey: .baz)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ReadOnlyFirst, rhs: ReadOnlyFirst) -> Bool {
|
||||
lhs.bar == rhs.bar &&
|
||||
lhs.baz == rhs.baz
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(bar?.hashValue)
|
||||
hasher.combine(baz?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// Return.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/** Model for testing reserved words */
|
||||
public struct Return: Codable, Hashable {
|
||||
|
||||
public var `return`: Int?
|
||||
|
||||
public init(`return`: Int? = nil) {
|
||||
self.`return` = `return`
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case `return` = "return"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// SpecialModelName.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class SpecialModelName: Codable, Hashable {
|
||||
|
||||
public var specialPropertyName: Int64?
|
||||
|
||||
public init(specialPropertyName: Int64? = nil) {
|
||||
self.specialPropertyName = specialPropertyName
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case specialPropertyName = "$special[property.name]"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: SpecialModelName, rhs: SpecialModelName) -> Bool {
|
||||
lhs.specialPropertyName == rhs.specialPropertyName
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(specialPropertyName?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// StringBooleanMap.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class StringBooleanMap: Codable, Hashable {
|
||||
|
||||
public enum CodingKeys: CodingKey, CaseIterable {
|
||||
}
|
||||
public var additionalProperties: [String: Bool] = [:]
|
||||
|
||||
public subscript(key: String) -> Bool? {
|
||||
get {
|
||||
if let value = additionalProperties[key] {
|
||||
return value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
set {
|
||||
additionalProperties[key] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
var additionalPropertiesContainer = encoder.container(keyedBy: String.self)
|
||||
try additionalPropertiesContainer.encodeMap(additionalProperties)
|
||||
}
|
||||
|
||||
// Decodable protocol methods
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: String.self)
|
||||
|
||||
var nonAdditionalPropertyKeys = Set<String>()
|
||||
additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys)
|
||||
}
|
||||
|
||||
|
||||
public static func == (lhs: StringBooleanMap, rhs: StringBooleanMap) -> Bool {
|
||||
lhs.additionalProperties == rhs.additionalProperties
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(additionalProperties.hashValue)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// Tag.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class Tag: Codable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String?
|
||||
|
||||
public init(id: Int64? = nil, name: String? = nil) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case id
|
||||
case name
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(id, forKey: .id)
|
||||
try container.encodeIfPresent(name, forKey: .name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Tag, rhs: Tag) -> Bool {
|
||||
lhs.id == rhs.id &&
|
||||
lhs.name == rhs.name
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(id?.hashValue)
|
||||
hasher.combine(name?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
//
|
||||
// TypeHolderDefault.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class TypeHolderDefault: Codable, Hashable {
|
||||
|
||||
public var stringItem: String = "what"
|
||||
public var numberItem: Double
|
||||
public var integerItem: Int
|
||||
public var boolItem: Bool = true
|
||||
public var arrayItem: [Int]
|
||||
|
||||
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
|
||||
self.stringItem = stringItem
|
||||
self.numberItem = numberItem
|
||||
self.integerItem = integerItem
|
||||
self.boolItem = boolItem
|
||||
self.arrayItem = arrayItem
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case stringItem = "string_item"
|
||||
case numberItem = "number_item"
|
||||
case integerItem = "integer_item"
|
||||
case boolItem = "bool_item"
|
||||
case arrayItem = "array_item"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(stringItem, forKey: .stringItem)
|
||||
try container.encode(numberItem, forKey: .numberItem)
|
||||
try container.encode(integerItem, forKey: .integerItem)
|
||||
try container.encode(boolItem, forKey: .boolItem)
|
||||
try container.encode(arrayItem, forKey: .arrayItem)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: TypeHolderDefault, rhs: TypeHolderDefault) -> Bool {
|
||||
lhs.stringItem == rhs.stringItem &&
|
||||
lhs.numberItem == rhs.numberItem &&
|
||||
lhs.integerItem == rhs.integerItem &&
|
||||
lhs.boolItem == rhs.boolItem &&
|
||||
lhs.arrayItem == rhs.arrayItem
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(stringItem.hashValue)
|
||||
hasher.combine(numberItem.hashValue)
|
||||
hasher.combine(integerItem.hashValue)
|
||||
hasher.combine(boolItem.hashValue)
|
||||
hasher.combine(arrayItem.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
//
|
||||
// TypeHolderExample.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class TypeHolderExample: Codable, Hashable {
|
||||
|
||||
public var stringItem: String
|
||||
public var numberItem: Double
|
||||
public var integerItem: Int
|
||||
public var boolItem: Bool
|
||||
public var arrayItem: [Int]
|
||||
|
||||
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
|
||||
self.stringItem = stringItem
|
||||
self.numberItem = numberItem
|
||||
self.integerItem = integerItem
|
||||
self.boolItem = boolItem
|
||||
self.arrayItem = arrayItem
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case stringItem = "string_item"
|
||||
case numberItem = "number_item"
|
||||
case integerItem = "integer_item"
|
||||
case boolItem = "bool_item"
|
||||
case arrayItem = "array_item"
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(stringItem, forKey: .stringItem)
|
||||
try container.encode(numberItem, forKey: .numberItem)
|
||||
try container.encode(integerItem, forKey: .integerItem)
|
||||
try container.encode(boolItem, forKey: .boolItem)
|
||||
try container.encode(arrayItem, forKey: .arrayItem)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: TypeHolderExample, rhs: TypeHolderExample) -> Bool {
|
||||
lhs.stringItem == rhs.stringItem &&
|
||||
lhs.numberItem == rhs.numberItem &&
|
||||
lhs.integerItem == rhs.integerItem &&
|
||||
lhs.boolItem == rhs.boolItem &&
|
||||
lhs.arrayItem == rhs.arrayItem
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(stringItem.hashValue)
|
||||
hasher.combine(numberItem.hashValue)
|
||||
hasher.combine(integerItem.hashValue)
|
||||
hasher.combine(boolItem.hashValue)
|
||||
hasher.combine(arrayItem.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
//
|
||||
// User.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AnyCodable
|
||||
|
||||
public final class User: Codable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var username: String?
|
||||
public var firstName: String?
|
||||
public var lastName: String?
|
||||
public var email: String?
|
||||
public var password: String?
|
||||
public var phone: String?
|
||||
/** User Status */
|
||||
public var userStatus: Int?
|
||||
|
||||
public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) {
|
||||
self.id = id
|
||||
self.username = username
|
||||
self.firstName = firstName
|
||||
self.lastName = lastName
|
||||
self.email = email
|
||||
self.password = password
|
||||
self.phone = phone
|
||||
self.userStatus = userStatus
|
||||
}
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case id
|
||||
case username
|
||||
case firstName
|
||||
case lastName
|
||||
case email
|
||||
case password
|
||||
case phone
|
||||
case userStatus
|
||||
}
|
||||
|
||||
// Encodable protocol methods
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encodeIfPresent(id, forKey: .id)
|
||||
try container.encodeIfPresent(username, forKey: .username)
|
||||
try container.encodeIfPresent(firstName, forKey: .firstName)
|
||||
try container.encodeIfPresent(lastName, forKey: .lastName)
|
||||
try container.encodeIfPresent(email, forKey: .email)
|
||||
try container.encodeIfPresent(password, forKey: .password)
|
||||
try container.encodeIfPresent(phone, forKey: .phone)
|
||||
try container.encodeIfPresent(userStatus, forKey: .userStatus)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: User, rhs: User) -> Bool {
|
||||
lhs.id == rhs.id &&
|
||||
lhs.username == rhs.username &&
|
||||
lhs.firstName == rhs.firstName &&
|
||||
lhs.lastName == rhs.lastName &&
|
||||
lhs.email == rhs.email &&
|
||||
lhs.password == rhs.password &&
|
||||
lhs.phone == rhs.phone &&
|
||||
lhs.userStatus == rhs.userStatus
|
||||
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(id?.hashValue)
|
||||
hasher.combine(username?.hashValue)
|
||||
hasher.combine(firstName?.hashValue)
|
||||
hasher.combine(lastName?.hashValue)
|
||||
hasher.combine(email?.hashValue)
|
||||
hasher.combine(password?.hashValue)
|
||||
hasher.combine(phone?.hashValue)
|
||||
hasher.combine(userStatus?.hashValue)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
//
|
||||
// OpenISO8601DateFormatter.swift
|
||||
//
|
||||
// Generated by openapi-generator
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// https://stackoverflow.com/a/50281094/976628
|
||||
public class OpenISO8601DateFormatter: DateFormatter {
|
||||
static let withoutSeconds: DateFormatter = {
|
||||
let formatter = DateFormatter()
|
||||
formatter.calendar = Calendar(identifier: .iso8601)
|
||||
formatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
formatter.timeZone = TimeZone(secondsFromGMT: 0)
|
||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
|
||||
return formatter
|
||||
}()
|
||||
|
||||
private func setup() {
|
||||
calendar = Calendar(identifier: .iso8601)
|
||||
locale = Locale(identifier: "en_US_POSIX")
|
||||
timeZone = TimeZone(secondsFromGMT: 0)
|
||||
dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
|
||||
}
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
setup()
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
setup()
|
||||
}
|
||||
|
||||
override public func date(from string: String) -> Date? {
|
||||
if let result = super.date(from: string) {
|
||||
return result
|
||||
}
|
||||
return OpenISO8601DateFormatter.withoutSeconds.date(from: string)
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,13 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
open class PetstoreClientAPI {
|
||||
@available(*, deprecated, renamed: "PetstoreClient")
|
||||
public typealias PetstoreClientAPI = PetstoreClient
|
||||
|
||||
open class PetstoreClient {
|
||||
public static var basePath = "http://petstore.swagger.io:80/v2"
|
||||
public static var credential: URLCredential?
|
||||
public static var customHeaders: [String: String] = [:]
|
||||
public static var credential: URLCredential?
|
||||
public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory()
|
||||
public static var apiResponseQueue: DispatchQueue = .main
|
||||
}
|
||||
@@ -32,7 +35,7 @@ open class RequestBuilder<T> {
|
||||
self.parameters = parameters
|
||||
self.headers = headers
|
||||
|
||||
addHeaders(PetstoreClientAPI.customHeaders)
|
||||
addHeaders(PetstoreClient.customHeaders)
|
||||
}
|
||||
|
||||
open func addHeaders(_ aHeaders: [String: String]) {
|
||||
@@ -41,7 +44,7 @@ open class RequestBuilder<T> {
|
||||
}
|
||||
}
|
||||
|
||||
open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) { }
|
||||
open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) { }
|
||||
|
||||
public func addHeader(name: String, value: String) -> Self {
|
||||
if !value.isEmpty {
|
||||
@@ -51,7 +54,7 @@ open class RequestBuilder<T> {
|
||||
}
|
||||
|
||||
open func addCredential() -> Self {
|
||||
credential = PetstoreClientAPI.credential
|
||||
credential = PetstoreClient.credential
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
|
||||
open class AnotherFakeAPI {
|
||||
|
||||
/**
|
||||
To test special tags
|
||||
|
||||
@@ -15,7 +22,7 @@ open class AnotherFakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -34,21 +41,21 @@ open class AnotherFakeAPI {
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/another-fake/dummy"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/another-fake/dummy"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Client>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,22 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
|
||||
open class FakeAPI {
|
||||
|
||||
/**
|
||||
|
||||
- parameter body: (body) Input boolean as post body (optional)
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) {
|
||||
open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) {
|
||||
fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -32,21 +39,21 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Bool>
|
||||
*/
|
||||
open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder<Bool> {
|
||||
let path = "/fake/outer/boolean"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake/outer/boolean"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Bool>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Bool>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,7 +62,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) {
|
||||
open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) {
|
||||
fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -73,21 +80,21 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<OuterComposite>
|
||||
*/
|
||||
open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder<OuterComposite> {
|
||||
let path = "/fake/outer/composite"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake/outer/composite"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<OuterComposite>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<OuterComposite>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +103,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) {
|
||||
open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) {
|
||||
fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -114,21 +121,21 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Double>
|
||||
*/
|
||||
open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder<Double> {
|
||||
let path = "/fake/outer/number"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake/outer/number"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Double>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Double>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +144,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) {
|
||||
open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) {
|
||||
fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -155,21 +162,21 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<String>
|
||||
*/
|
||||
open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder<String> {
|
||||
let path = "/fake/outer/string"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake/outer/string"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<String>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<String>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +185,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -196,21 +203,21 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder<Void> {
|
||||
let path = "/fake/body-with-file-schema"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake/body-with-file-schema"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,7 +227,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -238,24 +245,24 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder<Void> {
|
||||
let path = "/fake/body-with-query-params"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake/body-with-query-params"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"query": query.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,7 +272,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -284,21 +291,21 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Client>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,7 +328,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -356,9 +363,9 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"integer": integer?.encodeToJSON(),
|
||||
"int32": int32?.encodeToJSON(),
|
||||
"int64": int64?.encodeToJSON(),
|
||||
@@ -375,20 +382,20 @@ open class FakeAPI {
|
||||
"callback": callback?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -472,7 +479,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -498,35 +505,35 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder<Void> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"enum_form_string_array": enumFormStringArray?.encodeToJSON(),
|
||||
"enum_form_string": enumFormString?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters)
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"enum_query_string_array": enumQueryStringArray?.encodeToJSON(),
|
||||
"enum_query_string": enumQueryString?.encodeToJSON(),
|
||||
"enum_query_integer": enumQueryInteger?.encodeToJSON(),
|
||||
"enum_query_double": enumQueryDouble?.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"enum_header_string_array": enumHeaderStringArray?.encodeToJSON(),
|
||||
"enum_header_string": enumHeaderString?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -541,7 +548,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -565,28 +572,28 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder<Void> {
|
||||
let path = "/fake"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"required_string_group": requiredStringGroup.encodeToJSON(),
|
||||
"required_int64_group": requiredInt64Group.encodeToJSON(),
|
||||
"string_group": stringGroup?.encodeToJSON(),
|
||||
"int64_group": int64Group?.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"required_boolean_group": requiredBooleanGroup.encodeToJSON(),
|
||||
"boolean_group": booleanGroup?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -596,7 +603,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -614,21 +621,21 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder<Void> {
|
||||
let path = "/fake/inline-additionalProperties"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param)
|
||||
let localVariablePath = "/fake/inline-additionalProperties"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -639,7 +646,7 @@ open class FakeAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -658,27 +665,27 @@ open class FakeAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder<Void> {
|
||||
let path = "/fake/jsonFormData"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
let localVariablePath = "/fake/jsonFormData"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"param": param.encodeToJSON(),
|
||||
"param2": param2.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
|
||||
open class FakeClassnameTags123API {
|
||||
|
||||
/**
|
||||
To test class name in snake case
|
||||
|
||||
@@ -15,7 +22,7 @@ open class FakeClassnameTags123API {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) {
|
||||
testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -37,21 +44,21 @@ open class FakeClassnameTags123API {
|
||||
- returns: RequestBuilder<Client>
|
||||
*/
|
||||
open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
|
||||
let path = "/fake_classname_test"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/fake_classname_test"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Client>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
|
||||
open class PetAPI {
|
||||
|
||||
/**
|
||||
Add a new pet to the store
|
||||
|
||||
@@ -15,7 +22,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -36,21 +43,21 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder<Void> {
|
||||
let path = "/pet"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/pet"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +68,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -83,24 +90,24 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder<Void> {
|
||||
var path = "/pet/{petId}"
|
||||
var localVariablePath = "/pet/{petId}"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"api_key": apiKey?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +126,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) {
|
||||
open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) {
|
||||
findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -141,24 +148,24 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<[Pet]>
|
||||
*/
|
||||
open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> {
|
||||
let path = "/pet/findByStatus"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
let localVariablePath = "/pet/findByStatus"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"status": status.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,7 +176,7 @@ open class PetAPI {
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
@available(*, deprecated, message: "This operation is deprecated.")
|
||||
open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) {
|
||||
open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) {
|
||||
findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -192,24 +199,24 @@ open class PetAPI {
|
||||
*/
|
||||
@available(*, deprecated, message: "This operation is deprecated.")
|
||||
open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> {
|
||||
let path = "/pet/findByTags"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
let localVariablePath = "/pet/findByTags"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"tags": tags.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,7 +226,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) {
|
||||
open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) {
|
||||
getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -241,24 +248,24 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<Pet>
|
||||
*/
|
||||
open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder<Pet> {
|
||||
var path = "/pet/{petId}"
|
||||
var localVariablePath = "/pet/{petId}"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Pet>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Pet>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,7 +275,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -289,21 +296,21 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder<Void> {
|
||||
let path = "/pet"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/pet"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,7 +322,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -338,30 +345,30 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder<Void> {
|
||||
var path = "/pet/{petId}"
|
||||
var localVariablePath = "/pet/{petId}"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"name": name?.encodeToJSON(),
|
||||
"status": status?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -373,7 +380,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) {
|
||||
open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) {
|
||||
uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -396,30 +403,30 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<ApiResponse>
|
||||
*/
|
||||
open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder<ApiResponse> {
|
||||
var path = "/pet/{petId}/uploadImage"
|
||||
var localVariablePath = "/pet/{petId}/uploadImage"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(),
|
||||
"file": file?.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<ApiResponse>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<ApiResponse>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,7 +438,7 @@ open class PetAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) {
|
||||
open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) {
|
||||
uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -454,30 +461,30 @@ open class PetAPI {
|
||||
- returns: RequestBuilder<ApiResponse>
|
||||
*/
|
||||
open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder<ApiResponse> {
|
||||
var path = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))"
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let formParams: [String: Any?] = [
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(),
|
||||
"requiredFile": requiredFile.encodeToJSON(),
|
||||
]
|
||||
|
||||
let nonNullParameters = APIHelper.rejectNil(formParams)
|
||||
let parameters = APIHelper.convertBoolToString(nonNullParameters)
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<ApiResponse>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<ApiResponse>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
|
||||
open class StoreAPI {
|
||||
|
||||
/**
|
||||
Delete purchase order by ID
|
||||
|
||||
@@ -15,7 +22,7 @@ open class StoreAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -34,24 +41,24 @@ open class StoreAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder<Void> {
|
||||
var path = "/store/order/{order_id}"
|
||||
var localVariablePath = "/store/order/{order_id}"
|
||||
let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))"
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +67,7 @@ open class StoreAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) {
|
||||
open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) {
|
||||
getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -81,21 +88,21 @@ open class StoreAPI {
|
||||
- returns: RequestBuilder<[String: Int]>
|
||||
*/
|
||||
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> {
|
||||
let path = "/store/inventory"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
let localVariablePath = "/store/inventory"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +112,7 @@ open class StoreAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) {
|
||||
open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) {
|
||||
getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -124,24 +131,24 @@ open class StoreAPI {
|
||||
- returns: RequestBuilder<Order>
|
||||
*/
|
||||
open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder<Order> {
|
||||
var path = "/store/order/{order_id}"
|
||||
var localVariablePath = "/store/order/{order_id}"
|
||||
let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))"
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Order>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Order>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,7 +158,7 @@ open class StoreAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) {
|
||||
open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) {
|
||||
placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -169,21 +176,21 @@ open class StoreAPI {
|
||||
- returns: RequestBuilder<Order>
|
||||
*/
|
||||
open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder<Order> {
|
||||
let path = "/store/order"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/store/order"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Order>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Order>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
|
||||
open class UserAPI {
|
||||
|
||||
/**
|
||||
Create user
|
||||
|
||||
@@ -15,7 +22,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -34,21 +41,21 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func createUserWithRequestBuilder(body: User) -> RequestBuilder<Void> {
|
||||
let path = "/user"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/user"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +65,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -76,21 +83,21 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder<Void> {
|
||||
let path = "/user/createWithArray"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/user/createWithArray"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,7 +107,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -118,21 +125,21 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder<Void> {
|
||||
let path = "/user/createWithList"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
let localVariablePath = "/user/createWithList"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +149,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -161,24 +168,24 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder<Void> {
|
||||
var path = "/user/{username}"
|
||||
var localVariablePath = "/user/{username}"
|
||||
let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))"
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "DELETE", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,7 +195,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) {
|
||||
open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) {
|
||||
getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -206,24 +213,24 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<User>
|
||||
*/
|
||||
open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder<User> {
|
||||
var path = "/user/{username}"
|
||||
var localVariablePath = "/user/{username}"
|
||||
let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))"
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<User>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<User>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,7 +241,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) {
|
||||
open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) {
|
||||
loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
@@ -254,25 +261,25 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<String>
|
||||
*/
|
||||
open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder<String> {
|
||||
let path = "/user/login"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
let localVariablePath = "/user/login"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
var urlComponents = URLComponents(string: URLString)
|
||||
urlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"username": username.encodeToJSON(),
|
||||
"password": password.encodeToJSON(),
|
||||
])
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<String>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<String>.Type = PetstoreClient.requestBuilderFactory.getBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,7 +288,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -298,21 +305,21 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func logoutUserWithRequestBuilder() -> RequestBuilder<Void> {
|
||||
let path = "/user/logout"
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters: [String: Any]? = nil
|
||||
let localVariablePath = "/user/logout"
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,7 +330,7 @@ open class UserAPI {
|
||||
- parameter apiResponseQueue: The queue on which api response is dispatched.
|
||||
- parameter completion: completion handler to receive the data and the error objects
|
||||
*/
|
||||
open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) {
|
||||
updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -343,24 +350,24 @@ open class UserAPI {
|
||||
- returns: RequestBuilder<Void>
|
||||
*/
|
||||
open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder<Void> {
|
||||
var path = "/user/{username}"
|
||||
var localVariablePath = "/user/{username}"
|
||||
let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))"
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let URLString = PetstoreClientAPI.basePath + path
|
||||
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = PetstoreClient.basePath + localVariablePath
|
||||
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
|
||||
|
||||
let urlComponents = URLComponents(string: URLString)
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let nillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
:
|
||||
]
|
||||
|
||||
let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
|
||||
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
|
||||
let localVariableRequestBuilder: RequestBuilder<Void>.Type = PetstoreClient.requestBuilderFactory.getNonDecodableBuilder()
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,16 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Configuration")
|
||||
public typealias Configuration = PetstoreClient.Configuration
|
||||
|
||||
extension PetstoreClient {
|
||||
open 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"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
extension Bool: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self as Any }
|
||||
@@ -184,44 +186,3 @@ extension HTTPURLResponse {
|
||||
return Array(200 ..< 300).contains(statusCode)
|
||||
}
|
||||
}
|
||||
|
||||
extension AnyCodable: Hashable {
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
switch value {
|
||||
case let value as Bool:
|
||||
hasher.combine(value)
|
||||
case let value as Int:
|
||||
hasher.combine(value)
|
||||
case let value as Int8:
|
||||
hasher.combine(value)
|
||||
case let value as Int16:
|
||||
hasher.combine(value)
|
||||
case let value as Int32:
|
||||
hasher.combine(value)
|
||||
case let value as Int64:
|
||||
hasher.combine(value)
|
||||
case let value as UInt:
|
||||
hasher.combine(value)
|
||||
case let value as UInt8:
|
||||
hasher.combine(value)
|
||||
case let value as UInt16:
|
||||
hasher.combine(value)
|
||||
case let value as UInt32:
|
||||
hasher.combine(value)
|
||||
case let value as UInt64:
|
||||
hasher.combine(value)
|
||||
case let value as Float:
|
||||
hasher.combine(value)
|
||||
case let value as Double:
|
||||
hasher.combine(value)
|
||||
case let value as String:
|
||||
hasher.combine(value)
|
||||
case let value as [String: AnyCodable]:
|
||||
hasher.combine(value)
|
||||
case let value as [AnyCodable]:
|
||||
hasher.combine(value)
|
||||
default:
|
||||
hasher.combine(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.AdditionalPropertiesClass")
|
||||
public typealias AdditionalPropertiesClass = PetstoreClient.AdditionalPropertiesClass
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class AdditionalPropertiesClass: Codable, Hashable {
|
||||
|
||||
@@ -17,6 +24,7 @@ public final class AdditionalPropertiesClass: Codable, Hashable {
|
||||
self.mapString = mapString
|
||||
self.mapMapString = mapMapString
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case mapString = "map_string"
|
||||
case mapMapString = "map_map_string"
|
||||
@@ -30,8 +38,6 @@ public final class AdditionalPropertiesClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(mapMapString, forKey: .mapMapString)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: AdditionalPropertiesClass, rhs: AdditionalPropertiesClass) -> Bool {
|
||||
lhs.mapString == rhs.mapString &&
|
||||
lhs.mapMapString == rhs.mapMapString
|
||||
@@ -43,5 +49,6 @@ public final class AdditionalPropertiesClass: Codable, Hashable {
|
||||
hasher.combine(mapMapString?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Animal")
|
||||
public typealias Animal = PetstoreClient.Animal
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class Animal: Codable, Hashable {
|
||||
|
||||
@@ -17,6 +24,7 @@ public final class Animal: Codable, Hashable {
|
||||
self.className = className
|
||||
self.color = color
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case className
|
||||
case color
|
||||
@@ -30,8 +38,6 @@ public final class Animal: Codable, Hashable {
|
||||
try container.encodeIfPresent(color, forKey: .color)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Animal, rhs: Animal) -> Bool {
|
||||
lhs.className == rhs.className &&
|
||||
lhs.color == rhs.color
|
||||
@@ -43,5 +49,6 @@ public final class Animal: Codable, Hashable {
|
||||
hasher.combine(color?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.AnimalFarm")
|
||||
public typealias AnimalFarm = PetstoreClient.AnimalFarm
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public typealias AnimalFarm = [Animal]
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.ApiResponse")
|
||||
public typealias ApiResponse = PetstoreClient.ApiResponse
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class ApiResponse: Codable, Hashable {
|
||||
|
||||
@@ -19,6 +26,7 @@ public final class ApiResponse: Codable, Hashable {
|
||||
self.type = type
|
||||
self.message = message
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case code
|
||||
case type
|
||||
@@ -34,8 +42,6 @@ public final class ApiResponse: Codable, Hashable {
|
||||
try container.encodeIfPresent(message, forKey: .message)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ApiResponse, rhs: ApiResponse) -> Bool {
|
||||
lhs.code == rhs.code &&
|
||||
lhs.type == rhs.type &&
|
||||
@@ -49,5 +55,6 @@ public final class ApiResponse: Codable, Hashable {
|
||||
hasher.combine(message?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.ArrayOfArrayOfNumberOnly")
|
||||
public typealias ArrayOfArrayOfNumberOnly = PetstoreClient.ArrayOfArrayOfNumberOnly
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class ArrayOfArrayOfNumberOnly: Codable, Hashable {
|
||||
|
||||
@@ -15,6 +22,7 @@ public final class ArrayOfArrayOfNumberOnly: Codable, Hashable {
|
||||
public init(arrayArrayNumber: [[Double]]? = nil) {
|
||||
self.arrayArrayNumber = arrayArrayNumber
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case arrayArrayNumber = "ArrayArrayNumber"
|
||||
}
|
||||
@@ -26,8 +34,6 @@ public final class ArrayOfArrayOfNumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ArrayOfArrayOfNumberOnly, rhs: ArrayOfArrayOfNumberOnly) -> Bool {
|
||||
lhs.arrayArrayNumber == rhs.arrayArrayNumber
|
||||
|
||||
@@ -37,5 +43,6 @@ public final class ArrayOfArrayOfNumberOnly: Codable, Hashable {
|
||||
hasher.combine(arrayArrayNumber?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.ArrayOfNumberOnly")
|
||||
public typealias ArrayOfNumberOnly = PetstoreClient.ArrayOfNumberOnly
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class ArrayOfNumberOnly: Codable, Hashable {
|
||||
|
||||
@@ -15,6 +22,7 @@ public final class ArrayOfNumberOnly: Codable, Hashable {
|
||||
public init(arrayNumber: [Double]? = nil) {
|
||||
self.arrayNumber = arrayNumber
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case arrayNumber = "ArrayNumber"
|
||||
}
|
||||
@@ -26,8 +34,6 @@ public final class ArrayOfNumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ArrayOfNumberOnly, rhs: ArrayOfNumberOnly) -> Bool {
|
||||
lhs.arrayNumber == rhs.arrayNumber
|
||||
|
||||
@@ -37,5 +43,6 @@ public final class ArrayOfNumberOnly: Codable, Hashable {
|
||||
hasher.combine(arrayNumber?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.ArrayTest")
|
||||
public typealias ArrayTest = PetstoreClient.ArrayTest
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class ArrayTest: Codable, Hashable {
|
||||
|
||||
@@ -19,6 +26,7 @@ public final class ArrayTest: Codable, Hashable {
|
||||
self.arrayArrayOfInteger = arrayArrayOfInteger
|
||||
self.arrayArrayOfModel = arrayArrayOfModel
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case arrayOfString = "array_of_string"
|
||||
case arrayArrayOfInteger = "array_array_of_integer"
|
||||
@@ -34,8 +42,6 @@ public final class ArrayTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ArrayTest, rhs: ArrayTest) -> Bool {
|
||||
lhs.arrayOfString == rhs.arrayOfString &&
|
||||
lhs.arrayArrayOfInteger == rhs.arrayArrayOfInteger &&
|
||||
@@ -49,5 +55,6 @@ public final class ArrayTest: Codable, Hashable {
|
||||
hasher.combine(arrayArrayOfModel?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Capitalization")
|
||||
public typealias Capitalization = PetstoreClient.Capitalization
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class Capitalization: Codable, Hashable {
|
||||
|
||||
@@ -26,6 +33,7 @@ public final class Capitalization: Codable, Hashable {
|
||||
self.sCAETHFlowPoints = sCAETHFlowPoints
|
||||
self.ATT_NAME = ATT_NAME
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case smallCamel
|
||||
case capitalCamel = "CapitalCamel"
|
||||
@@ -47,8 +55,6 @@ public final class Capitalization: Codable, Hashable {
|
||||
try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Capitalization, rhs: Capitalization) -> Bool {
|
||||
lhs.smallCamel == rhs.smallCamel &&
|
||||
lhs.capitalCamel == rhs.capitalCamel &&
|
||||
@@ -68,5 +74,6 @@ public final class Capitalization: Codable, Hashable {
|
||||
hasher.combine(ATT_NAME?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Cat")
|
||||
public typealias Cat = PetstoreClient.Cat
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class Cat: Codable, Hashable {
|
||||
|
||||
@@ -19,6 +26,7 @@ public final class Cat: Codable, Hashable {
|
||||
self.color = color
|
||||
self.declawed = declawed
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case className
|
||||
case color
|
||||
@@ -34,8 +42,6 @@ public final class Cat: Codable, Hashable {
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Cat, rhs: Cat) -> Bool {
|
||||
lhs.className == rhs.className &&
|
||||
lhs.color == rhs.color &&
|
||||
@@ -49,5 +55,6 @@ public final class Cat: Codable, Hashable {
|
||||
hasher.combine(declawed?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.CatAllOf")
|
||||
public typealias CatAllOf = PetstoreClient.CatAllOf
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class CatAllOf: Codable, Hashable {
|
||||
|
||||
@@ -15,6 +22,7 @@ public final class CatAllOf: Codable, Hashable {
|
||||
public init(declawed: Bool? = nil) {
|
||||
self.declawed = declawed
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case declawed
|
||||
}
|
||||
@@ -26,8 +34,6 @@ public final class CatAllOf: Codable, Hashable {
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: CatAllOf, rhs: CatAllOf) -> Bool {
|
||||
lhs.declawed == rhs.declawed
|
||||
|
||||
@@ -37,5 +43,6 @@ public final class CatAllOf: Codable, Hashable {
|
||||
hasher.combine(declawed?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Category")
|
||||
public typealias Category = PetstoreClient.Category
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class Category: Codable, Hashable {
|
||||
|
||||
@@ -17,6 +24,7 @@ public final class Category: Codable, Hashable {
|
||||
self.id = id
|
||||
self.name = name
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case id
|
||||
case name
|
||||
@@ -30,8 +38,6 @@ public final class Category: Codable, Hashable {
|
||||
try container.encode(name, forKey: .name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Category, rhs: Category) -> Bool {
|
||||
lhs.id == rhs.id &&
|
||||
lhs.name == rhs.name
|
||||
@@ -43,5 +49,6 @@ public final class Category: Codable, Hashable {
|
||||
hasher.combine(name.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.ClassModel")
|
||||
public typealias ClassModel = PetstoreClient.ClassModel
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
/** Model for testing model with \"_class\" property */
|
||||
public final class ClassModel: Codable, Hashable {
|
||||
@@ -16,6 +23,7 @@ public final class ClassModel: Codable, Hashable {
|
||||
public init(_class: String? = nil) {
|
||||
self._class = _class
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case _class
|
||||
}
|
||||
@@ -27,8 +35,6 @@ public final class ClassModel: Codable, Hashable {
|
||||
try container.encodeIfPresent(_class, forKey: ._class)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: ClassModel, rhs: ClassModel) -> Bool {
|
||||
lhs._class == rhs._class
|
||||
|
||||
@@ -38,5 +44,6 @@ public final class ClassModel: Codable, Hashable {
|
||||
hasher.combine(_class?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Client")
|
||||
public typealias Client = PetstoreClient.Client
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class Client: Codable, Hashable {
|
||||
|
||||
@@ -15,6 +22,7 @@ public final class Client: Codable, Hashable {
|
||||
public init(client: String? = nil) {
|
||||
self.client = client
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case client
|
||||
}
|
||||
@@ -26,8 +34,6 @@ public final class Client: Codable, Hashable {
|
||||
try container.encodeIfPresent(client, forKey: .client)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Client, rhs: Client) -> Bool {
|
||||
lhs.client == rhs.client
|
||||
|
||||
@@ -37,5 +43,6 @@ public final class Client: Codable, Hashable {
|
||||
hasher.combine(client?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Dog")
|
||||
public typealias Dog = PetstoreClient.Dog
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class Dog: Codable, Hashable {
|
||||
|
||||
@@ -19,6 +26,7 @@ public final class Dog: Codable, Hashable {
|
||||
self.color = color
|
||||
self.breed = breed
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case className
|
||||
case color
|
||||
@@ -34,8 +42,6 @@ public final class Dog: Codable, Hashable {
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Dog, rhs: Dog) -> Bool {
|
||||
lhs.className == rhs.className &&
|
||||
lhs.color == rhs.color &&
|
||||
@@ -49,5 +55,6 @@ public final class Dog: Codable, Hashable {
|
||||
hasher.combine(breed?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.DogAllOf")
|
||||
public typealias DogAllOf = PetstoreClient.DogAllOf
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class DogAllOf: Codable, Hashable {
|
||||
|
||||
@@ -15,6 +22,7 @@ public final class DogAllOf: Codable, Hashable {
|
||||
public init(breed: String? = nil) {
|
||||
self.breed = breed
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case breed
|
||||
}
|
||||
@@ -26,8 +34,6 @@ public final class DogAllOf: Codable, Hashable {
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: DogAllOf, rhs: DogAllOf) -> Bool {
|
||||
lhs.breed == rhs.breed
|
||||
|
||||
@@ -37,5 +43,6 @@ public final class DogAllOf: Codable, Hashable {
|
||||
hasher.combine(breed?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.EnumArrays")
|
||||
public typealias EnumArrays = PetstoreClient.EnumArrays
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class EnumArrays: Codable, Hashable {
|
||||
|
||||
@@ -25,6 +32,7 @@ public final class EnumArrays: Codable, Hashable {
|
||||
self.justSymbol = justSymbol
|
||||
self.arrayEnum = arrayEnum
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case justSymbol = "just_symbol"
|
||||
case arrayEnum = "array_enum"
|
||||
@@ -38,8 +46,6 @@ public final class EnumArrays: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: EnumArrays, rhs: EnumArrays) -> Bool {
|
||||
lhs.justSymbol == rhs.justSymbol &&
|
||||
lhs.arrayEnum == rhs.arrayEnum
|
||||
@@ -51,5 +57,6 @@ public final class EnumArrays: Codable, Hashable {
|
||||
hasher.combine(arrayEnum?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,10 +6,18 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.EnumClass")
|
||||
public typealias EnumClass = PetstoreClient.EnumClass
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public enum EnumClass: String, Codable, CaseIterable {
|
||||
case abc = "_abc"
|
||||
case efg = "-efg"
|
||||
case xyz = "(xyz)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.EnumTest")
|
||||
public typealias EnumTest = PetstoreClient.EnumTest
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class EnumTest: Codable, Hashable {
|
||||
|
||||
@@ -41,6 +48,7 @@ public final class EnumTest: Codable, Hashable {
|
||||
self.enumNumber = enumNumber
|
||||
self.outerEnum = outerEnum
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case enumString = "enum_string"
|
||||
case enumStringRequired = "enum_string_required"
|
||||
@@ -60,8 +68,6 @@ public final class EnumTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(outerEnum, forKey: .outerEnum)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: EnumTest, rhs: EnumTest) -> Bool {
|
||||
lhs.enumString == rhs.enumString &&
|
||||
lhs.enumStringRequired == rhs.enumStringRequired &&
|
||||
@@ -79,5 +85,6 @@ public final class EnumTest: Codable, Hashable {
|
||||
hasher.combine(outerEnum?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.File")
|
||||
public typealias File = PetstoreClient.File
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
/** Must be named `File` for test. */
|
||||
public final class File: Codable, Hashable {
|
||||
@@ -17,6 +24,7 @@ public final class File: Codable, Hashable {
|
||||
public init(sourceURI: String? = nil) {
|
||||
self.sourceURI = sourceURI
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case sourceURI
|
||||
}
|
||||
@@ -28,8 +36,6 @@ public final class File: Codable, Hashable {
|
||||
try container.encodeIfPresent(sourceURI, forKey: .sourceURI)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: File, rhs: File) -> Bool {
|
||||
lhs.sourceURI == rhs.sourceURI
|
||||
|
||||
@@ -39,5 +45,6 @@ public final class File: Codable, Hashable {
|
||||
hasher.combine(sourceURI?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.FileSchemaTestClass")
|
||||
public typealias FileSchemaTestClass = PetstoreClient.FileSchemaTestClass
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class FileSchemaTestClass: Codable, Hashable {
|
||||
|
||||
@@ -17,6 +24,7 @@ public final class FileSchemaTestClass: Codable, Hashable {
|
||||
self.file = file
|
||||
self.files = files
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case file
|
||||
case files
|
||||
@@ -30,8 +38,6 @@ public final class FileSchemaTestClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(files, forKey: .files)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: FileSchemaTestClass, rhs: FileSchemaTestClass) -> Bool {
|
||||
lhs.file == rhs.file &&
|
||||
lhs.files == rhs.files
|
||||
@@ -43,5 +49,6 @@ public final class FileSchemaTestClass: Codable, Hashable {
|
||||
hasher.combine(files?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.FormatTest")
|
||||
public typealias FormatTest = PetstoreClient.FormatTest
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class FormatTest: Codable, Hashable {
|
||||
|
||||
@@ -39,6 +46,7 @@ public final class FormatTest: Codable, Hashable {
|
||||
self.uuid = uuid
|
||||
self.password = password
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case integer
|
||||
case int32
|
||||
@@ -74,8 +82,6 @@ public final class FormatTest: Codable, Hashable {
|
||||
try container.encode(password, forKey: .password)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: FormatTest, rhs: FormatTest) -> Bool {
|
||||
lhs.integer == rhs.integer &&
|
||||
lhs.int32 == rhs.int32 &&
|
||||
@@ -109,5 +115,6 @@ public final class FormatTest: Codable, Hashable {
|
||||
hasher.combine(password.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.HasOnlyReadOnly")
|
||||
public typealias HasOnlyReadOnly = PetstoreClient.HasOnlyReadOnly
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class HasOnlyReadOnly: Codable, Hashable {
|
||||
|
||||
@@ -17,6 +24,7 @@ public final class HasOnlyReadOnly: Codable, Hashable {
|
||||
self.bar = bar
|
||||
self.foo = foo
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case bar
|
||||
case foo
|
||||
@@ -30,8 +38,6 @@ public final class HasOnlyReadOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(foo, forKey: .foo)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: HasOnlyReadOnly, rhs: HasOnlyReadOnly) -> Bool {
|
||||
lhs.bar == rhs.bar &&
|
||||
lhs.foo == rhs.foo
|
||||
@@ -43,5 +49,6 @@ public final class HasOnlyReadOnly: Codable, Hashable {
|
||||
hasher.combine(foo?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.List")
|
||||
public typealias List = PetstoreClient.List
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class List: Codable, Hashable {
|
||||
|
||||
@@ -15,6 +22,7 @@ public final class List: Codable, Hashable {
|
||||
public init(_123list: String? = nil) {
|
||||
self._123list = _123list
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case _123list = "123-list"
|
||||
}
|
||||
@@ -26,8 +34,6 @@ public final class List: Codable, Hashable {
|
||||
try container.encodeIfPresent(_123list, forKey: ._123list)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: List, rhs: List) -> Bool {
|
||||
lhs._123list == rhs._123list
|
||||
|
||||
@@ -37,5 +43,6 @@ public final class List: Codable, Hashable {
|
||||
hasher.combine(_123list?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.MapTest")
|
||||
public typealias MapTest = PetstoreClient.MapTest
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class MapTest: Codable, Hashable {
|
||||
|
||||
@@ -25,6 +32,7 @@ public final class MapTest: Codable, Hashable {
|
||||
self.directMap = directMap
|
||||
self.indirectMap = indirectMap
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case mapMapOfString = "map_map_of_string"
|
||||
case mapOfEnumString = "map_of_enum_string"
|
||||
@@ -42,8 +50,6 @@ public final class MapTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(indirectMap, forKey: .indirectMap)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: MapTest, rhs: MapTest) -> Bool {
|
||||
lhs.mapMapOfString == rhs.mapMapOfString &&
|
||||
lhs.mapOfEnumString == rhs.mapOfEnumString &&
|
||||
@@ -59,5 +65,6 @@ public final class MapTest: Codable, Hashable {
|
||||
hasher.combine(indirectMap?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.MixedPropertiesAndAdditionalPropertiesClass")
|
||||
public typealias MixedPropertiesAndAdditionalPropertiesClass = PetstoreClient.MixedPropertiesAndAdditionalPropertiesClass
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable {
|
||||
|
||||
@@ -19,6 +26,7 @@ public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashabl
|
||||
self.dateTime = dateTime
|
||||
self.map = map
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case uuid
|
||||
case dateTime
|
||||
@@ -34,8 +42,6 @@ public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashabl
|
||||
try container.encodeIfPresent(map, forKey: .map)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: MixedPropertiesAndAdditionalPropertiesClass, rhs: MixedPropertiesAndAdditionalPropertiesClass) -> Bool {
|
||||
lhs.uuid == rhs.uuid &&
|
||||
lhs.dateTime == rhs.dateTime &&
|
||||
@@ -49,5 +55,6 @@ public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashabl
|
||||
hasher.combine(map?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Model200Response")
|
||||
public typealias Model200Response = PetstoreClient.Model200Response
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
/** Model for testing model name starting with number */
|
||||
public final class Model200Response: Codable, Hashable {
|
||||
@@ -18,6 +25,7 @@ public final class Model200Response: Codable, Hashable {
|
||||
self.name = name
|
||||
self._class = _class
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case name
|
||||
case _class = "class"
|
||||
@@ -31,8 +39,6 @@ public final class Model200Response: Codable, Hashable {
|
||||
try container.encodeIfPresent(_class, forKey: ._class)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Model200Response, rhs: Model200Response) -> Bool {
|
||||
lhs.name == rhs.name &&
|
||||
lhs._class == rhs._class
|
||||
@@ -44,5 +50,6 @@ public final class Model200Response: Codable, Hashable {
|
||||
hasher.combine(_class?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Name")
|
||||
public typealias Name = PetstoreClient.Name
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
/** Model for testing model name same as property name */
|
||||
public final class Name: Codable, Hashable {
|
||||
@@ -22,6 +29,7 @@ public final class Name: Codable, Hashable {
|
||||
self.property = property
|
||||
self._123number = _123number
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case name
|
||||
case snakeCase = "snake_case"
|
||||
@@ -39,8 +47,6 @@ public final class Name: Codable, Hashable {
|
||||
try container.encodeIfPresent(_123number, forKey: ._123number)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Name, rhs: Name) -> Bool {
|
||||
lhs.name == rhs.name &&
|
||||
lhs.snakeCase == rhs.snakeCase &&
|
||||
@@ -56,5 +62,6 @@ public final class Name: Codable, Hashable {
|
||||
hasher.combine(_123number?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.NumberOnly")
|
||||
public typealias NumberOnly = PetstoreClient.NumberOnly
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class NumberOnly: Codable, Hashable {
|
||||
|
||||
@@ -15,6 +22,7 @@ public final class NumberOnly: Codable, Hashable {
|
||||
public init(justNumber: Double? = nil) {
|
||||
self.justNumber = justNumber
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case justNumber = "JustNumber"
|
||||
}
|
||||
@@ -26,8 +34,6 @@ public final class NumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(justNumber, forKey: .justNumber)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: NumberOnly, rhs: NumberOnly) -> Bool {
|
||||
lhs.justNumber == rhs.justNumber
|
||||
|
||||
@@ -37,5 +43,6 @@ public final class NumberOnly: Codable, Hashable {
|
||||
hasher.combine(justNumber?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
@available(*, deprecated, renamed: "PetstoreClient.Order")
|
||||
public typealias Order = PetstoreClient.Order
|
||||
|
||||
extension PetstoreClient {
|
||||
|
||||
public final class Order: Codable, Hashable {
|
||||
|
||||
@@ -31,6 +38,7 @@ public final class Order: Codable, Hashable {
|
||||
self.status = status
|
||||
self.complete = complete
|
||||
}
|
||||
|
||||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||||
case id
|
||||
case petId
|
||||
@@ -52,8 +60,6 @@ public final class Order: Codable, Hashable {
|
||||
try container.encodeIfPresent(complete, forKey: .complete)
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static func == (lhs: Order, rhs: Order) -> Bool {
|
||||
lhs.id == rhs.id &&
|
||||
lhs.petId == rhs.petId &&
|
||||
@@ -73,5 +79,6 @@ public final class Order: Codable, Hashable {
|
||||
hasher.combine(complete?.hashValue)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user