diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 5dd20e2fe7e..ca260a2b92a 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -129,7 +129,7 @@ public class PetAPI: APIBase { Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter + - parameter status: (query) Status values that need to be considered for query - parameter completion: completion handler to receive the data and the error objects */ public class func findPetsByStatus(status status: [String]?, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { @@ -142,7 +142,7 @@ public class PetAPI: APIBase { Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter + - parameter status: (query) Status values that need to be considered for query - returns: Promise<[Pet]> */ public class func findPetsByStatus(status status: [String]?) -> Promise<[Pet]> { @@ -162,24 +162,24 @@ public class PetAPI: APIBase { Finds Pets by status - GET /pet/findByStatus - - Multiple status values can be provided with comma seperated strings + - Multiple status values can be provided with comma separated strings - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{example=[ { - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], + - examples: [{contentType=application/json, example=[ { + "photoUrls" : [ "aeiou" ], + "name" : "doggie", "id" : 123456789, "category" : { - "id" : 123456789, - "name" : "aeiou" + "name" : "aeiou", + "id" : 123456789 }, - "status" : "aeiou", - "name" : "doggie", - "photoUrls" : [ "aeiou" ] -} ], contentType=application/json}, {example= + "tags" : [ { + "name" : "aeiou", + "id" : 123456789 + } ], + "status" : "aeiou" +} ]}, {contentType=application/xml, example= 123456 doggie @@ -188,21 +188,21 @@ public class PetAPI: APIBase { string -, contentType=application/xml}] - - examples: [{example=[ { - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], +}] + - examples: [{contentType=application/json, example=[ { + "photoUrls" : [ "aeiou" ], + "name" : "doggie", "id" : 123456789, "category" : { - "id" : 123456789, - "name" : "aeiou" + "name" : "aeiou", + "id" : 123456789 }, - "status" : "aeiou", - "name" : "doggie", - "photoUrls" : [ "aeiou" ] -} ], contentType=application/json}, {example= + "tags" : [ { + "name" : "aeiou", + "id" : 123456789 + } ], + "status" : "aeiou" +} ]}, {contentType=application/xml, example= 123456 doggie @@ -211,9 +211,9 @@ public class PetAPI: APIBase { string -, contentType=application/xml}] +}] - - parameter status: (query) Status values that need to be considered for filter + - parameter status: (query) Status values that need to be considered for query - returns: RequestBuilder<[Pet]> */ @@ -272,20 +272,20 @@ public class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{example=[ { - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], + - examples: [{contentType=application/json, example=[ { + "photoUrls" : [ "aeiou" ], + "name" : "doggie", "id" : 123456789, "category" : { - "id" : 123456789, - "name" : "aeiou" + "name" : "aeiou", + "id" : 123456789 }, - "status" : "aeiou", - "name" : "doggie", - "photoUrls" : [ "aeiou" ] -} ], contentType=application/json}, {example= + "tags" : [ { + "name" : "aeiou", + "id" : 123456789 + } ], + "status" : "aeiou" +} ]}, {contentType=application/xml, example= 123456 doggie @@ -294,21 +294,21 @@ public class PetAPI: APIBase { string -, contentType=application/xml}] - - examples: [{example=[ { - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], +}] + - examples: [{contentType=application/json, example=[ { + "photoUrls" : [ "aeiou" ], + "name" : "doggie", "id" : 123456789, "category" : { - "id" : 123456789, - "name" : "aeiou" + "name" : "aeiou", + "id" : 123456789 }, - "status" : "aeiou", - "name" : "doggie", - "photoUrls" : [ "aeiou" ] -} ], contentType=application/json}, {example= + "tags" : [ { + "name" : "aeiou", + "id" : 123456789 + } ], + "status" : "aeiou" +} ]}, {contentType=application/xml, example= 123456 doggie @@ -317,7 +317,7 @@ public class PetAPI: APIBase { string -, contentType=application/xml}] +}] - parameter tags: (query) Tags to filter by @@ -375,26 +375,26 @@ public class PetAPI: APIBase { - GET /pet/{petId} - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - API Key: - - type: apiKey api_key - - name: api_key - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{example={ - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], + - API Key: + - type: apiKey api_key + - name: api_key + - examples: [{contentType=application/json, example={ + "photoUrls" : [ "aeiou" ], + "name" : "doggie", "id" : 123456789, "category" : { - "id" : 123456789, - "name" : "aeiou" + "name" : "aeiou", + "id" : 123456789 }, - "status" : "aeiou", - "name" : "doggie", - "photoUrls" : [ "aeiou" ] -}, contentType=application/json}, {example= + "tags" : [ { + "name" : "aeiou", + "id" : 123456789 + } ], + "status" : "aeiou" +}}, {contentType=application/xml, example= 123456 doggie @@ -403,21 +403,21 @@ public class PetAPI: APIBase { string -, contentType=application/xml}] - - examples: [{example={ - "tags" : [ { - "id" : 123456789, - "name" : "aeiou" - } ], +}] + - examples: [{contentType=application/json, example={ + "photoUrls" : [ "aeiou" ], + "name" : "doggie", "id" : 123456789, "category" : { - "id" : 123456789, - "name" : "aeiou" + "name" : "aeiou", + "id" : 123456789 }, - "status" : "aeiou", - "name" : "doggie", - "photoUrls" : [ "aeiou" ] -}, contentType=application/json}, {example= + "tags" : [ { + "name" : "aeiou", + "id" : 123456789 + } ], + "status" : "aeiou" +}}, {contentType=application/xml, example= 123456 doggie @@ -426,7 +426,7 @@ public class PetAPI: APIBase { string -, contentType=application/xml}] +}] - parameter petId: (path) ID of pet that needs to be fetched @@ -578,11 +578,11 @@ public class PetAPI: APIBase { - parameter petId: (path) ID of pet to update - parameter additionalMetadata: (form) Additional data to pass to server - - parameter file: (form) file to upload + - parameter _file: (form) file to upload - parameter completion: completion handler to receive the data and the error objects */ - public class func uploadFile(petId petId: Int, additionalMetadata: String?, file: NSURL?, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + public class func uploadFile(petId petId: Int, additionalMetadata: String?, _file: NSURL?, completion: ((error: ErrorType?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, _file: _file).execute { (response, error) -> Void in completion(error: error); } } @@ -593,12 +593,12 @@ public class PetAPI: APIBase { - parameter petId: (path) ID of pet to update - parameter additionalMetadata: (form) Additional data to pass to server - - parameter file: (form) file to upload + - parameter _file: (form) file to upload - returns: Promise */ - public class func uploadFile(petId petId: Int, additionalMetadata: String?, file: NSURL?) -> Promise { + public class func uploadFile(petId petId: Int, additionalMetadata: String?, _file: NSURL?) -> Promise { let deferred = Promise.pendingPromise() - uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { error in + uploadFile(petId: petId, additionalMetadata: additionalMetadata, _file: _file) { error in if let error = error { deferred.reject(error) } else { @@ -620,18 +620,18 @@ public class PetAPI: APIBase { - parameter petId: (path) ID of pet to update - parameter additionalMetadata: (form) Additional data to pass to server - - parameter file: (form) file to upload + - parameter _file: (form) file to upload - returns: RequestBuilder */ - public class func uploadFileWithRequestBuilder(petId petId: Int, additionalMetadata: String?, file: NSURL?) -> RequestBuilder { + public class func uploadFileWithRequestBuilder(petId petId: Int, additionalMetadata: String?, _file: NSURL?) -> RequestBuilder { var path = "/pet/{petId}/uploadImage" path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path let nillableParameters: [String:AnyObject?] = [ "additionalMetadata": additionalMetadata, - "file": file + "file": _file ] let parameters = APIHelper.rejectNil(nillableParameters) @@ -678,14 +678,14 @@ public class PetAPI: APIBase { - GET /pet/{petId}?testing_byte_array=true - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - API Key: - - type: apiKey api_key - - name: api_key - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{example="", contentType=application/json}, {example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e, contentType=application/xml}] - - examples: [{example="", contentType=application/json}, {example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e, contentType=application/xml}] + - API Key: + - type: apiKey api_key + - name: api_key + - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e}] + - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e}] - parameter petId: (path) ID of pet that needs to be fetched diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 4aa7663fdf5..e8511765a97 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -11,6 +11,99 @@ import PromiseKit public class StoreAPI: APIBase { + /** + + Finds orders by status + + - parameter status: (query) Status value that needs to be considered for query + - parameter completion: completion handler to receive the data and the error objects + */ + public class func findOrdersByStatus(status status: String?, completion: ((data: [Order]?, error: ErrorType?) -> Void)) { + findOrdersByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in + completion(data: response?.body, error: error); + } + } + + /** + + Finds orders by status + + - parameter status: (query) Status value that needs to be considered for query + - returns: Promise<[Order]> + */ + public class func findOrdersByStatus(status status: String?) -> Promise<[Order]> { + let deferred = Promise<[Order]>.pendingPromise() + findOrdersByStatus(status: status) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + + Finds orders by status + + - GET /store/findByStatus + - A single status value can be provided as a string + - API Key: + - type: apiKey x-test_api_client_id + - name: test_api_client_id + - API Key: + - type: apiKey x-test_api_client_secret + - name: test_api_client_secret + - examples: [{contentType=application/json, example=[ { + "petId" : 123456789, + "quantity" : 123, + "id" : 123456789, + "shipDate" : "2000-01-23T04:56:07.000+0000", + "complete" : true, + "status" : "aeiou" +} ]}, {contentType=application/xml, example= + 123456 + 123456 + 0 + 2000-01-23T04:56:07.000Z + string + true +}] + - examples: [{contentType=application/json, example=[ { + "petId" : 123456789, + "quantity" : 123, + "id" : 123456789, + "shipDate" : "2000-01-23T04:56:07.000+0000", + "complete" : true, + "status" : "aeiou" +} ]}, {contentType=application/xml, example= + 123456 + 123456 + 0 + 2000-01-23T04:56:07.000Z + string + true +}] + + - parameter status: (query) Status value that needs to be considered for query + + - returns: RequestBuilder<[Order]> + */ + public class func findOrdersByStatusWithRequestBuilder(status status: String?) -> RequestBuilder<[Order]> { + let path = "/store/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + + let nillableParameters: [String:AnyObject?] = [ + "status": status + ] + let parameters = APIHelper.rejectNil(nillableParameters) + + let requestBuilder: RequestBuilder<[Order]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: URLString, parameters: parameters, isBody: false) + } + /** Returns pet inventories by status @@ -50,12 +143,12 @@ public class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{example={ + - examples: [{contentType=application/json, example={ "key" : 123 -}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}] - - examples: [{example={ +}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}] + - examples: [{contentType=application/json, example={ "key" : 123 -}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}] +}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}] - returns: RequestBuilder<[String:Int]> */ @@ -115,36 +208,36 @@ public class StoreAPI: APIBase { - API Key: - type: apiKey x-test_api_client_secret - name: test_api_client_secret - - examples: [{example={ - "id" : 123456789, + - examples: [{contentType=application/json, example={ "petId" : 123456789, - "complete" : true, - "status" : "aeiou", "quantity" : 123, - "shipDate" : "2000-01-23T04:56:07.000+0000" -}, contentType=application/json}, {example= + "id" : 123456789, + "shipDate" : "2000-01-23T04:56:07.000+0000", + "complete" : true, + "status" : "aeiou" +}}, {contentType=application/xml, example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -, contentType=application/xml}] - - examples: [{example={ - "id" : 123456789, +}] + - examples: [{contentType=application/json, example={ "petId" : 123456789, - "complete" : true, - "status" : "aeiou", "quantity" : 123, - "shipDate" : "2000-01-23T04:56:07.000+0000" -}, contentType=application/json}, {example= + "id" : 123456789, + "shipDate" : "2000-01-23T04:56:07.000+0000", + "complete" : true, + "status" : "aeiou" +}}, {contentType=application/xml, example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -, contentType=application/xml}] +}] - parameter body: (body) order placed for purchasing the pet @@ -199,42 +292,42 @@ public class StoreAPI: APIBase { - GET /store/order/{orderId} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - API Key: - - type: apiKey test_api_key_header - - name: test_api_key_header - API Key: - type: apiKey test_api_key_query (QUERY) - name: test_api_key_query - - examples: [{example={ - "id" : 123456789, + - API Key: + - type: apiKey test_api_key_header + - name: test_api_key_header + - examples: [{contentType=application/json, example={ "petId" : 123456789, - "complete" : true, - "status" : "aeiou", "quantity" : 123, - "shipDate" : "2000-01-23T04:56:07.000+0000" -}, contentType=application/json}, {example= + "id" : 123456789, + "shipDate" : "2000-01-23T04:56:07.000+0000", + "complete" : true, + "status" : "aeiou" +}}, {contentType=application/xml, example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -, contentType=application/xml}] - - examples: [{example={ - "id" : 123456789, +}] + - examples: [{contentType=application/json, example={ "petId" : 123456789, - "complete" : true, - "status" : "aeiou", "quantity" : 123, - "shipDate" : "2000-01-23T04:56:07.000+0000" -}, contentType=application/json}, {example= + "id" : 123456789, + "shipDate" : "2000-01-23T04:56:07.000+0000", + "complete" : true, + "status" : "aeiou" +}}, {contentType=application/xml, example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -, contentType=application/xml}] +}] - parameter orderId: (path) ID of pet that needs to be fetched diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 7d304039bb0..dffc01db15f 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -213,8 +213,8 @@ public class UserAPI: APIBase { - GET /user/login - - - examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}] - - examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}] + - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}] + - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}] - parameter username: (query) The user name for login - parameter password: (query) The password for login in clear text @@ -325,7 +325,7 @@ public class UserAPI: APIBase { - GET /user/{username} - - - examples: [{example={ + - examples: [{contentType=application/json, example={ "id" : 1, "username" : "johnp", "firstName" : "John", @@ -334,7 +334,7 @@ public class UserAPI: APIBase { "password" : "-secret-", "phone" : "0123456789", "userStatus" : 0 -}, contentType=application/json}] +}}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift index 04c07fa97ff..f9b6c5ade48 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift @@ -124,6 +124,24 @@ class Decoders { fatalError("formatter failed to parse \(source)") } + // Decoder for [Order] + Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in + return Decoders.decode(clazz: [Order].self, source: source) + } + // Decoder for Order + Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in + let sourceDictionary = source as! [NSObject:AnyObject] + let instance = Order() + instance.id = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["id"]) + instance.petId = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["petId"]) + instance.quantity = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["quantity"]) + instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) + instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) + return instance + } + + // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in return Decoders.decode(clazz: [User].self, source: source) @@ -158,6 +176,20 @@ class Decoders { } + // Decoder for [Tag] + Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in + return Decoders.decode(clazz: [Tag].self, source: source) + } + // Decoder for Tag + Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in + let sourceDictionary = source as! [NSObject:AnyObject] + let instance = Tag() + instance.id = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["id"]) + instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) + return instance + } + + // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in return Decoders.decode(clazz: [Pet].self, source: source) @@ -175,38 +207,6 @@ class Decoders { return instance } - - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in - return Decoders.decode(clazz: [Tag].self, source: source) - } - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = Tag() - instance.id = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["id"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - return instance - } - - - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in - return Decoders.decode(clazz: [Order].self, source: source) - } - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = Order() - instance.id = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["id"]) - instance.petId = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["petId"]) - instance.quantity = Decoders.decodeOptional(clazz: Int.self, source: sourceDictionary["quantity"]) - instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) - return instance - } - } } } diff --git a/samples/client/petstore/swift/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift/SwaggerClientTests/Podfile.lock index 276eaa75e70..76889714e21 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift/SwaggerClientTests/Podfile.lock @@ -10,17 +10,17 @@ PODS: - PetstoreClient (0.0.1): - Alamofire (~> 3.1.4) - PromiseKit (~> 3.0.0) - - PromiseKit (3.0.2): - - PromiseKit/Foundation (= 3.0.2) - - PromiseKit/QuartzCore (= 3.0.2) - - PromiseKit/UIKit (= 3.0.2) - - PromiseKit/CorePromise (3.0.2) - - PromiseKit/Foundation (3.0.2): + - PromiseKit (3.0.3): + - PromiseKit/Foundation (= 3.0.3) + - PromiseKit/QuartzCore (= 3.0.3) + - PromiseKit/UIKit (= 3.0.3) + - PromiseKit/CorePromise (3.0.3) + - PromiseKit/Foundation (3.0.3): - OMGHTTPURLRQ (~> 3.1.0) - PromiseKit/CorePromise - - PromiseKit/QuartzCore (3.0.2): + - PromiseKit/QuartzCore (3.0.3): - PromiseKit/CorePromise - - PromiseKit/UIKit (3.0.2): + - PromiseKit/UIKit (3.0.3): - PromiseKit/CorePromise DEPENDENCIES: @@ -34,6 +34,6 @@ SPEC CHECKSUMS: Alamofire: 5f730ba29fd113b7ddd71c1e65d0c630acf5d7b0 OMGHTTPURLRQ: 633f98ee745aeda02345935a52eec1784cddb589 PetstoreClient: c9a3d06cf7954479a767135676406c4922cd3c4a - PromiseKit: ab1a380f7a30cf8cce663a2411e8b3580b10313d + PromiseKit: 00ec2a219bf5ad2833f95977698e921932b8dfd3 COCOAPODS: 0.39.0 diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift/SwaggerClientTests/Pods/Manifest.lock index 276eaa75e70..76889714e21 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/Manifest.lock @@ -10,17 +10,17 @@ PODS: - PetstoreClient (0.0.1): - Alamofire (~> 3.1.4) - PromiseKit (~> 3.0.0) - - PromiseKit (3.0.2): - - PromiseKit/Foundation (= 3.0.2) - - PromiseKit/QuartzCore (= 3.0.2) - - PromiseKit/UIKit (= 3.0.2) - - PromiseKit/CorePromise (3.0.2) - - PromiseKit/Foundation (3.0.2): + - PromiseKit (3.0.3): + - PromiseKit/Foundation (= 3.0.3) + - PromiseKit/QuartzCore (= 3.0.3) + - PromiseKit/UIKit (= 3.0.3) + - PromiseKit/CorePromise (3.0.3) + - PromiseKit/Foundation (3.0.3): - OMGHTTPURLRQ (~> 3.1.0) - PromiseKit/CorePromise - - PromiseKit/QuartzCore (3.0.2): + - PromiseKit/QuartzCore (3.0.3): - PromiseKit/CorePromise - - PromiseKit/UIKit (3.0.2): + - PromiseKit/UIKit (3.0.3): - PromiseKit/CorePromise DEPENDENCIES: @@ -34,6 +34,6 @@ SPEC CHECKSUMS: Alamofire: 5f730ba29fd113b7ddd71c1e65d0c630acf5d7b0 OMGHTTPURLRQ: 633f98ee745aeda02345935a52eec1784cddb589 PetstoreClient: c9a3d06cf7954479a767135676406c4922cd3c4a - PromiseKit: ab1a380f7a30cf8cce663a2411e8b3580b10313d + PromiseKit: 00ec2a219bf5ad2833f95977698e921932b8dfd3 COCOAPODS: 0.39.0 diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h index 4508d0c9445..b131488df70 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Categories/UIKit/UIViewController+AnyPromise.h @@ -51,7 +51,7 @@ } - (void)viewDidLoad { - _promise = [AnyPromise promiseWithResolver:&resolve]; + _promise = [[AnyPromise alloc] initWithResolver:&resolve]; } - (void)later { diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/README.markdown b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/README.markdown index a12107caf98..30dba5f10be 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/README.markdown +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/README.markdown @@ -45,7 +45,7 @@ If you still are using Xcode 6 and Swift 1.2 then use PromiseKit 2. # PromiseKit 2 -PromiseKit 2 contains many interesting and important additions. Check out our our [release announcement](http://promisekit.org/PromiseKit-2.0-Released/) for full details. +PromiseKit 2 contains many interesting and important additions. Check out our our [release announcement](http://promisekit.org/PromiseKit-2.0-Released) for full details. # PromiseKit 1 diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h index ec224bb1208..5a76d4d7147 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h @@ -154,7 +154,7 @@ typedef NS_ENUM(NSInteger, PMKCatchPolicy) { @param block The provided block is immediately executed, inside the block call `resolve` to resolve this promise and cause any attached handlers to execute. If you are wrapping a delegate-based system, we recommend - instead to use: promiseWithResolver: + instead to use: initWithResolver: @return A new promise. @@ -173,7 +173,7 @@ typedef NS_ENUM(NSInteger, PMKCatchPolicy) { prefer resolverWithBlock: as the resulting code is more elegant. PMKResolver resolve; - AnyPromise *promise = [AnyPromise promiseWithResolver:&resolve]; + AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; // later resolve(@"foo"); @@ -216,7 +216,7 @@ typedef void (^PMKBooleanAdapter)(BOOL, NSError * __nullable); provide this convenience adapter to make wrapping such systems more elegant. - return [PMKPromise promiseWithAdapter:^(PMKAdapter adapter){ + return [PMKPromise promiseWithAdapterBlock:^(PMKAdapter adapter){ PFQuery *query = [PFQuery …]; [query findObjectsInBackgroundWithBlock:adapter]; }]; diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift index f913c8c1d85..e672d5ecd85 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift @@ -50,6 +50,15 @@ import Foundation.NSError self.init(bound: bound.then(on: zalgo) { NSDictionary(dictionary: $0) }) } + /** + - Returns: A new AnyPromise bound to a `Promise`. + The two promises represent the same task, any changes to either will instantly reflect on both. + The value is converted to an NSString so Objective-C can use it. + */ + convenience public init(bound: Promise) { + self.init(bound: bound.then(on: zalgo) { NSString(string: $0) }) + } + /** - Returns: A new AnyPromise bound to a `Promise`. The two promises represent the same task, any changes to either will instantly reflect on both. @@ -59,6 +68,15 @@ import Foundation.NSError self.init(bound: bound.then(on: zalgo) { NSNumber(integer: $0) }) } + /** + - Returns: A new AnyPromise bound to a `Promise`. + The two promises represent the same task, any changes to either will instantly reflect on both. + The value is converted to an NSNumber so Objective-C can use it. + */ + convenience public init(bound: Promise) { + self.init(bound: bound.then(on: zalgo) { NSNumber(bool: $0) }) + } + /** - Returns: A new AnyPromise bound to a `Promise`. The two promises represent the same task, any changes to either will instantly reflect on both. diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift index d7063bf9270..a99b6977e2b 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift @@ -173,6 +173,18 @@ public class Promise { } } + /** + A `typealias` for the return values of `pendingPromise()`. Simplifies declaration of properties that reference the values' containing tuple when this is necessary. For example, when working with multiple `pendingPromise()`s within the same scope, or when the promise initialization must occur outside of the caller's initialization. + + ``` + class Foo: BarDelegate { + var pendingPromise: Promise.PendingPromise? + } + ``` + - SeeAlso: pendingPromise() + */ + public typealias PendingPromise = (promise: Promise, fulfill: (T) -> Void, reject: (ErrorType) -> Void) + /** Making promises that wrap asynchronous delegation systems or other larger asynchronous systems without a simple completion handler is easier with pendingPromise. @@ -193,7 +205,7 @@ public class Promise { 2) A function that fulfills that promise 3) A function that rejects that promise */ - public class func pendingPromise() -> (promise: Promise, fulfill: (T) -> Void, reject: (ErrorType) -> Void) { + public class func pendingPromise() -> PendingPromise { var fulfill: ((T) -> Void)! var reject: ((ErrorType) -> Void)! let promise = Promise { fulfill = $0; reject = $1 } diff --git a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist b/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist index 26f3ef80b78..039da19eb7c 100644 --- a/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist +++ b/samples/client/petstore/swift/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.2 + 3.0.3 CFBundleSignature ???? CFBundleVersion