diff --git a/.gitignore b/.gitignore
index b179ef75ef9f..7c1ce8f5efda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -101,11 +101,19 @@ samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcworksp
samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile.lock
# Swift
-samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcodeproj/xcuserdata
-samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcworkspace/xcuserdata
-samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/xcuserdata
-samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/xcshareddata/xcschemes
+samples/client/petstore/swift/**/SwaggerClientTests/SwaggerClient.xcodeproj/xcuserdata
+samples/client/petstore/swift/**/SwaggerClientTests/SwaggerClient.xcworkspace/xcuserdata
+samples/client/petstore/swift/**/SwaggerClientTests/Pods/
+#samples/client/petstore/swift/**/SwaggerClientTests/Pods/Pods.xcodeproj/xcuserdata
+#samples/client/petstore/swift/**/SwaggerClientTests/Pods/Pods.xcodeproj/xcshareddata/xcschemes
samples/client/petstore/swift/**/SwaggerClientTests/Podfile.lock
+# Swift3
+samples/client/petstore/swift3/**/SwaggerClientTests/SwaggerClient.xcodeproj/xcuserdata
+samples/client/petstore/swift3/**/SwaggerClientTests/SwaggerClient.xcworkspace/xcuserdata
+samples/client/petstore/swift3/**/SwaggerClientTests/Pods/
+#samples/client/petstore/swift3/**/SwaggerClientTests/Pods/Pods.xcodeproj/xcuserdata
+#samples/client/petstore/swift3/**/SwaggerClientTests/Pods/Pods.xcodeproj/xcshareddata/xcschemes
+samples/client/petstore/swift3/**/SwaggerClientTests/Podfile.lock
# C#
*.csproj.user
diff --git a/.travis.yml b/.travis.yml
index e47f69a39535..74848c561f11 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,9 +1,6 @@
sudo: required
-language: java
-jdk:
- - oraclejdk7
- - oraclejdk8
-
+language: objective-c
+osx_image: xcode8.2
cache:
directories:
- $HOME/.m2
@@ -25,39 +22,59 @@ cache:
- $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings
- $HOME/samples/client/petstore/typescript-angular/node_modules
- $HOME/samples/client/petstore/typescript-angular/typings
+ - /Users/travis/.cocoapods/repos/master
+# note: docker is not yet supported in iOS build
+#services:
+# - docker
-services:
- - docker
-
+# comment out the host table change to use the public petstore server
addons:
hosts:
- petstore.swagger.io
before_install:
- # required when sudo: required for the Ruby petstore tests
- - gem install bundler
+ - export SW=`pwd`
+ - rvm list
+ - rvm use 2.2.5
+ - gem environment
+ - gem install bundler -N --no-ri --no-rdoc
+ - gem install cocoapods -v 1.2.1 -N --no-ri --no-rdoc
+ - gem install xcpretty -N --no-ri --no-rdoc
+ - pod --version
+ - pod repo update
+ - pod setup --silent > /dev/null
- npm install -g typescript
- npm config set registry http://registry.npmjs.org/
- - sudo pip install virtualenv
+ - brew install sbt
+ - brew install leiningen
+ - brew install bats
+ - brew install curl
+ - brew install python3
+ - pip install virtualenv
+ # start local petstore server
+ - git clone -b docker --single-branch https://github.com/wing328/swagger-samples
+ - cd swagger-samples/java/java-jersey-jaxrs
+ - sudo mvn jetty:run &
+ - cd $SW
+ # NOTE: iOS build not support docker at the moment
# to run petstore server locally via docker
- - docker pull swaggerapi/petstore
- - docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- - docker ps -a
- # Add bats test framework and cURL for Bash script integration tests
- - sudo add-apt-repository ppa:duggan/bats --yes
- - sudo apt-get update -qq
- - sudo apt-get install -qq bats
- - sudo apt-get install -qq curl
+ #- docker pull swaggerapi/petstore
+ #- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
+ #- docker ps -a
# Add rebar3 build tool and recent Erlang/OTP for Erlang petstore server tests.
# - Travis CI does not support rebar3 [yet](https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490).
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
- - . ~/otp/18.2.1/activate && erl -version
- - curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
# show host table to confirm petstore.swagger.io is mapped to localhost
- cat /etc/hosts
# show java version
- java -version
+ # show brew version
+ - brew --version
+ # show xcpretty version
+ - xcpretty -v
+ # show go version
+ - go version
install:
# Add Godeps dependencies to GOPATH and PATH
diff --git a/circle.yml b/circle.yml
index 03731d82c6c8..96ad5328a1c1 100644
--- a/circle.yml
+++ b/circle.yml
@@ -14,6 +14,10 @@ dependencies:
- "~/.sbt"
pre:
+ - sudo add-apt-repository ppa:duggan/bats --yes
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq bats
+ - sudo apt-get install -qq curl
# to run petstore server locally via docker
- docker pull swaggerapi/petstore
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
diff --git a/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache b/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache
index 05e2282212df..526efb165bc5 100644
--- a/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache
+++ b/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache
@@ -27,10 +27,10 @@ Pod::Spec.new do |s|
{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'
{{#usePromiseKit}}
- s.dependency 'PromiseKit', '~> 3.1.1'
+ s.dependency 'PromiseKit', '~> 3.5.3'
{{/usePromiseKit}}
{{#useRxSwift}}
- s.dependency 'RxSwift', '~> 2.0'
+ s.dependency 'RxSwift', '~> 2.6.1'
{{/useRxSwift}}
- s.dependency 'Alamofire', '~> 3.4.1'
+ s.dependency 'Alamofire', '~> 3.5.1'
end
diff --git a/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache b/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache
index 0ff8913166d7..97bb64e229d5 100644
--- a/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache
+++ b/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'{{#usePromiseKit}}
- s.dependency 'PromiseKit', '~> 4.0'{{/usePromiseKit}}{{#useRxSwift}}
- s.dependency 'RxSwift', '~> 3.0.0-beta.1'{{/useRxSwift}}
+ s.dependency 'PromiseKit', '~> 4.2.2'{{/usePromiseKit}}{{#useRxSwift}}
+ s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
s.dependency 'Alamofire', '~> 4.0'
end
diff --git a/modules/swagger-codegen/src/main/resources/swift3/api.mustache b/modules/swagger-codegen/src/main/resources/swift3/api.mustache
index 371057a682e7..e85028db04b5 100644
--- a/modules/swagger-codegen/src/main/resources/swift3/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/swift3/api.mustache
@@ -80,7 +80,7 @@ open class {{classname}}: APIBase {
}
observer.on(.completed)
}
- return NopDisposable.instance
+ return Disposables.create()
}
}
{{/useRxSwift}}
diff --git a/pom.xml b/pom.xml
index ff3db301cb8b..12a8249e3c30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -792,22 +792,18 @@
- samples/client/petstore/clojure
- samples/client/petstore/java/feign
- samples/client/petstore/java/jersey1
- samples/client/petstore/java/jersey2
- samples/client/petstore/java/okhttp-gson
- samples/client/petstore/java/retrofit
- samples/client/petstore/java/retrofit2
- samples/client/petstore/java/retrofit2rx
- samples/client/petstore/jaxrs-cxf-client
- samples/client/petstore/java/resttemplate
+ samples/client/petstore/ruby
+ samples/client/petstore/swift3/default/SwaggerClientTests
+ samples/client/petstore/swift3/promisekit/SwaggerClientTests
+ samples/client/petstore/swift3/rxswift/SwaggerClientTests
+ samples/client/petstore/swift/default/SwaggerClientTests
+ samples/client/petstore/swift/promisekit/SwaggerClientTests
+ samples/client/petstore/swift/rxswift/SwaggerClientTests
+
samples/client/petstore/scala
samples/client/petstore/akka-scala
- samples/client/petstore/ruby
- samples/client/petstore/android/volley
- samples/client/petstore/bash
- samples/client/petstore/go
samples/client/petstore/javascript
samples/client/petstore/python
samples/client/petstore/typescript-fetch/builds/default
@@ -817,28 +813,8 @@
samples/client/petstore/typescript-angular
samples/client/petstore/typescript-node/npm
samples/client/petstore/typescript-jquery/npm
-
-
- samples/server/petstore/java-inflector
- samples/server/petstore/java-play-framework
- samples/server/petstore/undertow
- samples/server/petstore/jaxrs/jersey1
- samples/server/petstore/jaxrs/jersey2
- samples/server/petstore/jaxrs-resteasy/default
- samples/server/petstore/jaxrs-resteasy/eap
- samples/server/petstore/jaxrs-resteasy/eap-joda
- samples/server/petstore/jaxrs-resteasy/joda
samples/server/petstore/scalatra
- samples/server/petstore/spring-mvc
- samples/client/petstore/spring-cloud
- samples/server/petstore/springboot
- samples/server/petstore/springboot-beanvalidation
- samples/server/petstore/jaxrs-cxf
- samples/server/petstore/jaxrs-cxf-annotated-base-path
- samples/server/petstore/jaxrs-cxf-cdi
- samples/server/petstore/jaxrs-cxf-non-spring-app
-
diff --git a/pom.xml.circleci b/pom.xml.circleci
index f53bc69923c6..00cb33bc6c53 100644
--- a/pom.xml.circleci
+++ b/pom.xml.circleci
@@ -792,6 +792,8 @@
+ samples/client/petstore/go
+
samples/client/petstore/clojure
samples/client/petstore/java/feign
samples/client/petstore/java/jersey1
@@ -802,25 +804,9 @@
samples/client/petstore/java/retrofit2rx
samples/client/petstore/jaxrs-cxf-client
samples/client/petstore/java/resttemplate
-
-
-
+
samples/server/petstore/java-inflector
samples/server/petstore/java-play-framework
@@ -831,17 +817,15 @@
samples/server/petstore/jaxrs-resteasy/eap
samples/server/petstore/jaxrs-resteasy/eap-joda
samples/server/petstore/jaxrs-resteasy/joda
-
samples/server/petstore/spring-mvc
-
+ samples/client/petstore/spring-cloud
samples/server/petstore/springboot
samples/server/petstore/springboot-beanvalidation
samples/server/petstore/jaxrs-cxf
samples/server/petstore/jaxrs-cxf-annotated-base-path
samples/server/petstore/jaxrs-cxf-cdi
samples/server/petstore/jaxrs-cxf-non-spring-app
-
+ samples/server/petstore/java-msf4j
diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml b/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml
index d1f461da7fd5..808eacd00604 100644
--- a/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml
+++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml
@@ -1,10 +1,10 @@
4.0.0
io.swagger
- ObjcPetstoreClientTests
+ ObjcCoreDataPetstoreClientTests
pom
1.0-SNAPSHOT
- Objective-C Swagger Petstore Client
+ Objective-C Core Data Swagger Petstore Client
diff --git a/samples/client/petstore/swift/default/PetstoreClient.podspec b/samples/client/petstore/swift/default/PetstoreClient.podspec
index b712095c2dc1..5ddc2926f51d 100644
--- a/samples/client/petstore/swift/default/PetstoreClient.podspec
+++ b/samples/client/petstore/swift/default/PetstoreClient.podspec
@@ -9,5 +9,5 @@ Pod::Spec.new do |s|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
- s.dependency 'Alamofire', '~> 3.4.1'
+ s.dependency 'Alamofire', '~> 3.5.1'
end
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/README.md
deleted file mode 100644
index e0acf722db1d..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/README.md
+++ /dev/null
@@ -1,1297 +0,0 @@
-
-
-[](https://travis-ci.org/Alamofire/Alamofire)
-[](https://img.shields.io/cocoapods/v/Alamofire.svg)
-[](https://github.com/Carthage/Carthage)
-[](http://cocoadocs.org/docsets/Alamofire)
-[](http://twitter.com/AlamofireSF)
-
-Alamofire is an HTTP networking library written in Swift.
-
-## Features
-
-- [x] Chainable Request / Response methods
-- [x] URL / JSON / plist Parameter Encoding
-- [x] Upload File / Data / Stream / MultipartFormData
-- [x] Download using Request or Resume data
-- [x] Authentication with NSURLCredential
-- [x] HTTP Response Validation
-- [x] TLS Certificate and Public Key Pinning
-- [x] Progress Closure & NSProgress
-- [x] cURL Debug Output
-- [x] Comprehensive Unit Test Coverage
-- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire)
-
-## Component Libraries
-
-In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem.
-
-* [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system.
-* [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `NSURLSession` instances not managed by Alamofire.
-
-## Requirements
-
-- iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+
-- Xcode 7.3+
-
-## Migration Guides
-
-- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md)
-- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md)
-
-## Communication
-
-- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire')
-- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire).
-- If you **found a bug**, open an issue.
-- If you **have a feature request**, open an issue.
-- If you **want to contribute**, submit a pull request.
-
-## Installation
-
-> **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).**
->
-> Alamofire is no longer supported on iOS 7 due to the lack of support for frameworks. Without frameworks, running Travis-CI against iOS 7 would require a second duplicated test target. The separate test suite would need to import all the Swift files and the tests would need to be duplicated and re-written. This split would be too difficult to maintain to ensure the highest possible quality of the Alamofire ecosystem.
-
-### CocoaPods
-
-[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
-
-```bash
-$ gem install cocoapods
-```
-
-> CocoaPods 0.39.0+ is required to build Alamofire 3.0.0+.
-
-To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`:
-
-```ruby
-source 'https://github.com/CocoaPods/Specs.git'
-platform :ios, '9.0'
-use_frameworks!
-
-target '' do
- pod 'Alamofire', '~> 3.4'
-end
-```
-
-Then, run the following command:
-
-```bash
-$ pod install
-```
-
-### Carthage
-
-[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
-
-You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
-
-```bash
-$ brew update
-$ brew install carthage
-```
-
-To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`:
-
-```ogdl
-github "Alamofire/Alamofire" ~> 3.4
-```
-
-Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project.
-
-### Manually
-
-If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually.
-
-#### Embedded Framework
-
-- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
-
-```bash
-$ git init
-```
-
-- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command:
-
-```bash
-$ git submodule add https://github.com/Alamofire/Alamofire.git
-```
-
-- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project.
-
- > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.
-
-- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target.
-- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
-- In the tab bar at the top of that window, open the "General" panel.
-- Click on the `+` button under the "Embedded Binaries" section.
-- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder.
-
- > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`.
-
-- Select the top `Alamofire.framework` for iOS and the bottom one for OS X.
-
- > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS` or `Alamofire OSX`.
-
-- And that's it!
-
-> The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.
-
----
-
-## Usage
-
-### Making a Request
-
-```swift
-import Alamofire
-
-Alamofire.request(.GET, "https://httpbin.org/get")
-```
-
-### Response Handling
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .responseJSON { response in
- print(response.request) // original URL request
- print(response.response) // URL response
- print(response.data) // server data
- print(response.result) // result of response serialization
-
- if let JSON = response.result.value {
- print("JSON: \(JSON)")
- }
- }
-```
-
-> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way.
-
-> Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) is specified to handle the response once it's received. The result of a request is only available inside the scope of a response handler. Any execution contingent on the response or data received from the server must be done within a handler.
-
-### Validation
-
-By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type.
-
-#### Manual Validation
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate(statusCode: 200..<300)
- .validate(contentType: ["application/json"])
- .response { response in
- print(response)
- }
-```
-
-#### Automatic Validation
-
-Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided.
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .responseJSON { response in
- switch response.result {
- case .Success:
- print("Validation Successful")
- case .Failure(let error):
- print(error)
- }
- }
-```
-
-### Response Serialization
-
-**Built-in Response Methods**
-
-- `response()`
-- `responseData()`
-- `responseString(encoding: NSStringEncoding)`
-- `responseJSON(options: NSJSONReadingOptions)`
-- `responsePropertyList(options: NSPropertyListReadOptions)`
-
-#### Response Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .response { request, response, data, error in
- print(request)
- print(response)
- print(data)
- print(error)
- }
-```
-
-> The `response` serializer does NOT evaluate any of the response data. It merely forwards on all the information directly from the URL session delegate. We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types.
-
-#### Response Data Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .responseData { response in
- print(response.request)
- print(response.response)
- print(response.result)
- }
-```
-
-#### Response String Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
- .validate()
- .responseString { response in
- print("Success: \(response.result.isSuccess)")
- print("Response String: \(response.result.value)")
- }
-```
-
-#### Response JSON Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
- .validate()
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-#### Chained Response Handlers
-
-Response handlers can even be chained:
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
- .validate()
- .responseString { response in
- print("Response String: \(response.result.value)")
- }
- .responseJSON { response in
- print("Response JSON: \(response.result.value)")
- }
-```
-
-### HTTP Methods
-
-`Alamofire.Method` lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3):
-
-```swift
-public enum Method: String {
- case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT
-}
-```
-
-These values can be passed as the first argument of the `Alamofire.request` method:
-
-```swift
-Alamofire.request(.POST, "https://httpbin.org/post")
-
-Alamofire.request(.PUT, "https://httpbin.org/put")
-
-Alamofire.request(.DELETE, "https://httpbin.org/delete")
-```
-
-### Parameters
-
-#### GET Request With URL-Encoded Parameters
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
-// https://httpbin.org/get?foo=bar
-```
-
-#### POST Request With URL-Encoded Parameters
-
-```swift
-let parameters = [
- "foo": "bar",
- "baz": ["a", 1],
- "qux": [
- "x": 1,
- "y": 2,
- "z": 3
- ]
-]
-
-Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters)
-// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3
-```
-
-### Parameter Encoding
-
-Parameters can also be encoded as JSON, Property List, or any custom format, using the `ParameterEncoding` enum:
-
-```swift
-enum ParameterEncoding {
- case URL
- case URLEncodedInURL
- case JSON
- case PropertyList(format: NSPropertyListFormat, options: NSPropertyListWriteOptions)
- case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?))
-
- func encode(request: NSURLRequest, parameters: [String: AnyObject]?) -> (NSURLRequest, NSError?)
- { ... }
-}
-```
-
-- `URL`: A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. _Since there is no published specification for how to encode collection types, Alamofire follows the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`)._
-- `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same implementation as the `.URL` case, but always applies the encoded result to the URL.
-- `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`.
-- `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`.
-- `Custom`: Uses the associated closure value to construct a new request given an existing request and parameters.
-
-#### Manual Parameter Encoding of an NSURLRequest
-
-```swift
-let URL = NSURL(string: "https://httpbin.org/get")!
-var request = NSMutableURLRequest(URL: URL)
-
-let parameters = ["foo": "bar"]
-let encoding = Alamofire.ParameterEncoding.URL
-(request, _) = encoding.encode(request, parameters: parameters)
-```
-
-#### POST Request with JSON-encoded Parameters
-
-```swift
-let parameters = [
- "foo": [1,2,3],
- "bar": [
- "baz": "qux"
- ]
-]
-
-Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON)
-// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}}
-```
-
-### HTTP Headers
-
-Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing.
-
-> For HTTP headers that do not change, it is recommended to set them on the `NSURLSessionConfiguration` so they are automatically applied to any `NSURLSessionTask` created by the underlying `NSURLSession`.
-
-```swift
-let headers = [
- "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
- "Accept": "application/json"
-]
-
-Alamofire.request(.GET, "https://httpbin.org/get", headers: headers)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-### Caching
-
-Caching is handled on the system framework level by [`NSURLCache`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache).
-
-### Uploading
-
-**Supported Upload Types**
-
-- File
-- Data
-- Stream
-- MultipartFormData
-
-#### Uploading a File
-
-```swift
-let fileURL = NSBundle.mainBundle().URLForResource("Default", withExtension: "png")
-Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL)
-```
-
-#### Uploading with Progress
-
-```swift
-Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL)
- .progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in
- print(totalBytesWritten)
-
- // This closure is NOT called on the main queue for performance
- // reasons. To update your ui, dispatch to the main queue.
- dispatch_async(dispatch_get_main_queue()) {
- print("Total bytes written on main queue: \(totalBytesWritten)")
- }
- }
- .validate()
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-#### Uploading MultipartFormData
-
-```swift
-Alamofire.upload(
- .POST,
- "https://httpbin.org/post",
- multipartFormData: { multipartFormData in
- multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn")
- multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow")
- },
- encodingCompletion: { encodingResult in
- switch encodingResult {
- case .Success(let upload, _, _):
- upload.responseJSON { response in
- debugPrint(response)
- }
- case .Failure(let encodingError):
- print(encodingError)
- }
- }
-)
-```
-
-### Downloading
-
-**Supported Download Types**
-
-- Request
-- Resume Data
-
-#### Downloading a File
-
-```swift
-Alamofire.download(.GET, "https://httpbin.org/stream/100") { temporaryURL, response in
- let fileManager = NSFileManager.defaultManager()
- let directoryURL = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]
- let pathComponent = response.suggestedFilename
-
- return directoryURL.URLByAppendingPathComponent(pathComponent!)
-}
-```
-
-#### Using the Default Download Destination
-
-```swift
-let destination = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask)
-Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
-```
-
-#### Downloading a File w/Progress
-
-```swift
-Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
- .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in
- print(totalBytesRead)
-
- // This closure is NOT called on the main queue for performance
- // reasons. To update your ui, dispatch to the main queue.
- dispatch_async(dispatch_get_main_queue()) {
- print("Total bytes read on main queue: \(totalBytesRead)")
- }
- }
- .response { _, _, _, error in
- if let error = error {
- print("Failed with error: \(error)")
- } else {
- print("Downloaded file successfully")
- }
- }
-```
-
-#### Accessing Resume Data for Failed Downloads
-
-```swift
-Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
- .response { _, _, data, _ in
- if let
- data = data,
- resumeDataString = NSString(data: data, encoding: NSUTF8StringEncoding)
- {
- print("Resume Data: \(resumeDataString)")
- } else {
- print("Resume Data was empty")
- }
- }
-```
-
-> The `data` parameter is automatically populated with the `resumeData` if available.
-
-```swift
-let download = Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
-download.response { _, _, _, _ in
- if let
- resumeData = download.resumeData,
- resumeDataString = NSString(data: resumeData, encoding: NSUTF8StringEncoding)
- {
- print("Resume Data: \(resumeDataString)")
- } else {
- print("Resume Data was empty")
- }
-}
-```
-
-### Authentication
-
-Authentication is handled on the system framework level by [`NSURLCredential` and `NSURLAuthenticationChallenge`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html).
-
-**Supported Authentication Schemes**
-
-- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication)
-- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication)
-- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29)
-- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager)
-
-#### HTTP Basic Authentication
-
-The `authenticate` method on a `Request` will automatically provide an `NSURLCredential` to an `NSURLAuthenticationChallenge` when appropriate:
-
-```swift
-let user = "user"
-let password = "password"
-
-Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)")
- .authenticate(user: user, password: password)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-Depending upon your server implementation, an `Authorization` header may also be appropriate:
-
-```swift
-let user = "user"
-let password = "password"
-
-let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)!
-let base64Credentials = credentialData.base64EncodedStringWithOptions([])
-
-let headers = ["Authorization": "Basic \(base64Credentials)"]
-
-Alamofire.request(.GET, "https://httpbin.org/basic-auth/user/password", headers: headers)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-#### Authentication with NSURLCredential
-
-```swift
-let user = "user"
-let password = "password"
-
-let credential = NSURLCredential(user: user, password: password, persistence: .ForSession)
-
-Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)")
- .authenticate(usingCredential: credential)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-### Timeline
-
-Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on a `Response`.
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .responseJSON { response in
- print(response.timeline)
- }
-```
-
-The above reports the following `Timeline` info:
-
-- `Latency`: 0.428 seconds
-- `Request Duration`: 0.428 seconds
-- `Serialization Duration`: 0.001 seconds
-- `Total Duration`: 0.429 seconds
-
-### Printable
-
-```swift
-let request = Alamofire.request(.GET, "https://httpbin.org/ip")
-
-print(request)
-// GET https://httpbin.org/ip (200)
-```
-
-### DebugPrintable
-
-```swift
-let request = Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
-
-debugPrint(request)
-```
-
-#### Output (cURL)
-
-```bash
-$ curl -i \
- -H "User-Agent: Alamofire" \
- -H "Accept-Encoding: Accept-Encoding: gzip;q=1.0,compress;q=0.5" \
- -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \
- "https://httpbin.org/get?foo=bar"
-```
-
----
-
-## Advanced Usage
-
-> Alamofire is built on `NSURLSession` and the Foundation URL Loading System. To make the most of
-this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack.
-
-**Recommended Reading**
-
-- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html)
-- [NSURLSession Class Reference](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/Introduction/Introduction.html#//apple_ref/occ/cl/NSURLSession)
-- [NSURLCache Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache)
-- [NSURLAuthenticationChallenge Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html)
-
-### Manager
-
-Top-level convenience methods like `Alamofire.request` use a shared instance of `Alamofire.Manager`, which is configured with the default `NSURLSessionConfiguration`.
-
-As such, the following two statements are equivalent:
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
-```
-
-```swift
-let manager = Alamofire.Manager.sharedInstance
-manager.request(NSURLRequest(URL: NSURL(string: "https://httpbin.org/get")!))
-```
-
-Applications can create managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`HTTPAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`).
-
-#### Creating a Manager with Default Configuration
-
-```swift
-let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-#### Creating a Manager with Background Configuration
-
-```swift
-let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier("com.example.app.background")
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-#### Creating a Manager with Ephemeral Configuration
-
-```swift
-let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration()
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-#### Modifying Session Configuration
-
-```swift
-var defaultHeaders = Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders ?? [:]
-defaultHeaders["DNT"] = "1 (Do Not Track Enabled)"
-
-let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
-configuration.HTTPAdditionalHeaders = defaultHeaders
-
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use `URLRequestConvertible` and `ParameterEncoding`, respectively.
-
-### Request
-
-The result of a `request`, `upload`, or `download` method is an instance of `Alamofire.Request`. A request is always created using a constructor method from an owning manager, and never initialized directly.
-
-Methods like `authenticate`, `validate` and `responseData` return the caller in order to facilitate chaining.
-
-Requests can be suspended, resumed, and cancelled:
-
-- `suspend()`: Suspends the underlying task and dispatch queue
-- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start.
-- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers.
-
-### Response Serialization
-
-#### Handling Errors
-
-Before implementing custom response serializers or object serialization methods, it's important to be prepared to handle any errors that may occur. Alamofire recommends handling these through the use of either your own `NSError` creation methods, or a simple `enum` that conforms to `ErrorType`. For example, this `BackendError` type, which will be used in later examples:
-
-```swift
-public enum BackendError: ErrorType {
- case Network(error: NSError)
- case DataSerialization(reason: String)
- case JSONSerialization(error: NSError)
- case ObjectSerialization(reason: String)
- case XMLSerialization(error: NSError)
-}
-```
-
-#### Creating a Custom Response Serializer
-
-Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.Request`.
-
-For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented:
-
-```swift
-extension Request {
- public static func XMLResponseSerializer() -> ResponseSerializer {
- return ResponseSerializer { request, response, data, error in
- guard error == nil else { return .Failure(.Network(error: error!)) }
-
- guard let validData = data else {
- return .Failure(.DataSerialization(reason: "Data could not be serialized. Input data was nil."))
- }
-
- do {
- let XML = try ONOXMLDocument(data: validData)
- return .Success(XML)
- } catch {
- return .Failure(.XMLSerialization(error: error as NSError))
- }
- }
- }
-
- public func responseXMLDocument(completionHandler: Response -> Void) -> Self {
- return response(responseSerializer: Request.XMLResponseSerializer(), completionHandler: completionHandler)
- }
-}
-```
-
-#### Generic Response Object Serialization
-
-Generics can be used to provide automatic, type-safe response object serialization.
-
-```swift
-public protocol ResponseObjectSerializable {
- init?(response: NSHTTPURLResponse, representation: AnyObject)
-}
-
-extension Request {
- public func responseObject(completionHandler: Response -> Void) -> Self {
- let responseSerializer = ResponseSerializer { request, response, data, error in
- guard error == nil else { return .Failure(.Network(error: error!)) }
-
- let JSONResponseSerializer = Request.JSONResponseSerializer(options: .AllowFragments)
- let result = JSONResponseSerializer.serializeResponse(request, response, data, error)
-
- switch result {
- case .Success(let value):
- if let
- response = response,
- responseObject = T(response: response, representation: value)
- {
- return .Success(responseObject)
- } else {
- return .Failure(.ObjectSerialization(reason: "JSON could not be serialized into response object: \(value)"))
- }
- case .Failure(let error):
- return .Failure(.JSONSerialization(error: error))
- }
- }
-
- return response(responseSerializer: responseSerializer, completionHandler: completionHandler)
- }
-}
-```
-
-```swift
-final class User: ResponseObjectSerializable {
- let username: String
- let name: String
-
- init?(response: NSHTTPURLResponse, representation: AnyObject) {
- self.username = response.URL!.lastPathComponent!
- self.name = representation.valueForKeyPath("name") as! String
- }
-}
-```
-
-```swift
-Alamofire.request(.GET, "https://example.com/users/mattt")
- .responseObject { (response: Response) in
- debugPrint(response)
- }
-```
-
-The same approach can also be used to handle endpoints that return a representation of a collection of objects:
-
-```swift
-public protocol ResponseCollectionSerializable {
- static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self]
-}
-
-extension ResponseCollectionSerializable where Self: ResponseObjectSerializable {
- static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self] {
- var collection = [Self]()
-
- if let representation = representation as? [[String: AnyObject]] {
- for itemRepresentation in representation {
- if let item = Self(response: response, representation: itemRepresentation) {
- collection.append(item)
- }
- }
- }
-
- return collection
- }
-}
-
-extension Alamofire.Request {
- public func responseCollection(completionHandler: Response<[T], BackendError> -> Void) -> Self {
- let responseSerializer = ResponseSerializer<[T], BackendError> { request, response, data, error in
- guard error == nil else { return .Failure(.Network(error: error!)) }
-
- let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments)
- let result = JSONSerializer.serializeResponse(request, response, data, error)
-
- switch result {
- case .Success(let value):
- if let response = response {
- return .Success(T.collection(response: response, representation: value))
- } else {
- return .Failure(. ObjectSerialization(reason: "Response collection could not be serialized due to nil response"))
- }
- case .Failure(let error):
- return .Failure(.JSONSerialization(error: error))
- }
- }
-
- return response(responseSerializer: responseSerializer, completionHandler: completionHandler)
- }
-}
-```
-
-```swift
-final class User: ResponseObjectSerializable, ResponseCollectionSerializable {
- let username: String
- let name: String
-
- init?(response: NSHTTPURLResponse, representation: AnyObject) {
- self.username = response.URL!.lastPathComponent!
- self.name = representation.valueForKeyPath("name") as! String
- }
-}
-```
-
-```swift
-Alamofire.request(.GET, "http://example.com/users")
- .responseCollection { (response: Response<[User], BackendError>) in
- debugPrint(response)
- }
-```
-
-### URLStringConvertible
-
-Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to construct URL requests. `NSString`, `NSURL`, `NSURLComponents`, and `NSURLRequest` conform to `URLStringConvertible` by default, allowing any of them to be passed as `URLString` parameters to the `request`, `upload`, and `download` methods:
-
-```swift
-let string = NSString(string: "https://httpbin.org/post")
-Alamofire.request(.POST, string)
-
-let URL = NSURL(string: string)!
-Alamofire.request(.POST, URL)
-
-let URLRequest = NSURLRequest(URL: URL)
-Alamofire.request(.POST, URLRequest) // overrides `HTTPMethod` of `URLRequest`
-
-let URLComponents = NSURLComponents(URL: URL, resolvingAgainstBaseURL: true)
-Alamofire.request(.POST, URLComponents)
-```
-
-Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLStringConvertible` as a convenient way to map domain-specific models to server resources.
-
-#### Type-Safe Routing
-
-```swift
-extension User: URLStringConvertible {
- static let baseURLString = "http://example.com"
-
- var URLString: String {
- return User.baseURLString + "/users/\(username)/"
- }
-}
-```
-
-```swift
-let user = User(username: "mattt")
-Alamofire.request(.GET, user) // http://example.com/users/mattt
-```
-
-### URLRequestConvertible
-
-Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `NSURLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests):
-
-```swift
-let URL = NSURL(string: "https://httpbin.org/post")!
-let mutableURLRequest = NSMutableURLRequest(URL: URL)
-mutableURLRequest.HTTPMethod = "POST"
-
-let parameters = ["foo": "bar"]
-
-do {
- mutableURLRequest.HTTPBody = try NSJSONSerialization.dataWithJSONObject(parameters, options: NSJSONWritingOptions())
-} catch {
- // No-op
-}
-
-mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
-
-Alamofire.request(mutableURLRequest)
-```
-
-Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state.
-
-#### API Parameter Abstraction
-
-```swift
-enum Router: URLRequestConvertible {
- static let baseURLString = "http://example.com"
- static let perPage = 50
-
- case Search(query: String, page: Int)
-
- // MARK: URLRequestConvertible
-
- var URLRequest: NSMutableURLRequest {
- let result: (path: String, parameters: [String: AnyObject]) = {
- switch self {
- case .Search(let query, let page) where page > 0:
- return ("/search", ["q": query, "offset": Router.perPage * page])
- case .Search(let query, _):
- return ("/search", ["q": query])
- }
- }()
-
- let URL = NSURL(string: Router.baseURLString)!
- let URLRequest = NSURLRequest(URL: URL.URLByAppendingPathComponent(result.path))
- let encoding = Alamofire.ParameterEncoding.URL
-
- return encoding.encode(URLRequest, parameters: result.parameters).0
- }
-}
-```
-
-```swift
-Alamofire.request(Router.Search(query: "foo bar", page: 1)) // ?q=foo%20bar&offset=50
-```
-
-#### CRUD & Authorization
-
-```swift
-enum Router: URLRequestConvertible {
- static let baseURLString = "http://example.com"
- static var OAuthToken: String?
-
- case CreateUser([String: AnyObject])
- case ReadUser(String)
- case UpdateUser(String, [String: AnyObject])
- case DestroyUser(String)
-
- var method: Alamofire.Method {
- switch self {
- case .CreateUser:
- return .POST
- case .ReadUser:
- return .GET
- case .UpdateUser:
- return .PUT
- case .DestroyUser:
- return .DELETE
- }
- }
-
- var path: String {
- switch self {
- case .CreateUser:
- return "/users"
- case .ReadUser(let username):
- return "/users/\(username)"
- case .UpdateUser(let username, _):
- return "/users/\(username)"
- case .DestroyUser(let username):
- return "/users/\(username)"
- }
- }
-
- // MARK: URLRequestConvertible
-
- var URLRequest: NSMutableURLRequest {
- let URL = NSURL(string: Router.baseURLString)!
- let mutableURLRequest = NSMutableURLRequest(URL: URL.URLByAppendingPathComponent(path))
- mutableURLRequest.HTTPMethod = method.rawValue
-
- if let token = Router.OAuthToken {
- mutableURLRequest.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
- }
-
- switch self {
- case .CreateUser(let parameters):
- return Alamofire.ParameterEncoding.JSON.encode(mutableURLRequest, parameters: parameters).0
- case .UpdateUser(_, let parameters):
- return Alamofire.ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0
- default:
- return mutableURLRequest
- }
- }
-}
-```
-
-```swift
-Alamofire.request(Router.ReadUser("mattt")) // GET /users/mattt
-```
-
-### SessionDelegate
-
-By default, an Alamofire `Manager` instance creates an internal `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `NSURLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons.
-
-#### Override Closures
-
-The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available:
-
-```swift
-/// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`.
-public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
-
-/// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`.
-public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)?
-
-/// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`.
-public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)?
-
-/// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`.
-public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)?
-```
-
-The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains.
-
-```swift
-let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
-
-delegate.taskWillPerformHTTPRedirection = { session, task, response, request in
- var finalRequest = request
-
- if let originalRequest = task.originalRequest where originalRequest.URLString.containsString("apple.com") {
- finalRequest = originalRequest
- }
-
- return finalRequest
-}
-```
-
-#### Subclassing
-
-Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs.
-
-```swift
-class LoggingSessionDelegate: Manager.SessionDelegate {
- override func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- willPerformHTTPRedirection response: NSHTTPURLResponse,
- newRequest request: NSURLRequest,
- completionHandler: NSURLRequest? -> Void)
- {
- print("URLSession will perform HTTP redirection to request: \(request)")
-
- super.URLSession(
- session,
- task: task,
- willPerformHTTPRedirection: response,
- newRequest: request,
- completionHandler: completionHandler
- )
- }
-}
-```
-
-Generally, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort.
-
-> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks.
-
-### Security
-
-Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`.
-
-#### ServerTrustPolicy
-
-The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection.
-
-```swift
-let serverTrustPolicy = ServerTrustPolicy.PinCertificates(
- certificates: ServerTrustPolicy.certificatesInBundle(),
- validateCertificateChain: true,
- validateHost: true
-)
-```
-
-There are many different cases of server trust evaluation giving you complete control over the validation process:
-
-* `PerformDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge.
-* `PinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates.
-* `PinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys.
-* `DisableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid.
-* `CustomEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution.
-
-#### Server Trust Policy Manager
-
-The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy.
-
-```swift
-let serverTrustPolicies: [String: ServerTrustPolicy] = [
- "test.example.com": .PinCertificates(
- certificates: ServerTrustPolicy.certificatesInBundle(),
- validateCertificateChain: true,
- validateHost: true
- ),
- "insecure.expired-apis.com": .DisableEvaluation
-]
-
-let manager = Manager(
- serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies)
-)
-```
-
-> Make sure to keep a reference to the new `Manager` instance, otherwise your requests will all get cancelled when your `manager` is deallocated.
-
-These server trust policies will result in the following behavior:
-
-* `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed:
- * Certificate chain MUST be valid.
- * Certificate chain MUST include one of the pinned certificates.
- * Challenge host MUST match the host in the certificate chain's leaf certificate.
-* `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed.
-* All other hosts will use the default evaluation provided by Apple.
-
-##### Subclassing Server Trust Policy Manager
-
-If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation.
-
-```swift
-class CustomServerTrustPolicyManager: ServerTrustPolicyManager {
- override func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? {
- var policy: ServerTrustPolicy?
-
- // Implement your custom domain matching behavior...
-
- return policy
- }
-}
-```
-
-#### Validating the Host
-
-The `.PerformDefaultEvaluation`, `.PinCertificates` and `.PinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate.
-
-> It is recommended that `validateHost` always be set to `true` in production environments.
-
-#### Validating the Certificate Chain
-
-Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check.
-
-There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server.
-
-> It is recommended that `validateCertificateChain` always be set to `true` in production environments.
-
-#### App Transport Security
-
-With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust.
-
-If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`.
-
-```xml
-
- NSAppTransportSecurity
-
- NSExceptionDomains
-
- example.com
-
- NSExceptionAllowsInsecureHTTPLoads
-
- NSExceptionRequiresForwardSecrecy
-
- NSIncludesSubdomains
-
-
- NSTemporaryExceptionMinimumTLSVersion
- TLSv1.2
-
-
-
-
-```
-
-Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`.
-
-> It is recommended to always use valid certificates in production environments.
-
-### Network Reachability
-
-The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces.
-
-```swift
-let manager = NetworkReachabilityManager(host: "www.apple.com")
-
-manager?.listener = { status in
- print("Network Status Changed: \(status)")
-}
-
-manager?.startListening()
-```
-
-> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported.
-
-There are some important things to remember when using network reachability to determine what to do next.
-
-* **Do NOT** use Reachability to determine if a network request should be sent.
- * You should **ALWAYS** send it.
-* When Reachability is restored, use the event to retry failed network requests.
- * Even though the network requests may still fail, this is a good moment to retry them.
-* The network reachability status can be useful for determining why a network request may have failed.
- * If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out."
-
-> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info.
-
----
-
-## Open Rdars
-
-The following rdars have some affect on the current implementation of Alamofire.
-
-* [rdar://21349340](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case
-* [rdar://26761490](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage
-
-## FAQ
-
-### What's the origin of the name Alamofire?
-
-Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas.
-
----
-
-## Credits
-
-Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases.
-
-### Security Disclosure
-
-If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker.
-
-## Donations
-
-The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to:
-
-* Pay our legal fees to register as a federal non-profit organization
-* Pay our yearly legal fees to keep the non-profit in good status
-* Pay for our mail servers to help us stay on top of all questions and security issues
-* Potentially fund test servers to make it easier for us to test the edge cases
-* Potentially fund developers to work on one of our projects full-time
-
-The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiam around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated.
-
-
-
-## License
-
-Alamofire is released under the MIT license. See LICENSE for details.
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift
deleted file mode 100644
index 0945204dccaa..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift
+++ /dev/null
@@ -1,369 +0,0 @@
-//
-// Alamofire.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-// MARK: - URLStringConvertible
-
-/**
- Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to
- construct URL requests.
-*/
-public protocol URLStringConvertible {
- /**
- A URL that conforms to RFC 2396.
-
- Methods accepting a `URLStringConvertible` type parameter parse it according to RFCs 1738 and 1808.
-
- See https://tools.ietf.org/html/rfc2396
- See https://tools.ietf.org/html/rfc1738
- See https://tools.ietf.org/html/rfc1808
- */
- var URLString: String { get }
-}
-
-extension String: URLStringConvertible {
- public var URLString: String { return self }
-}
-
-extension NSURL: URLStringConvertible {
- public var URLString: String { return absoluteString }
-}
-
-extension NSURLComponents: URLStringConvertible {
- public var URLString: String { return URL!.URLString }
-}
-
-extension NSURLRequest: URLStringConvertible {
- public var URLString: String { return URL!.URLString }
-}
-
-// MARK: - URLRequestConvertible
-
-/**
- Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests.
-*/
-public protocol URLRequestConvertible {
- /// The URL request.
- var URLRequest: NSMutableURLRequest { get }
-}
-
-extension NSURLRequest: URLRequestConvertible {
- public var URLRequest: NSMutableURLRequest { return self.mutableCopy() as! NSMutableURLRequest }
-}
-
-// MARK: - Convenience
-
-func URLRequest(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil)
- -> NSMutableURLRequest
-{
- let mutableURLRequest: NSMutableURLRequest
-
- if let request = URLString as? NSMutableURLRequest {
- mutableURLRequest = request
- } else if let request = URLString as? NSURLRequest {
- mutableURLRequest = request.URLRequest
- } else {
- mutableURLRequest = NSMutableURLRequest(URL: NSURL(string: URLString.URLString)!)
- }
-
- mutableURLRequest.HTTPMethod = method.rawValue
-
- if let headers = headers {
- for (headerField, headerValue) in headers {
- mutableURLRequest.setValue(headerValue, forHTTPHeaderField: headerField)
- }
- }
-
- return mutableURLRequest
-}
-
-// MARK: - Request Methods
-
-/**
- Creates a request using the shared manager instance for the specified method, URL string, parameters, and
- parameter encoding.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
-
- - returns: The created request.
-*/
-public func request(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil)
- -> Request
-{
- return Manager.sharedInstance.request(
- method,
- URLString,
- parameters: parameters,
- encoding: encoding,
- headers: headers
- )
-}
-
-/**
- Creates a request using the shared manager instance for the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
-
- - returns: The created request.
-*/
-public func request(URLRequest: URLRequestConvertible) -> Request {
- return Manager.sharedInstance.request(URLRequest.URLRequest)
-}
-
-// MARK: - Upload Methods
-
-// MARK: File
-
-/**
- Creates an upload request using the shared manager instance for the specified method, URL string, and file.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter file: The file to upload.
-
- - returns: The created upload request.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- file: NSURL)
- -> Request
-{
- return Manager.sharedInstance.upload(method, URLString, headers: headers, file: file)
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified URL request and file.
-
- - parameter URLRequest: The URL request.
- - parameter file: The file to upload.
-
- - returns: The created upload request.
-*/
-public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request {
- return Manager.sharedInstance.upload(URLRequest, file: file)
-}
-
-// MARK: Data
-
-/**
- Creates an upload request using the shared manager instance for the specified method, URL string, and data.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter data: The data to upload.
-
- - returns: The created upload request.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- data: NSData)
- -> Request
-{
- return Manager.sharedInstance.upload(method, URLString, headers: headers, data: data)
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified URL request and data.
-
- - parameter URLRequest: The URL request.
- - parameter data: The data to upload.
-
- - returns: The created upload request.
-*/
-public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request {
- return Manager.sharedInstance.upload(URLRequest, data: data)
-}
-
-// MARK: Stream
-
-/**
- Creates an upload request using the shared manager instance for the specified method, URL string, and stream.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- stream: NSInputStream)
- -> Request
-{
- return Manager.sharedInstance.upload(method, URLString, headers: headers, stream: stream)
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified URL request and stream.
-
- - parameter URLRequest: The URL request.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
-*/
-public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request {
- return Manager.sharedInstance.upload(URLRequest, stream: stream)
-}
-
-// MARK: MultipartFormData
-
-/**
- Creates an upload request using the shared manager instance for the specified method and URL string.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?)
-{
- return Manager.sharedInstance.upload(
- method,
- URLString,
- headers: headers,
- multipartFormData: multipartFormData,
- encodingMemoryThreshold: encodingMemoryThreshold,
- encodingCompletion: encodingCompletion
- )
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified method and URL string.
-
- - parameter URLRequest: The URL request.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
-*/
-public func upload(
- URLRequest: URLRequestConvertible,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?)
-{
- return Manager.sharedInstance.upload(
- URLRequest,
- multipartFormData: multipartFormData,
- encodingMemoryThreshold: encodingMemoryThreshold,
- encodingCompletion: encodingCompletion
- )
-}
-
-// MARK: - Download Methods
-
-// MARK: URL Request
-
-/**
- Creates a download request using the shared manager instance for the specified method and URL string.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
-*/
-public func download(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil,
- destination: Request.DownloadFileDestination)
- -> Request
-{
- return Manager.sharedInstance.download(
- method,
- URLString,
- parameters: parameters,
- encoding: encoding,
- headers: headers,
- destination: destination
- )
-}
-
-/**
- Creates a download request using the shared manager instance for the specified URL request.
-
- - parameter URLRequest: The URL request.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
-*/
-public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request {
- return Manager.sharedInstance.download(URLRequest, destination: destination)
-}
-
-// MARK: Resume Data
-
-/**
- Creates a request using the shared manager instance for downloading from the resume data produced from a
- previous request cancellation.
-
- - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask`
- when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional
- information.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
-*/
-public func download(resumeData data: NSData, destination: Request.DownloadFileDestination) -> Request {
- return Manager.sharedInstance.download(data, destination: destination)
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Download.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Download.swift
deleted file mode 100644
index 52e90badfdea..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Download.swift
+++ /dev/null
@@ -1,248 +0,0 @@
-//
-// Download.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-extension Manager {
- private enum Downloadable {
- case Request(NSURLRequest)
- case ResumeData(NSData)
- }
-
- private func download(downloadable: Downloadable, destination: Request.DownloadFileDestination) -> Request {
- var downloadTask: NSURLSessionDownloadTask!
-
- switch downloadable {
- case .Request(let request):
- dispatch_sync(queue) {
- downloadTask = self.session.downloadTaskWithRequest(request)
- }
- case .ResumeData(let resumeData):
- dispatch_sync(queue) {
- downloadTask = self.session.downloadTaskWithResumeData(resumeData)
- }
- }
-
- let request = Request(session: session, task: downloadTask)
-
- if let downloadDelegate = request.delegate as? Request.DownloadTaskDelegate {
- downloadDelegate.downloadTaskDidFinishDownloadingToURL = { session, downloadTask, URL in
- return destination(URL, downloadTask.response as! NSHTTPURLResponse)
- }
- }
-
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- // MARK: Request
-
- /**
- Creates a download request for the specified method, URL string, parameters, parameter encoding, headers
- and destination.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
- */
- public func download(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil,
- destination: Request.DownloadFileDestination)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
- let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0
-
- return download(encodedURLRequest, destination: destination)
- }
-
- /**
- Creates a request for downloading from the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
- */
- public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request {
- return download(.Request(URLRequest.URLRequest), destination: destination)
- }
-
- // MARK: Resume Data
-
- /**
- Creates a request for downloading from the resume data produced from a previous request cancellation.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask`
- when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for
- additional information.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
- */
- public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request {
- return download(.ResumeData(resumeData), destination: destination)
- }
-}
-
-// MARK: -
-
-extension Request {
- /**
- A closure executed once a request has successfully completed in order to determine where to move the temporary
- file written to during the download process. The closure takes two arguments: the temporary file URL and the URL
- response, and returns a single argument: the file URL where the temporary file should be moved.
- */
- public typealias DownloadFileDestination = (NSURL, NSHTTPURLResponse) -> NSURL
-
- /**
- Creates a download file destination closure which uses the default file manager to move the temporary file to a
- file URL in the first available directory with the specified search path directory and search path domain mask.
-
- - parameter directory: The search path directory. `.DocumentDirectory` by default.
- - parameter domain: The search path domain mask. `.UserDomainMask` by default.
-
- - returns: A download file destination closure.
- */
- public class func suggestedDownloadDestination(
- directory directory: NSSearchPathDirectory = .DocumentDirectory,
- domain: NSSearchPathDomainMask = .UserDomainMask)
- -> DownloadFileDestination
- {
- return { temporaryURL, response -> NSURL in
- let directoryURLs = NSFileManager.defaultManager().URLsForDirectory(directory, inDomains: domain)
-
- if !directoryURLs.isEmpty {
- return directoryURLs[0].URLByAppendingPathComponent(response.suggestedFilename!)
- }
-
- return temporaryURL
- }
- }
-
- /// The resume data of the underlying download task if available after a failure.
- public var resumeData: NSData? {
- var data: NSData?
-
- if let delegate = delegate as? DownloadTaskDelegate {
- data = delegate.resumeData
- }
-
- return data
- }
-
- // MARK: - DownloadTaskDelegate
-
- class DownloadTaskDelegate: TaskDelegate, NSURLSessionDownloadDelegate {
- var downloadTask: NSURLSessionDownloadTask? { return task as? NSURLSessionDownloadTask }
- var downloadProgress: ((Int64, Int64, Int64) -> Void)?
-
- var resumeData: NSData?
- override var data: NSData? { return resumeData }
-
- // MARK: - NSURLSessionDownloadDelegate
-
- // MARK: Override Closures
-
- var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> NSURL)?
- var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)?
- var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didFinishDownloadingToURL location: NSURL)
- {
- if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL {
- do {
- let destination = downloadTaskDidFinishDownloadingToURL(session, downloadTask, location)
- try NSFileManager.defaultManager().moveItemAtURL(location, toURL: destination)
- } catch {
- self.error = error as NSError
- }
- }
- }
-
- func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didWriteData bytesWritten: Int64,
- totalBytesWritten: Int64,
- totalBytesExpectedToWrite: Int64)
- {
- if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
-
- if let downloadTaskDidWriteData = downloadTaskDidWriteData {
- downloadTaskDidWriteData(
- session,
- downloadTask,
- bytesWritten,
- totalBytesWritten,
- totalBytesExpectedToWrite
- )
- } else {
- progress.totalUnitCount = totalBytesExpectedToWrite
- progress.completedUnitCount = totalBytesWritten
-
- downloadProgress?(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite)
- }
- }
-
- func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didResumeAtOffset fileOffset: Int64,
- expectedTotalBytes: Int64)
- {
- if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset {
- downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes)
- } else {
- progress.totalUnitCount = expectedTotalBytes
- progress.completedUnitCount = fileOffset
- }
- }
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Error.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Error.swift
deleted file mode 100644
index 467d99c916c5..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Error.swift
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// Error.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// The `Error` struct provides a convenience for creating custom Alamofire NSErrors.
-public struct Error {
- /// The domain used for creating all Alamofire errors.
- public static let Domain = "com.alamofire.error"
-
- /// The custom error codes generated by Alamofire.
- public enum Code: Int {
- case InputStreamReadFailed = -6000
- case OutputStreamWriteFailed = -6001
- case ContentTypeValidationFailed = -6002
- case StatusCodeValidationFailed = -6003
- case DataSerializationFailed = -6004
- case StringSerializationFailed = -6005
- case JSONSerializationFailed = -6006
- case PropertyListSerializationFailed = -6007
- }
-
- /// Custom keys contained within certain NSError `userInfo` dictionaries generated by Alamofire.
- public struct UserInfoKeys {
- /// The content type user info key for a `.ContentTypeValidationFailed` error stored as a `String` value.
- public static let ContentType = "ContentType"
-
- /// The status code user info key for a `.StatusCodeValidationFailed` error stored as an `Int` value.
- public static let StatusCode = "StatusCode"
- }
-
- /**
- Creates an `NSError` with the given error code and failure reason.
-
- - parameter code: The error code.
- - parameter failureReason: The failure reason.
-
- - returns: An `NSError` with the given error code and failure reason.
- */
- @available(*, deprecated=3.4.0)
- public static func errorWithCode(code: Code, failureReason: String) -> NSError {
- return errorWithCode(code.rawValue, failureReason: failureReason)
- }
-
- /**
- Creates an `NSError` with the given error code and failure reason.
-
- - parameter code: The error code.
- - parameter failureReason: The failure reason.
-
- - returns: An `NSError` with the given error code and failure reason.
- */
- @available(*, deprecated=3.4.0)
- public static func errorWithCode(code: Int, failureReason: String) -> NSError {
- let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason]
- return NSError(domain: Domain, code: code, userInfo: userInfo)
- }
-
- static func error(domain domain: String = Error.Domain, code: Code, failureReason: String) -> NSError {
- return error(domain: domain, code: code.rawValue, failureReason: failureReason)
- }
-
- static func error(domain domain: String = Error.Domain, code: Int, failureReason: String) -> NSError {
- let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason]
- return NSError(domain: domain, code: code, userInfo: userInfo)
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift
deleted file mode 100644
index cbfb5c77bff5..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift
+++ /dev/null
@@ -1,779 +0,0 @@
-//
-// Manager.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/**
- Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`.
-*/
-public class Manager {
-
- // MARK: - Properties
-
- /**
- A shared instance of `Manager`, used by top-level Alamofire request methods, and suitable for use directly
- for any ad hoc requests.
- */
- public static let sharedInstance: Manager = {
- let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
- configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders
-
- return Manager(configuration: configuration)
- }()
-
- /**
- Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers.
- */
- public static let defaultHTTPHeaders: [String: String] = {
- // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3
- let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5"
-
- // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5
- let acceptLanguage = NSLocale.preferredLanguages().prefix(6).enumerate().map { index, languageCode in
- let quality = 1.0 - (Double(index) * 0.1)
- return "\(languageCode);q=\(quality)"
- }.joinWithSeparator(", ")
-
- // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3
- let userAgent: String = {
- if let info = NSBundle.mainBundle().infoDictionary {
- let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown"
- let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown"
- let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown"
- let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown"
-
- let osNameVersion: String = {
- let versionString: String
-
- if #available(OSX 10.10, *) {
- let version = NSProcessInfo.processInfo().operatingSystemVersion
- versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)"
- } else {
- versionString = "10.9"
- }
-
- let osName: String = {
- #if os(iOS)
- return "iOS"
- #elseif os(watchOS)
- return "watchOS"
- #elseif os(tvOS)
- return "tvOS"
- #elseif os(OSX)
- return "OS X"
- #elseif os(Linux)
- return "Linux"
- #else
- return "Unknown"
- #endif
- }()
-
- return "\(osName) \(versionString)"
- }()
-
- return "\(executable)/\(bundle) (\(appVersion)/\(appBuild)); \(osNameVersion))"
- }
-
- return "Alamofire"
- }()
-
- return [
- "Accept-Encoding": acceptEncoding,
- "Accept-Language": acceptLanguage,
- "User-Agent": userAgent
- ]
- }()
-
- let queue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL)
-
- /// The underlying session.
- public let session: NSURLSession
-
- /// The session delegate handling all the task and session delegate callbacks.
- public let delegate: SessionDelegate
-
- /// Whether to start requests immediately after being constructed. `true` by default.
- public var startRequestsImmediately: Bool = true
-
- /**
- The background completion handler closure provided by the UIApplicationDelegate
- `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background
- completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation
- will automatically call the handler.
-
- If you need to handle your own events before the handler is called, then you need to override the
- SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished.
-
- `nil` by default.
- */
- public var backgroundCompletionHandler: (() -> Void)?
-
- // MARK: - Lifecycle
-
- /**
- Initializes the `Manager` instance with the specified configuration, delegate and server trust policy.
-
- - parameter configuration: The configuration used to construct the managed session.
- `NSURLSessionConfiguration.defaultSessionConfiguration()` by default.
- - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by
- default.
- - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust
- challenges. `nil` by default.
-
- - returns: The new `Manager` instance.
- */
- public init(
- configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(),
- delegate: SessionDelegate = SessionDelegate(),
- serverTrustPolicyManager: ServerTrustPolicyManager? = nil)
- {
- self.delegate = delegate
- self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil)
-
- commonInit(serverTrustPolicyManager: serverTrustPolicyManager)
- }
-
- /**
- Initializes the `Manager` instance with the specified session, delegate and server trust policy.
-
- - parameter session: The URL session.
- - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate.
- - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust
- challenges. `nil` by default.
-
- - returns: The new `Manager` instance if the URL session's delegate matches the delegate parameter.
- */
- public init?(
- session: NSURLSession,
- delegate: SessionDelegate,
- serverTrustPolicyManager: ServerTrustPolicyManager? = nil)
- {
- guard delegate === session.delegate else { return nil }
-
- self.delegate = delegate
- self.session = session
-
- commonInit(serverTrustPolicyManager: serverTrustPolicyManager)
- }
-
- private func commonInit(serverTrustPolicyManager serverTrustPolicyManager: ServerTrustPolicyManager?) {
- session.serverTrustPolicyManager = serverTrustPolicyManager
-
- delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in
- guard let strongSelf = self else { return }
- dispatch_async(dispatch_get_main_queue()) { strongSelf.backgroundCompletionHandler?() }
- }
- }
-
- deinit {
- session.invalidateAndCancel()
- }
-
- // MARK: - Request
-
- /**
- Creates a request for the specified method, URL string, parameters, parameter encoding and headers.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
-
- - returns: The created request.
- */
- public func request(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
- let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0
- return request(encodedURLRequest)
- }
-
- /**
- Creates a request for the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
-
- - returns: The created request.
- */
- public func request(URLRequest: URLRequestConvertible) -> Request {
- var dataTask: NSURLSessionDataTask!
- dispatch_sync(queue) { dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) }
-
- let request = Request(session: session, task: dataTask)
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- // MARK: - SessionDelegate
-
- /**
- Responsible for handling all delegate callbacks for the underlying session.
- */
- public class SessionDelegate: NSObject, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate {
- private var subdelegates: [Int: Request.TaskDelegate] = [:]
- private let subdelegateQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT)
-
- /// Access the task delegate for the specified task in a thread-safe manner.
- public subscript(task: NSURLSessionTask) -> Request.TaskDelegate? {
- get {
- var subdelegate: Request.TaskDelegate?
- dispatch_sync(subdelegateQueue) { subdelegate = self.subdelegates[task.taskIdentifier] }
-
- return subdelegate
- }
- set {
- dispatch_barrier_async(subdelegateQueue) { self.subdelegates[task.taskIdentifier] = newValue }
- }
- }
-
- /**
- Initializes the `SessionDelegate` instance.
-
- - returns: The new `SessionDelegate` instance.
- */
- public override init() {
- super.init()
- }
-
- // MARK: - NSURLSessionDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didBecomeInvalidWithError:`.
- public var sessionDidBecomeInvalidWithError: ((NSURLSession, NSError?) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`.
- public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
-
- /// Overrides all behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:` and requires the caller to call the `completionHandler`.
- public var sessionDidReceiveChallengeWithCompletion: ((NSURLSession, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`.
- public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the session has been invalidated.
-
- - parameter session: The session object that was invalidated.
- - parameter error: The error that caused invalidation, or nil if the invalidation was explicit.
- */
- public func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) {
- sessionDidBecomeInvalidWithError?(session, error)
- }
-
- /**
- Requests credentials from the delegate in response to a session-level authentication request from the remote server.
-
- - parameter session: The session containing the task that requested authentication.
- - parameter challenge: An object that contains the request for authentication.
- - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential.
- */
- public func URLSession(
- session: NSURLSession,
- didReceiveChallenge challenge: NSURLAuthenticationChallenge,
- completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void))
- {
- guard sessionDidReceiveChallengeWithCompletion == nil else {
- sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler)
- return
- }
-
- var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling
- var credential: NSURLCredential?
-
- if let sessionDidReceiveChallenge = sessionDidReceiveChallenge {
- (disposition, credential) = sessionDidReceiveChallenge(session, challenge)
- } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
- let host = challenge.protectionSpace.host
-
- if let
- serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host),
- serverTrust = challenge.protectionSpace.serverTrust
- {
- if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) {
- disposition = .UseCredential
- credential = NSURLCredential(forTrust: serverTrust)
- } else {
- disposition = .CancelAuthenticationChallenge
- }
- }
- }
-
- completionHandler(disposition, credential)
- }
-
- /**
- Tells the delegate that all messages enqueued for a session have been delivered.
-
- - parameter session: The session that no longer has any outstanding requests.
- */
- public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) {
- sessionDidFinishEventsForBackgroundURLSession?(session)
- }
-
- // MARK: - NSURLSessionTaskDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`.
- public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)?
-
- /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:` and
- /// requires the caller to call the `completionHandler`.
- public var taskWillPerformHTTPRedirectionWithCompletion: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, NSURLRequest? -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:`.
- public var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
-
- /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:` and
- /// requires the caller to call the `completionHandler`.
- public var taskDidReceiveChallengeWithCompletion: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:`.
- public var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)?
-
- /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:` and
- /// requires the caller to call the `completionHandler`.
- public var taskNeedNewBodyStreamWithCompletion: ((NSURLSession, NSURLSessionTask, NSInputStream? -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`.
- public var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didCompleteWithError:`.
- public var taskDidComplete: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the remote server requested an HTTP redirect.
-
- - parameter session: The session containing the task whose request resulted in a redirect.
- - parameter task: The task whose request resulted in a redirect.
- - parameter response: An object containing the server’s response to the original request.
- - parameter request: A URL request object filled out with the new location.
- - parameter completionHandler: A closure that your handler should call with either the value of the request
- parameter, a modified URL request object, or NULL to refuse the redirect and
- return the body of the redirect response.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- willPerformHTTPRedirection response: NSHTTPURLResponse,
- newRequest request: NSURLRequest,
- completionHandler: NSURLRequest? -> Void)
- {
- guard taskWillPerformHTTPRedirectionWithCompletion == nil else {
- taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler)
- return
- }
-
- var redirectRequest: NSURLRequest? = request
-
- if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection {
- redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request)
- }
-
- completionHandler(redirectRequest)
- }
-
- /**
- Requests credentials from the delegate in response to an authentication request from the remote server.
-
- - parameter session: The session containing the task whose request requires authentication.
- - parameter task: The task whose request requires authentication.
- - parameter challenge: An object that contains the request for authentication.
- - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didReceiveChallenge challenge: NSURLAuthenticationChallenge,
- completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)
- {
- guard taskDidReceiveChallengeWithCompletion == nil else {
- taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler)
- return
- }
-
- if let taskDidReceiveChallenge = taskDidReceiveChallenge {
- let result = taskDidReceiveChallenge(session, task, challenge)
- completionHandler(result.0, result.1)
- } else if let delegate = self[task] {
- delegate.URLSession(
- session,
- task: task,
- didReceiveChallenge: challenge,
- completionHandler: completionHandler
- )
- } else {
- URLSession(session, didReceiveChallenge: challenge, completionHandler: completionHandler)
- }
- }
-
- /**
- Tells the delegate when a task requires a new request body stream to send to the remote server.
-
- - parameter session: The session containing the task that needs a new body stream.
- - parameter task: The task that needs a new body stream.
- - parameter completionHandler: A completion handler that your delegate method should call with the new body stream.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- needNewBodyStream completionHandler: NSInputStream? -> Void)
- {
- guard taskNeedNewBodyStreamWithCompletion == nil else {
- taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler)
- return
- }
-
- if let taskNeedNewBodyStream = taskNeedNewBodyStream {
- completionHandler(taskNeedNewBodyStream(session, task))
- } else if let delegate = self[task] {
- delegate.URLSession(session, task: task, needNewBodyStream: completionHandler)
- }
- }
-
- /**
- Periodically informs the delegate of the progress of sending body content to the server.
-
- - parameter session: The session containing the data task.
- - parameter task: The data task.
- - parameter bytesSent: The number of bytes sent since the last time this delegate method was called.
- - parameter totalBytesSent: The total number of bytes sent so far.
- - parameter totalBytesExpectedToSend: The expected length of the body data.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didSendBodyData bytesSent: Int64,
- totalBytesSent: Int64,
- totalBytesExpectedToSend: Int64)
- {
- if let taskDidSendBodyData = taskDidSendBodyData {
- taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend)
- } else if let delegate = self[task] as? Request.UploadTaskDelegate {
- delegate.URLSession(
- session,
- task: task,
- didSendBodyData: bytesSent,
- totalBytesSent: totalBytesSent,
- totalBytesExpectedToSend: totalBytesExpectedToSend
- )
- }
- }
-
- /**
- Tells the delegate that the task finished transferring data.
-
- - parameter session: The session containing the task whose request finished transferring data.
- - parameter task: The task whose request finished transferring data.
- - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil.
- */
- public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
- if let taskDidComplete = taskDidComplete {
- taskDidComplete(session, task, error)
- } else if let delegate = self[task] {
- delegate.URLSession(session, task: task, didCompleteWithError: error)
- }
-
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidComplete, object: task)
-
- self[task] = nil
- }
-
- // MARK: - NSURLSessionDataDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:`.
- public var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)?
-
- /// Overrides all behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:` and
- /// requires caller to call the `completionHandler`.
- public var dataTaskDidReceiveResponseWithCompletion: ((NSURLSession, NSURLSessionDataTask, NSURLResponse, NSURLSessionResponseDisposition -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didBecomeDownloadTask:`.
- public var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveData:`.
- public var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`.
- public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)?
-
- /// Overrides all behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:` and
- /// requires caller to call the `completionHandler`.
- public var dataTaskWillCacheResponseWithCompletion: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, NSCachedURLResponse? -> Void) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the data task received the initial reply (headers) from the server.
-
- - parameter session: The session containing the data task that received an initial reply.
- - parameter dataTask: The data task that received an initial reply.
- - parameter response: A URL response object populated with headers.
- - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a
- constant to indicate whether the transfer should continue as a data task or
- should become a download task.
- */
- public func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didReceiveResponse response: NSURLResponse,
- completionHandler: NSURLSessionResponseDisposition -> Void)
- {
- guard dataTaskDidReceiveResponseWithCompletion == nil else {
- dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler)
- return
- }
-
- var disposition: NSURLSessionResponseDisposition = .Allow
-
- if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse {
- disposition = dataTaskDidReceiveResponse(session, dataTask, response)
- }
-
- completionHandler(disposition)
- }
-
- /**
- Tells the delegate that the data task was changed to a download task.
-
- - parameter session: The session containing the task that was replaced by a download task.
- - parameter dataTask: The data task that was replaced by a download task.
- - parameter downloadTask: The new download task that replaced the data task.
- */
- public func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask)
- {
- if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask {
- dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask)
- } else {
- let downloadDelegate = Request.DownloadTaskDelegate(task: downloadTask)
- self[downloadTask] = downloadDelegate
- }
- }
-
- /**
- Tells the delegate that the data task has received some of the expected data.
-
- - parameter session: The session containing the data task that provided data.
- - parameter dataTask: The data task that provided data.
- - parameter data: A data object containing the transferred data.
- */
- public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
- if let dataTaskDidReceiveData = dataTaskDidReceiveData {
- dataTaskDidReceiveData(session, dataTask, data)
- } else if let delegate = self[dataTask] as? Request.DataTaskDelegate {
- delegate.URLSession(session, dataTask: dataTask, didReceiveData: data)
- }
- }
-
- /**
- Asks the delegate whether the data (or upload) task should store the response in the cache.
-
- - parameter session: The session containing the data (or upload) task.
- - parameter dataTask: The data (or upload) task.
- - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current
- caching policy and the values of certain received headers, such as the Pragma
- and Cache-Control headers.
- - parameter completionHandler: A block that your handler must call, providing either the original proposed
- response, a modified version of that response, or NULL to prevent caching the
- response. If your delegate implements this method, it must call this completion
- handler; otherwise, your app leaks memory.
- */
- public func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- willCacheResponse proposedResponse: NSCachedURLResponse,
- completionHandler: NSCachedURLResponse? -> Void)
- {
- guard dataTaskWillCacheResponseWithCompletion == nil else {
- dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler)
- return
- }
-
- if let dataTaskWillCacheResponse = dataTaskWillCacheResponse {
- completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse))
- } else if let delegate = self[dataTask] as? Request.DataTaskDelegate {
- delegate.URLSession(
- session,
- dataTask: dataTask,
- willCacheResponse: proposedResponse,
- completionHandler: completionHandler
- )
- } else {
- completionHandler(proposedResponse)
- }
- }
-
- // MARK: - NSURLSessionDownloadDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didFinishDownloadingToURL:`.
- public var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`.
- public var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`.
- public var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that a download task has finished downloading.
-
- - parameter session: The session containing the download task that finished.
- - parameter downloadTask: The download task that finished.
- - parameter location: A file URL for the temporary file. Because the file is temporary, you must either
- open the file for reading or move it to a permanent location in your app’s sandbox
- container directory before returning from this delegate method.
- */
- public func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didFinishDownloadingToURL location: NSURL)
- {
- if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL {
- downloadTaskDidFinishDownloadingToURL(session, downloadTask, location)
- } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate {
- delegate.URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location)
- }
- }
-
- /**
- Periodically informs the delegate about the download’s progress.
-
- - parameter session: The session containing the download task.
- - parameter downloadTask: The download task.
- - parameter bytesWritten: The number of bytes transferred since the last time this delegate
- method was called.
- - parameter totalBytesWritten: The total number of bytes transferred so far.
- - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length
- header. If this header was not provided, the value is
- `NSURLSessionTransferSizeUnknown`.
- */
- public func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didWriteData bytesWritten: Int64,
- totalBytesWritten: Int64,
- totalBytesExpectedToWrite: Int64)
- {
- if let downloadTaskDidWriteData = downloadTaskDidWriteData {
- downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite)
- } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate {
- delegate.URLSession(
- session,
- downloadTask: downloadTask,
- didWriteData: bytesWritten,
- totalBytesWritten: totalBytesWritten,
- totalBytesExpectedToWrite: totalBytesExpectedToWrite
- )
- }
- }
-
- /**
- Tells the delegate that the download task has resumed downloading.
-
- - parameter session: The session containing the download task that finished.
- - parameter downloadTask: The download task that resumed. See explanation in the discussion.
- - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the
- existing content, then this value is zero. Otherwise, this value is an
- integer representing the number of bytes on disk that do not need to be
- retrieved again.
- - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header.
- If this header was not provided, the value is NSURLSessionTransferSizeUnknown.
- */
- public func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didResumeAtOffset fileOffset: Int64,
- expectedTotalBytes: Int64)
- {
- if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset {
- downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes)
- } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate {
- delegate.URLSession(
- session,
- downloadTask: downloadTask,
- didResumeAtOffset: fileOffset,
- expectedTotalBytes: expectedTotalBytes
- )
- }
- }
-
- // MARK: - NSURLSessionStreamDelegate
-
- var _streamTaskReadClosed: Any?
- var _streamTaskWriteClosed: Any?
- var _streamTaskBetterRouteDiscovered: Any?
- var _streamTaskDidBecomeInputStream: Any?
-
- // MARK: - NSObject
-
- public override func respondsToSelector(selector: Selector) -> Bool {
- #if !os(OSX)
- if selector == #selector(NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession(_:)) {
- return sessionDidFinishEventsForBackgroundURLSession != nil
- }
- #endif
-
- switch selector {
- case #selector(NSURLSessionDelegate.URLSession(_:didBecomeInvalidWithError:)):
- return sessionDidBecomeInvalidWithError != nil
- case #selector(NSURLSessionDelegate.URLSession(_:didReceiveChallenge:completionHandler:)):
- return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil)
- case #selector(NSURLSessionTaskDelegate.URLSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)):
- return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil)
- case #selector(NSURLSessionDataDelegate.URLSession(_:dataTask:didReceiveResponse:completionHandler:)):
- return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil)
- default:
- return self.dynamicType.instancesRespondToSelector(selector)
- }
- }
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift
deleted file mode 100644
index 5a7ef09c82ed..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift
+++ /dev/null
@@ -1,659 +0,0 @@
-//
-// MultipartFormData.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-#if os(iOS) || os(watchOS) || os(tvOS)
-import MobileCoreServices
-#elseif os(OSX)
-import CoreServices
-#endif
-
-/**
- Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode
- multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead
- to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the
- data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for
- larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset.
-
- For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well
- and the w3 form documentation.
-
- - https://www.ietf.org/rfc/rfc2388.txt
- - https://www.ietf.org/rfc/rfc2045.txt
- - https://www.w3.org/TR/html401/interact/forms.html#h-17.13
-*/
-public class MultipartFormData {
-
- // MARK: - Helper Types
-
- struct EncodingCharacters {
- static let CRLF = "\r\n"
- }
-
- struct BoundaryGenerator {
- enum BoundaryType {
- case Initial, Encapsulated, Final
- }
-
- static func randomBoundary() -> String {
- return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random())
- }
-
- static func boundaryData(boundaryType boundaryType: BoundaryType, boundary: String) -> NSData {
- let boundaryText: String
-
- switch boundaryType {
- case .Initial:
- boundaryText = "--\(boundary)\(EncodingCharacters.CRLF)"
- case .Encapsulated:
- boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)\(EncodingCharacters.CRLF)"
- case .Final:
- boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)--\(EncodingCharacters.CRLF)"
- }
-
- return boundaryText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
- }
- }
-
- class BodyPart {
- let headers: [String: String]
- let bodyStream: NSInputStream
- let bodyContentLength: UInt64
- var hasInitialBoundary = false
- var hasFinalBoundary = false
-
- init(headers: [String: String], bodyStream: NSInputStream, bodyContentLength: UInt64) {
- self.headers = headers
- self.bodyStream = bodyStream
- self.bodyContentLength = bodyContentLength
- }
- }
-
- // MARK: - Properties
-
- /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`.
- public var contentType: String { return "multipart/form-data; boundary=\(boundary)" }
-
- /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries.
- public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } }
-
- /// The boundary used to separate the body parts in the encoded form data.
- public let boundary: String
-
- private var bodyParts: [BodyPart]
- private var bodyPartError: NSError?
- private let streamBufferSize: Int
-
- // MARK: - Lifecycle
-
- /**
- Creates a multipart form data object.
-
- - returns: The multipart form data object.
- */
- public init() {
- self.boundary = BoundaryGenerator.randomBoundary()
- self.bodyParts = []
-
- /**
- * The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more
- * information, please refer to the following article:
- * - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html
- */
-
- self.streamBufferSize = 1024
- }
-
- // MARK: - Body Parts
-
- /**
- Creates a body part from the data and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}` (HTTP Header)
- - Encoded data
- - Multipart form boundary
-
- - parameter data: The data to encode into the multipart form data.
- - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header.
- */
- public func appendBodyPart(data data: NSData, name: String) {
- let headers = contentHeaders(name: name)
- let stream = NSInputStream(data: data)
- let length = UInt64(data.length)
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the data and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}` (HTTP Header)
- - `Content-Type: #{generated mimeType}` (HTTP Header)
- - Encoded data
- - Multipart form boundary
-
- - parameter data: The data to encode into the multipart form data.
- - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(data data: NSData, name: String, mimeType: String) {
- let headers = contentHeaders(name: name, mimeType: mimeType)
- let stream = NSInputStream(data: data)
- let length = UInt64(data.length)
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the data and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header)
- - `Content-Type: #{mimeType}` (HTTP Header)
- - Encoded file data
- - Multipart form boundary
-
- - parameter data: The data to encode into the multipart form data.
- - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header.
- - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(data data: NSData, name: String, fileName: String, mimeType: String) {
- let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType)
- let stream = NSInputStream(data: data)
- let length = UInt64(data.length)
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the file and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header)
- - `Content-Type: #{generated mimeType}` (HTTP Header)
- - Encoded file data
- - Multipart form boundary
-
- The filename in the `Content-Disposition` HTTP header is generated from the last path component of the
- `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the
- system associated MIME type.
-
- - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data.
- - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header.
- */
- public func appendBodyPart(fileURL fileURL: NSURL, name: String) {
- if let
- fileName = fileURL.lastPathComponent,
- pathExtension = fileURL.pathExtension
- {
- let mimeType = mimeTypeForPathExtension(pathExtension)
- appendBodyPart(fileURL: fileURL, name: name, fileName: fileName, mimeType: mimeType)
- } else {
- let failureReason = "Failed to extract the fileName of the provided URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- }
- }
-
- /**
- Creates a body part from the file and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header)
- - Content-Type: #{mimeType} (HTTP Header)
- - Encoded file data
- - Multipart form boundary
-
- - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data.
- - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header.
- - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(fileURL fileURL: NSURL, name: String, fileName: String, mimeType: String) {
- let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType)
-
- //============================================================
- // Check 1 - is file URL?
- //============================================================
-
- guard fileURL.fileURL else {
- let failureReason = "The file URL does not point to a file URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- return
- }
-
- //============================================================
- // Check 2 - is file URL reachable?
- //============================================================
-
- var isReachable = true
-
- if #available(OSX 10.10, *) {
- isReachable = fileURL.checkPromisedItemIsReachableAndReturnError(nil)
- }
-
- guard isReachable else {
- setBodyPartError(code: NSURLErrorBadURL, failureReason: "The file URL is not reachable: \(fileURL)")
- return
- }
-
- //============================================================
- // Check 3 - is file URL a directory?
- //============================================================
-
- var isDirectory: ObjCBool = false
-
- guard let
- path = fileURL.path
- where NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDirectory) && !isDirectory else
- {
- let failureReason = "The file URL is a directory, not a file: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- return
- }
-
- //============================================================
- // Check 4 - can the file size be extracted?
- //============================================================
-
- var bodyContentLength: UInt64?
-
- do {
- if let
- path = fileURL.path,
- fileSize = try NSFileManager.defaultManager().attributesOfItemAtPath(path)[NSFileSize] as? NSNumber
- {
- bodyContentLength = fileSize.unsignedLongLongValue
- }
- } catch {
- // No-op
- }
-
- guard let length = bodyContentLength else {
- let failureReason = "Could not fetch attributes from the file URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- return
- }
-
- //============================================================
- // Check 5 - can a stream be created from file URL?
- //============================================================
-
- guard let stream = NSInputStream(URL: fileURL) else {
- let failureReason = "Failed to create an input stream from the file URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorCannotOpenFile, failureReason: failureReason)
- return
- }
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the stream and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header)
- - `Content-Type: #{mimeType}` (HTTP Header)
- - Encoded stream data
- - Multipart form boundary
-
- - parameter stream: The input stream to encode in the multipart form data.
- - parameter length: The content length of the stream.
- - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header.
- - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(
- stream stream: NSInputStream,
- length: UInt64,
- name: String,
- fileName: String,
- mimeType: String)
- {
- let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType)
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part with the headers, stream and length and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - HTTP headers
- - Encoded stream data
- - Multipart form boundary
-
- - parameter stream: The input stream to encode in the multipart form data.
- - parameter length: The content length of the stream.
- - parameter headers: The HTTP headers for the body part.
- */
- public func appendBodyPart(stream stream: NSInputStream, length: UInt64, headers: [String: String]) {
- let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length)
- bodyParts.append(bodyPart)
- }
-
- // MARK: - Data Encoding
-
- /**
- Encodes all the appended body parts into a single `NSData` object.
-
- It is important to note that this method will load all the appended body parts into memory all at the same
- time. This method should only be used when the encoded data will have a small memory footprint. For large data
- cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method.
-
- - throws: An `NSError` if encoding encounters an error.
-
- - returns: The encoded `NSData` if encoding is successful.
- */
- public func encode() throws -> NSData {
- if let bodyPartError = bodyPartError {
- throw bodyPartError
- }
-
- let encoded = NSMutableData()
-
- bodyParts.first?.hasInitialBoundary = true
- bodyParts.last?.hasFinalBoundary = true
-
- for bodyPart in bodyParts {
- let encodedData = try encodeBodyPart(bodyPart)
- encoded.appendData(encodedData)
- }
-
- return encoded
- }
-
- /**
- Writes the appended body parts into the given file URL.
-
- This process is facilitated by reading and writing with input and output streams, respectively. Thus,
- this approach is very memory efficient and should be used for large body part data.
-
- - parameter fileURL: The file URL to write the multipart form data into.
-
- - throws: An `NSError` if encoding encounters an error.
- */
- public func writeEncodedDataToDisk(fileURL: NSURL) throws {
- if let bodyPartError = bodyPartError {
- throw bodyPartError
- }
-
- if let path = fileURL.path where NSFileManager.defaultManager().fileExistsAtPath(path) {
- let failureReason = "A file already exists at the given file URL: \(fileURL)"
- throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorBadURL, failureReason: failureReason)
- } else if !fileURL.fileURL {
- let failureReason = "The URL does not point to a valid file: \(fileURL)"
- throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorBadURL, failureReason: failureReason)
- }
-
- let outputStream: NSOutputStream
-
- if let possibleOutputStream = NSOutputStream(URL: fileURL, append: false) {
- outputStream = possibleOutputStream
- } else {
- let failureReason = "Failed to create an output stream with the given URL: \(fileURL)"
- throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorCannotOpenFile, failureReason: failureReason)
- }
-
- outputStream.open()
-
- self.bodyParts.first?.hasInitialBoundary = true
- self.bodyParts.last?.hasFinalBoundary = true
-
- for bodyPart in self.bodyParts {
- try writeBodyPart(bodyPart, toOutputStream: outputStream)
- }
-
- outputStream.close()
- }
-
- // MARK: - Private - Body Part Encoding
-
- private func encodeBodyPart(bodyPart: BodyPart) throws -> NSData {
- let encoded = NSMutableData()
-
- let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData()
- encoded.appendData(initialData)
-
- let headerData = encodeHeaderDataForBodyPart(bodyPart)
- encoded.appendData(headerData)
-
- let bodyStreamData = try encodeBodyStreamDataForBodyPart(bodyPart)
- encoded.appendData(bodyStreamData)
-
- if bodyPart.hasFinalBoundary {
- encoded.appendData(finalBoundaryData())
- }
-
- return encoded
- }
-
- private func encodeHeaderDataForBodyPart(bodyPart: BodyPart) -> NSData {
- var headerText = ""
-
- for (key, value) in bodyPart.headers {
- headerText += "\(key): \(value)\(EncodingCharacters.CRLF)"
- }
- headerText += EncodingCharacters.CRLF
-
- return headerText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
- }
-
- private func encodeBodyStreamDataForBodyPart(bodyPart: BodyPart) throws -> NSData {
- let inputStream = bodyPart.bodyStream
- inputStream.open()
-
- var error: NSError?
- let encoded = NSMutableData()
-
- while inputStream.hasBytesAvailable {
- var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0)
- let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize)
-
- if inputStream.streamError != nil {
- error = inputStream.streamError
- break
- }
-
- if bytesRead > 0 {
- encoded.appendBytes(buffer, length: bytesRead)
- } else if bytesRead < 0 {
- let failureReason = "Failed to read from input stream: \(inputStream)"
- error = Error.error(domain: NSURLErrorDomain, code: .InputStreamReadFailed, failureReason: failureReason)
- break
- } else {
- break
- }
- }
-
- inputStream.close()
-
- if let error = error {
- throw error
- }
-
- return encoded
- }
-
- // MARK: - Private - Writing Body Part to Output Stream
-
- private func writeBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws {
- try writeInitialBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream)
- try writeHeaderDataForBodyPart(bodyPart, toOutputStream: outputStream)
- try writeBodyStreamForBodyPart(bodyPart, toOutputStream: outputStream)
- try writeFinalBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream)
- }
-
- private func writeInitialBoundaryDataForBodyPart(
- bodyPart: BodyPart,
- toOutputStream outputStream: NSOutputStream)
- throws
- {
- let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData()
- return try writeData(initialData, toOutputStream: outputStream)
- }
-
- private func writeHeaderDataForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws {
- let headerData = encodeHeaderDataForBodyPart(bodyPart)
- return try writeData(headerData, toOutputStream: outputStream)
- }
-
- private func writeBodyStreamForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws {
- let inputStream = bodyPart.bodyStream
- inputStream.open()
-
- while inputStream.hasBytesAvailable {
- var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0)
- let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize)
-
- if let streamError = inputStream.streamError {
- throw streamError
- }
-
- if bytesRead > 0 {
- if buffer.count != bytesRead {
- buffer = Array(buffer[0.. 0 {
- if outputStream.hasSpaceAvailable {
- let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite)
-
- if let streamError = outputStream.streamError {
- throw streamError
- }
-
- if bytesWritten < 0 {
- let failureReason = "Failed to write to output stream: \(outputStream)"
- throw Error.error(domain: NSURLErrorDomain, code: .OutputStreamWriteFailed, failureReason: failureReason)
- }
-
- bytesToWrite -= bytesWritten
-
- if bytesToWrite > 0 {
- buffer = Array(buffer[bytesWritten.. String {
- if let
- id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension, nil)?.takeRetainedValue(),
- contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue()
- {
- return contentType as String
- }
-
- return "application/octet-stream"
- }
-
- // MARK: - Private - Content Headers
-
- private func contentHeaders(name name: String) -> [String: String] {
- return ["Content-Disposition": "form-data; name=\"\(name)\""]
- }
-
- private func contentHeaders(name name: String, mimeType: String) -> [String: String] {
- return [
- "Content-Disposition": "form-data; name=\"\(name)\"",
- "Content-Type": "\(mimeType)"
- ]
- }
-
- private func contentHeaders(name name: String, fileName: String, mimeType: String) -> [String: String] {
- return [
- "Content-Disposition": "form-data; name=\"\(name)\"; filename=\"\(fileName)\"",
- "Content-Type": "\(mimeType)"
- ]
- }
-
- // MARK: - Private - Boundary Encoding
-
- private func initialBoundaryData() -> NSData {
- return BoundaryGenerator.boundaryData(boundaryType: .Initial, boundary: boundary)
- }
-
- private func encapsulatedBoundaryData() -> NSData {
- return BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundary: boundary)
- }
-
- private func finalBoundaryData() -> NSData {
- return BoundaryGenerator.boundaryData(boundaryType: .Final, boundary: boundary)
- }
-
- // MARK: - Private - Errors
-
- private func setBodyPartError(code code: Int, failureReason: String) {
- guard bodyPartError == nil else { return }
- bodyPartError = Error.error(domain: NSURLErrorDomain, code: code, failureReason: failureReason)
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift
deleted file mode 100644
index d5e00ae70051..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// NetworkReachabilityManager.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#if !os(watchOS)
-
-import Foundation
-import SystemConfiguration
-
-/**
- The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and
- WiFi network interfaces.
-
- Reachability can be used to determine background information about why a network operation failed, or to retry
- network requests when a connection is established. It should not be used to prevent a user from initiating a network
- request, as it's possible that an initial request may be required to establish reachability.
-*/
-public class NetworkReachabilityManager {
- /**
- Defines the various states of network reachability.
-
- - Unknown: It is unknown whether the network is reachable.
- - NotReachable: The network is not reachable.
- - ReachableOnWWAN: The network is reachable over the WWAN connection.
- - ReachableOnWiFi: The network is reachable over the WiFi connection.
- */
- public enum NetworkReachabilityStatus {
- case Unknown
- case NotReachable
- case Reachable(ConnectionType)
- }
-
- /**
- Defines the various connection types detected by reachability flags.
-
- - EthernetOrWiFi: The connection type is either over Ethernet or WiFi.
- - WWAN: The connection type is a WWAN connection.
- */
- public enum ConnectionType {
- case EthernetOrWiFi
- case WWAN
- }
-
- /// A closure executed when the network reachability status changes. The closure takes a single argument: the
- /// network reachability status.
- public typealias Listener = NetworkReachabilityStatus -> Void
-
- // MARK: - Properties
-
- /// Whether the network is currently reachable.
- public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi }
-
- /// Whether the network is currently reachable over the WWAN interface.
- public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .Reachable(.WWAN) }
-
- /// Whether the network is currently reachable over Ethernet or WiFi interface.
- public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .Reachable(.EthernetOrWiFi) }
-
- /// The current network reachability status.
- public var networkReachabilityStatus: NetworkReachabilityStatus {
- guard let flags = self.flags else { return .Unknown }
- return networkReachabilityStatusForFlags(flags)
- }
-
- /// The dispatch queue to execute the `listener` closure on.
- public var listenerQueue: dispatch_queue_t = dispatch_get_main_queue()
-
- /// A closure executed when the network reachability status changes.
- public var listener: Listener?
-
- private var flags: SCNetworkReachabilityFlags? {
- var flags = SCNetworkReachabilityFlags()
-
- if SCNetworkReachabilityGetFlags(reachability, &flags) {
- return flags
- }
-
- return nil
- }
-
- private let reachability: SCNetworkReachability
- private var previousFlags: SCNetworkReachabilityFlags
-
- // MARK: - Initialization
-
- /**
- Creates a `NetworkReachabilityManager` instance with the specified host.
-
- - parameter host: The host used to evaluate network reachability.
-
- - returns: The new `NetworkReachabilityManager` instance.
- */
- public convenience init?(host: String) {
- guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil }
- self.init(reachability: reachability)
- }
-
- /**
- Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0.
-
- Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing
- status of the device, both IPv4 and IPv6.
-
- - returns: The new `NetworkReachabilityManager` instance.
- */
- public convenience init?() {
- var address = sockaddr_in()
- address.sin_len = UInt8(sizeofValue(address))
- address.sin_family = sa_family_t(AF_INET)
-
- guard let reachability = withUnsafePointer(&address, {
- SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0))
- }) else { return nil }
-
- self.init(reachability: reachability)
- }
-
- private init(reachability: SCNetworkReachability) {
- self.reachability = reachability
- self.previousFlags = SCNetworkReachabilityFlags()
- }
-
- deinit {
- stopListening()
- }
-
- // MARK: - Listening
-
- /**
- Starts listening for changes in network reachability status.
-
- - returns: `true` if listening was started successfully, `false` otherwise.
- */
- public func startListening() -> Bool {
- var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil)
- context.info = UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque())
-
- let callbackEnabled = SCNetworkReachabilitySetCallback(
- reachability,
- { (_, flags, info) in
- let reachability = Unmanaged.fromOpaque(COpaquePointer(info)).takeUnretainedValue()
- reachability.notifyListener(flags)
- },
- &context
- )
-
- let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue)
-
- dispatch_async(listenerQueue) {
- self.previousFlags = SCNetworkReachabilityFlags()
- self.notifyListener(self.flags ?? SCNetworkReachabilityFlags())
- }
-
- return callbackEnabled && queueEnabled
- }
-
- /**
- Stops listening for changes in network reachability status.
- */
- public func stopListening() {
- SCNetworkReachabilitySetCallback(reachability, nil, nil)
- SCNetworkReachabilitySetDispatchQueue(reachability, nil)
- }
-
- // MARK: - Internal - Listener Notification
-
- func notifyListener(flags: SCNetworkReachabilityFlags) {
- guard previousFlags != flags else { return }
- previousFlags = flags
-
- listener?(networkReachabilityStatusForFlags(flags))
- }
-
- // MARK: - Internal - Network Reachability Status
-
- func networkReachabilityStatusForFlags(flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus {
- guard flags.contains(.Reachable) else { return .NotReachable }
-
- var networkStatus: NetworkReachabilityStatus = .NotReachable
-
- if !flags.contains(.ConnectionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) }
-
- if flags.contains(.ConnectionOnDemand) || flags.contains(.ConnectionOnTraffic) {
- if !flags.contains(.InterventionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) }
- }
-
- #if os(iOS)
- if flags.contains(.IsWWAN) { networkStatus = .Reachable(.WWAN) }
- #endif
-
- return networkStatus
- }
-}
-
-// MARK: -
-
-extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {}
-
-/**
- Returns whether the two network reachability status values are equal.
-
- - parameter lhs: The left-hand side value to compare.
- - parameter rhs: The right-hand side value to compare.
-
- - returns: `true` if the two values are equal, `false` otherwise.
-*/
-public func ==(
- lhs: NetworkReachabilityManager.NetworkReachabilityStatus,
- rhs: NetworkReachabilityManager.NetworkReachabilityStatus)
- -> Bool
-{
- switch (lhs, rhs) {
- case (.Unknown, .Unknown):
- return true
- case (.NotReachable, .NotReachable):
- return true
- case let (.Reachable(lhsConnectionType), .Reachable(rhsConnectionType)):
- return lhsConnectionType == rhsConnectionType
- default:
- return false
- }
-}
-
-#endif
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift
deleted file mode 100644
index a7dbcfeffaa3..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Notifications.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Contains all the `NSNotification` names posted by Alamofire with descriptions of each notification's payload.
-public struct Notifications {
- /// Used as a namespace for all `NSURLSessionTask` related notifications.
- public struct Task {
- /// Notification posted when an `NSURLSessionTask` is resumed. The notification `object` contains the resumed
- /// `NSURLSessionTask`.
- public static let DidResume = "com.alamofire.notifications.task.didResume"
-
- /// Notification posted when an `NSURLSessionTask` is suspended. The notification `object` contains the
- /// suspended `NSURLSessionTask`.
- public static let DidSuspend = "com.alamofire.notifications.task.didSuspend"
-
- /// Notification posted when an `NSURLSessionTask` is cancelled. The notification `object` contains the
- /// cancelled `NSURLSessionTask`.
- public static let DidCancel = "com.alamofire.notifications.task.didCancel"
-
- /// Notification posted when an `NSURLSessionTask` is completed. The notification `object` contains the
- /// completed `NSURLSessionTask`.
- public static let DidComplete = "com.alamofire.notifications.task.didComplete"
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift
deleted file mode 100644
index c54e58b32d6f..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift
+++ /dev/null
@@ -1,261 +0,0 @@
-//
-// ParameterEncoding.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/**
- HTTP method definitions.
-
- See https://tools.ietf.org/html/rfc7231#section-4.3
-*/
-public enum Method: String {
- case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT
-}
-
-// MARK: ParameterEncoding
-
-/**
- Used to specify the way in which a set of parameters are applied to a URL request.
-
- - `URL`: Creates a query string to be set as or appended to any existing URL query for `GET`, `HEAD`,
- and `DELETE` requests, or set as the body for requests with any other HTTP method. The
- `Content-Type` HTTP header field of an encoded request with HTTP body is set to
- `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification
- for how to encode collection types, the convention of appending `[]` to the key for array
- values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested
- dictionary values (`foo[bar]=baz`).
-
- - `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same
- implementation as the `.URL` case, but always applies the encoded result to the URL.
-
- - `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is
- set as the body of the request. The `Content-Type` HTTP header field of an encoded request is
- set to `application/json`.
-
- - `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object,
- according to the associated format and write options values, which is set as the body of the
- request. The `Content-Type` HTTP header field of an encoded request is set to
- `application/x-plist`.
-
- - `Custom`: Uses the associated closure value to construct a new request given an existing request and
- parameters.
-*/
-public enum ParameterEncoding {
- case URL
- case URLEncodedInURL
- case JSON
- case PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions)
- case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?))
-
- /**
- 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.
-
- - returns: A tuple containing the constructed request and the error that occurred during parameter encoding,
- if any.
- */
- public func encode(
- URLRequest: URLRequestConvertible,
- parameters: [String: AnyObject]?)
- -> (NSMutableURLRequest, NSError?)
- {
- var mutableURLRequest = URLRequest.URLRequest
-
- guard let parameters = parameters else { return (mutableURLRequest, nil) }
-
- var encodingError: NSError? = nil
-
- switch self {
- case .URL, .URLEncodedInURL:
- func query(parameters: [String: AnyObject]) -> String {
- var components: [(String, String)] = []
-
- for key in parameters.keys.sort(<) {
- let value = parameters[key]!
- components += queryComponents(key, value)
- }
-
- return (components.map { "\($0)=\($1)" } as [String]).joinWithSeparator("&")
- }
-
- func encodesParametersInURL(method: Method) -> Bool {
- switch self {
- case .URLEncodedInURL:
- return true
- default:
- break
- }
-
- switch method {
- case .GET, .HEAD, .DELETE:
- return true
- default:
- return false
- }
- }
-
- if let method = Method(rawValue: mutableURLRequest.HTTPMethod) where encodesParametersInURL(method) {
- if let
- URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false)
- where !parameters.isEmpty
- {
- let percentEncodedQuery = (URLComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters)
- URLComponents.percentEncodedQuery = percentEncodedQuery
- mutableURLRequest.URL = URLComponents.URL
- }
- } else {
- if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil {
- mutableURLRequest.setValue(
- "application/x-www-form-urlencoded; charset=utf-8",
- forHTTPHeaderField: "Content-Type"
- )
- }
-
- mutableURLRequest.HTTPBody = query(parameters).dataUsingEncoding(
- NSUTF8StringEncoding,
- allowLossyConversion: false
- )
- }
- case .JSON:
- do {
- let options = NSJSONWritingOptions()
- let data = try NSJSONSerialization.dataWithJSONObject(parameters, options: options)
-
- if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil {
- mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
- }
-
- mutableURLRequest.HTTPBody = data
- } catch {
- encodingError = error as NSError
- }
- case .PropertyList(let format, let options):
- do {
- let data = try NSPropertyListSerialization.dataWithPropertyList(
- parameters,
- format: format,
- options: options
- )
-
- if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil {
- mutableURLRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type")
- }
-
- mutableURLRequest.HTTPBody = data
- } catch {
- encodingError = error as NSError
- }
- case .Custom(let closure):
- (mutableURLRequest, encodingError) = closure(mutableURLRequest, parameters)
- }
-
- return (mutableURLRequest, encodingError)
- }
-
- /**
- Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion.
-
- - parameter key: The key of the query component.
- - parameter value: The value of the query component.
-
- - returns: The percent-escaped, URL encoded query string components.
- */
- public func queryComponents(key: String, _ value: AnyObject) -> [(String, String)] {
- var components: [(String, String)] = []
-
- if let dictionary = value as? [String: AnyObject] {
- for (nestedKey, value) in dictionary {
- components += queryComponents("\(key)[\(nestedKey)]", value)
- }
- } else if let array = value as? [AnyObject] {
- for value in array {
- components += queryComponents("\(key)[]", value)
- }
- } else {
- components.append((escape(key), escape("\(value)")))
- }
-
- return components
- }
-
- /**
- Returns a percent-escaped string following RFC 3986 for a query string key or value.
-
- RFC 3986 states that the following characters are "reserved" characters.
-
- - General Delimiters: ":", "#", "[", "]", "@", "?", "/"
- - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="
-
- In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow
- query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/"
- should be percent-escaped in the query string.
-
- - parameter string: The string to be percent-escaped.
-
- - returns: The percent-escaped string.
- */
- public func escape(string: String) -> String {
- let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4
- let subDelimitersToEncode = "!$&'()*+,;="
-
- let allowedCharacterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet
- allowedCharacterSet.removeCharactersInString(generalDelimitersToEncode + subDelimitersToEncode)
-
- var escaped = ""
-
- //==========================================================================================================
- //
- // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few
- // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no
- // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more
- // info, please refer to:
- //
- // - https://github.com/Alamofire/Alamofire/issues/206
- //
- //==========================================================================================================
-
- if #available(iOS 8.3, OSX 10.10, *) {
- escaped = string.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? string
- } else {
- let batchSize = 50
- var index = string.startIndex
-
- while index != string.endIndex {
- let startIndex = index
- let endIndex = index.advancedBy(batchSize, limit: string.endIndex)
- let range = startIndex.. Self
- {
- let credential = NSURLCredential(user: user, password: password, persistence: persistence)
-
- return authenticate(usingCredential: credential)
- }
-
- /**
- Associates a specified credential with the request.
-
- - parameter credential: The credential.
-
- - returns: The request.
- */
- public func authenticate(usingCredential credential: NSURLCredential) -> Self {
- delegate.credential = credential
-
- return self
- }
-
- /**
- Returns a base64 encoded basic authentication credential as an authorization header dictionary.
-
- - parameter user: The user.
- - parameter password: The password.
-
- - returns: A dictionary with Authorization key and credential value or empty dictionary if encoding fails.
- */
- public static func authorizationHeader(user user: String, password: String) -> [String: String] {
- guard let data = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding) else { return [:] }
-
- let credential = data.base64EncodedStringWithOptions([])
-
- return ["Authorization": "Basic \(credential)"]
- }
-
- // MARK: - Progress
-
- /**
- Sets a closure to be called periodically during the lifecycle of the request as data is written to or read
- from the server.
-
- - For uploads, the progress closure returns the bytes written, total bytes written, and total bytes expected
- to write.
- - For downloads and data tasks, the progress closure returns the bytes read, total bytes read, and total bytes
- expected to read.
-
- - parameter closure: The code to be executed periodically during the lifecycle of the request.
-
- - returns: The request.
- */
- public func progress(closure: ((Int64, Int64, Int64) -> Void)? = nil) -> Self {
- if let uploadDelegate = delegate as? UploadTaskDelegate {
- uploadDelegate.uploadProgress = closure
- } else if let dataDelegate = delegate as? DataTaskDelegate {
- dataDelegate.dataProgress = closure
- } else if let downloadDelegate = delegate as? DownloadTaskDelegate {
- downloadDelegate.downloadProgress = closure
- }
-
- return self
- }
-
- /**
- Sets a closure to be called periodically during the lifecycle of the request as data is read from the server.
-
- This closure returns the bytes most recently received from the server, not including data from previous calls.
- If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is
- also important to note that the `response` closure will be called with nil `responseData`.
-
- - parameter closure: The code to be executed periodically during the lifecycle of the request.
-
- - returns: The request.
- */
- public func stream(closure: (NSData -> Void)? = nil) -> Self {
- if let dataDelegate = delegate as? DataTaskDelegate {
- dataDelegate.dataStream = closure
- }
-
- return self
- }
-
- // MARK: - State
-
- /**
- Resumes the request.
- */
- public func resume() {
- if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() }
-
- task.resume()
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidResume, object: task)
- }
-
- /**
- Suspends the request.
- */
- public func suspend() {
- task.suspend()
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidSuspend, object: task)
- }
-
- /**
- Cancels the request.
- */
- public func cancel() {
- if let
- downloadDelegate = delegate as? DownloadTaskDelegate,
- downloadTask = downloadDelegate.downloadTask
- {
- downloadTask.cancelByProducingResumeData { data in
- downloadDelegate.resumeData = data
- }
- } else {
- task.cancel()
- }
-
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidCancel, object: task)
- }
-
- // MARK: - TaskDelegate
-
- /**
- The task delegate is responsible for handling all delegate callbacks for the underlying task as well as
- executing all operations attached to the serial operation queue upon task completion.
- */
- public class TaskDelegate: NSObject {
-
- /// The serial operation queue used to execute all operations after the task completes.
- public let queue: NSOperationQueue
-
- let task: NSURLSessionTask
- let progress: NSProgress
-
- var data: NSData? { return nil }
- var error: NSError?
-
- var initialResponseTime: CFAbsoluteTime?
- var credential: NSURLCredential?
-
- init(task: NSURLSessionTask) {
- self.task = task
- self.progress = NSProgress(totalUnitCount: 0)
- self.queue = {
- let operationQueue = NSOperationQueue()
- operationQueue.maxConcurrentOperationCount = 1
- operationQueue.suspended = true
-
- if #available(OSX 10.10, *) {
- operationQueue.qualityOfService = NSQualityOfService.Utility
- }
-
- return operationQueue
- }()
- }
-
- deinit {
- queue.cancelAllOperations()
- queue.suspended = false
- }
-
- // MARK: - NSURLSessionTaskDelegate
-
- // MARK: Override Closures
-
- var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)?
- var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
- var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)?
- var taskDidCompleteWithError: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- willPerformHTTPRedirection response: NSHTTPURLResponse,
- newRequest request: NSURLRequest,
- completionHandler: ((NSURLRequest?) -> Void))
- {
- var redirectRequest: NSURLRequest? = request
-
- if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection {
- redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request)
- }
-
- completionHandler(redirectRequest)
- }
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didReceiveChallenge challenge: NSURLAuthenticationChallenge,
- completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void))
- {
- var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling
- var credential: NSURLCredential?
-
- if let taskDidReceiveChallenge = taskDidReceiveChallenge {
- (disposition, credential) = taskDidReceiveChallenge(session, task, challenge)
- } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
- let host = challenge.protectionSpace.host
-
- if let
- serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host),
- serverTrust = challenge.protectionSpace.serverTrust
- {
- if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) {
- disposition = .UseCredential
- credential = NSURLCredential(forTrust: serverTrust)
- } else {
- disposition = .CancelAuthenticationChallenge
- }
- }
- } else {
- if challenge.previousFailureCount > 0 {
- disposition = .RejectProtectionSpace
- } else {
- credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
-
- if credential != nil {
- disposition = .UseCredential
- }
- }
- }
-
- completionHandler(disposition, credential)
- }
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- needNewBodyStream completionHandler: ((NSInputStream?) -> Void))
- {
- var bodyStream: NSInputStream?
-
- if let taskNeedNewBodyStream = taskNeedNewBodyStream {
- bodyStream = taskNeedNewBodyStream(session, task)
- }
-
- completionHandler(bodyStream)
- }
-
- func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
- if let taskDidCompleteWithError = taskDidCompleteWithError {
- taskDidCompleteWithError(session, task, error)
- } else {
- if let error = error {
- self.error = error
-
- if let
- downloadDelegate = self as? DownloadTaskDelegate,
- userInfo = error.userInfo as? [String: AnyObject],
- resumeData = userInfo[NSURLSessionDownloadTaskResumeData] as? NSData
- {
- downloadDelegate.resumeData = resumeData
- }
- }
-
- queue.suspended = false
- }
- }
- }
-
- // MARK: - DataTaskDelegate
-
- class DataTaskDelegate: TaskDelegate, NSURLSessionDataDelegate {
- var dataTask: NSURLSessionDataTask? { return task as? NSURLSessionDataTask }
-
- private var totalBytesReceived: Int64 = 0
- private var mutableData: NSMutableData
- override var data: NSData? {
- if dataStream != nil {
- return nil
- } else {
- return mutableData
- }
- }
-
- private var expectedContentLength: Int64?
- private var dataProgress: ((bytesReceived: Int64, totalBytesReceived: Int64, totalBytesExpectedToReceive: Int64) -> Void)?
- private var dataStream: ((data: NSData) -> Void)?
-
- override init(task: NSURLSessionTask) {
- mutableData = NSMutableData()
- super.init(task: task)
- }
-
- // MARK: - NSURLSessionDataDelegate
-
- // MARK: Override Closures
-
- var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)?
- var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)?
- var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)?
- var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didReceiveResponse response: NSURLResponse,
- completionHandler: (NSURLSessionResponseDisposition -> Void))
- {
- var disposition: NSURLSessionResponseDisposition = .Allow
-
- expectedContentLength = response.expectedContentLength
-
- if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse {
- disposition = dataTaskDidReceiveResponse(session, dataTask, response)
- }
-
- completionHandler(disposition)
- }
-
- func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask)
- {
- dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask)
- }
-
- func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
- if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
-
- if let dataTaskDidReceiveData = dataTaskDidReceiveData {
- dataTaskDidReceiveData(session, dataTask, data)
- } else {
- if let dataStream = dataStream {
- dataStream(data: data)
- } else {
- mutableData.appendData(data)
- }
-
- totalBytesReceived += data.length
- let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown
-
- progress.totalUnitCount = totalBytesExpected
- progress.completedUnitCount = totalBytesReceived
-
- dataProgress?(
- bytesReceived: Int64(data.length),
- totalBytesReceived: totalBytesReceived,
- totalBytesExpectedToReceive: totalBytesExpected
- )
- }
- }
-
- func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- willCacheResponse proposedResponse: NSCachedURLResponse,
- completionHandler: ((NSCachedURLResponse?) -> Void))
- {
- var cachedResponse: NSCachedURLResponse? = proposedResponse
-
- if let dataTaskWillCacheResponse = dataTaskWillCacheResponse {
- cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse)
- }
-
- completionHandler(cachedResponse)
- }
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Request: CustomStringConvertible {
-
- /**
- The textual representation used when written to an output stream, which includes the HTTP method and URL, as
- well as the response status code if a response has been received.
- */
- public var description: String {
- var components: [String] = []
-
- if let HTTPMethod = request?.HTTPMethod {
- components.append(HTTPMethod)
- }
-
- if let URLString = request?.URL?.absoluteString {
- components.append(URLString)
- }
-
- if let response = response {
- components.append("(\(response.statusCode))")
- }
-
- return components.joinWithSeparator(" ")
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Request: CustomDebugStringConvertible {
- func cURLRepresentation() -> String {
- var components = ["$ curl -i"]
-
- guard let
- request = self.request,
- URL = request.URL,
- host = URL.host
- else {
- return "$ curl command could not be created"
- }
-
- if let HTTPMethod = request.HTTPMethod where HTTPMethod != "GET" {
- components.append("-X \(HTTPMethod)")
- }
-
- if let credentialStorage = self.session.configuration.URLCredentialStorage {
- let protectionSpace = NSURLProtectionSpace(
- host: host,
- port: URL.port?.integerValue ?? 0,
- protocol: URL.scheme,
- realm: host,
- authenticationMethod: NSURLAuthenticationMethodHTTPBasic
- )
-
- if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values {
- for credential in credentials {
- components.append("-u \(credential.user!):\(credential.password!)")
- }
- } else {
- if let credential = delegate.credential {
- components.append("-u \(credential.user!):\(credential.password!)")
- }
- }
- }
-
- if session.configuration.HTTPShouldSetCookies {
- if let
- cookieStorage = session.configuration.HTTPCookieStorage,
- cookies = cookieStorage.cookiesForURL(URL) where !cookies.isEmpty
- {
- let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value ?? String());" }
- components.append("-b \"\(string.substringToIndex(string.endIndex.predecessor()))\"")
- }
- }
-
- var headers: [NSObject: AnyObject] = [:]
-
- if let additionalHeaders = session.configuration.HTTPAdditionalHeaders {
- for (field, value) in additionalHeaders where field != "Cookie" {
- headers[field] = value
- }
- }
-
- if let headerFields = request.allHTTPHeaderFields {
- for (field, value) in headerFields where field != "Cookie" {
- headers[field] = value
- }
- }
-
- for (field, value) in headers {
- components.append("-H \"\(field): \(value)\"")
- }
-
- if let
- HTTPBodyData = request.HTTPBody,
- HTTPBody = String(data: HTTPBodyData, encoding: NSUTF8StringEncoding)
- {
- var escapedBody = HTTPBody.stringByReplacingOccurrencesOfString("\\\"", withString: "\\\\\"")
- escapedBody = escapedBody.stringByReplacingOccurrencesOfString("\"", withString: "\\\"")
-
- components.append("-d \"\(escapedBody)\"")
- }
-
- components.append("\"\(URL.absoluteString)\"")
-
- return components.joinWithSeparator(" \\\n\t")
- }
-
- /// The textual representation used when written to an output stream, in the form of a cURL command.
- public var debugDescription: String {
- return cURLRepresentation()
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift
deleted file mode 100644
index 9c437ff6e416..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// Response.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Used to store all response data returned from a completed `Request`.
-public struct Response {
- /// The URL request sent to the server.
- public let request: NSURLRequest?
-
- /// The server's response to the URL request.
- public let response: NSHTTPURLResponse?
-
- /// The data returned by the server.
- public let data: NSData?
-
- /// The result of response serialization.
- public let result: Result
-
- /// The timeline of the complete lifecycle of the `Request`.
- public let timeline: Timeline
-
- /**
- Initializes the `Response` instance with the specified URL request, URL response, server data and response
- serialization result.
-
- - parameter request: The URL request sent to the server.
- - parameter response: The server's response to the URL request.
- - parameter data: The data returned by the server.
- - parameter result: The result of response serialization.
- - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`.
-
- - returns: the new `Response` instance.
- */
- public init(
- request: NSURLRequest?,
- response: NSHTTPURLResponse?,
- data: NSData?,
- result: Result,
- timeline: Timeline = Timeline())
- {
- self.request = request
- self.response = response
- self.data = data
- self.result = result
- self.timeline = timeline
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Response: CustomStringConvertible {
- /// The textual representation used when written to an output stream, which includes whether the result was a
- /// success or failure.
- public var description: String {
- return result.debugDescription
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Response: CustomDebugStringConvertible {
- /// The debug textual representation used when written to an output stream, which includes the URL request, the URL
- /// response, the server data and the response serialization result.
- public var debugDescription: String {
- var output: [String] = []
-
- output.append(request != nil ? "[Request]: \(request!)" : "[Request]: nil")
- output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil")
- output.append("[Data]: \(data?.length ?? 0) bytes")
- output.append("[Result]: \(result.debugDescription)")
- output.append("[Timeline]: \(timeline.debugDescription)")
-
- return output.joinWithSeparator("\n")
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift
deleted file mode 100644
index 89e39544b8c9..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift
+++ /dev/null
@@ -1,378 +0,0 @@
-//
-// ResponseSerialization.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-// MARK: ResponseSerializer
-
-/**
- The type in which all response serializers must conform to in order to serialize a response.
-*/
-public protocol ResponseSerializerType {
- /// The type of serialized object to be created by this `ResponseSerializerType`.
- associatedtype SerializedObject
-
- /// The type of error to be created by this `ResponseSerializer` if serialization fails.
- associatedtype ErrorObject: ErrorType
-
- /**
- A closure used by response handlers that takes a request, response, data and error and returns a result.
- */
- var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result { get }
-}
-
-// MARK: -
-
-/**
- A generic `ResponseSerializerType` used to serialize a request, response, and data into a serialized object.
-*/
-public struct ResponseSerializer: ResponseSerializerType {
- /// The type of serialized object to be created by this `ResponseSerializer`.
- public typealias SerializedObject = Value
-
- /// The type of error to be created by this `ResponseSerializer` if serialization fails.
- public typealias ErrorObject = Error
-
- /**
- A closure used by response handlers that takes a request, response, data and error and returns a result.
- */
- public var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result
-
- /**
- Initializes the `ResponseSerializer` instance with the given serialize response closure.
-
- - parameter serializeResponse: The closure used to serialize the response.
-
- - returns: The new generic response serializer instance.
- */
- public init(serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result) {
- self.serializeResponse = serializeResponse
- }
-}
-
-// MARK: - Default
-
-extension Request {
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter queue: The queue on which the completion handler is dispatched.
- - parameter completionHandler: The code to be executed once the request has finished.
-
- - returns: The request.
- */
- public func response(
- queue queue: dispatch_queue_t? = nil,
- completionHandler: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Void)
- -> Self
- {
- delegate.queue.addOperationWithBlock {
- dispatch_async(queue ?? dispatch_get_main_queue()) {
- completionHandler(self.request, self.response, self.delegate.data, self.delegate.error)
- }
- }
-
- return self
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter queue: The queue on which the completion handler is dispatched.
- - parameter responseSerializer: The response serializer responsible for serializing the request, response,
- and data.
- - parameter completionHandler: The code to be executed once the request has finished.
-
- - returns: The request.
- */
- public func response(
- queue queue: dispatch_queue_t? = nil,
- responseSerializer: T,
- completionHandler: Response -> Void)
- -> Self
- {
- delegate.queue.addOperationWithBlock {
- let result = responseSerializer.serializeResponse(
- self.request,
- self.response,
- self.delegate.data,
- self.delegate.error
- )
-
- let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent()
- let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime
-
- let timeline = Timeline(
- requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(),
- initialResponseTime: initialResponseTime,
- requestCompletedTime: requestCompletedTime,
- serializationCompletedTime: CFAbsoluteTimeGetCurrent()
- )
-
- let response = Response(
- request: self.request,
- response: self.response,
- data: self.delegate.data,
- result: result,
- timeline: timeline
- )
-
- dispatch_async(queue ?? dispatch_get_main_queue()) { completionHandler(response) }
- }
-
- return self
- }
-}
-
-// MARK: - Data
-
-extension Request {
-
- /**
- Creates a response serializer that returns the associated data as-is.
-
- - returns: A data response serializer.
- */
- public static func dataResponseSerializer() -> ResponseSerializer {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success(NSData()) }
-
- guard let validData = data else {
- let failureReason = "Data could not be serialized. Input data was nil."
- let error = Error.error(code: .DataSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- return .Success(validData)
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter completionHandler: The code to be executed once the request has finished.
-
- - returns: The request.
- */
- public func responseData(
- queue queue: dispatch_queue_t? = nil,
- completionHandler: Response -> Void)
- -> Self
- {
- return response(queue: queue, responseSerializer: Request.dataResponseSerializer(), completionHandler: completionHandler)
- }
-}
-
-// MARK: - String
-
-extension Request {
-
- /**
- Creates a response serializer that returns a string initialized from the response data with the specified
- string encoding.
-
- - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server
- response, falling back to the default HTTP default character set, ISO-8859-1.
-
- - returns: A string response serializer.
- */
- public static func stringResponseSerializer(
- encoding encoding: NSStringEncoding? = nil)
- -> ResponseSerializer
- {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success("") }
-
- guard let validData = data else {
- let failureReason = "String could not be serialized. Input data was nil."
- let error = Error.error(code: .StringSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- var convertedEncoding = encoding
-
- if let encodingName = response?.textEncodingName where convertedEncoding == nil {
- convertedEncoding = CFStringConvertEncodingToNSStringEncoding(
- CFStringConvertIANACharSetNameToEncoding(encodingName)
- )
- }
-
- let actualEncoding = convertedEncoding ?? NSISOLatin1StringEncoding
-
- if let string = String(data: validData, encoding: actualEncoding) {
- return .Success(string)
- } else {
- let failureReason = "String could not be serialized with encoding: \(actualEncoding)"
- let error = Error.error(code: .StringSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the
- server response, falling back to the default HTTP default character set,
- ISO-8859-1.
- - parameter completionHandler: A closure to be executed once the request has finished.
-
- - returns: The request.
- */
- public func responseString(
- queue queue: dispatch_queue_t? = nil,
- encoding: NSStringEncoding? = nil,
- completionHandler: Response -> Void)
- -> Self
- {
- return response(
- queue: queue,
- responseSerializer: Request.stringResponseSerializer(encoding: encoding),
- completionHandler: completionHandler
- )
- }
-}
-
-// MARK: - JSON
-
-extension Request {
-
- /**
- Creates a response serializer that returns a JSON object constructed from the response data using
- `NSJSONSerialization` with the specified reading options.
-
- - parameter options: The JSON serialization reading options. `.AllowFragments` by default.
-
- - returns: A JSON object response serializer.
- */
- public static func JSONResponseSerializer(
- options options: NSJSONReadingOptions = .AllowFragments)
- -> ResponseSerializer
- {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success(NSNull()) }
-
- guard let validData = data where validData.length > 0 else {
- let failureReason = "JSON could not be serialized. Input data was nil or zero length."
- let error = Error.error(code: .JSONSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- do {
- let JSON = try NSJSONSerialization.JSONObjectWithData(validData, options: options)
- return .Success(JSON)
- } catch {
- return .Failure(error as NSError)
- }
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter options: The JSON serialization reading options. `.AllowFragments` by default.
- - parameter completionHandler: A closure to be executed once the request has finished.
-
- - returns: The request.
- */
- public func responseJSON(
- queue queue: dispatch_queue_t? = nil,
- options: NSJSONReadingOptions = .AllowFragments,
- completionHandler: Response -> Void)
- -> Self
- {
- return response(
- queue: queue,
- responseSerializer: Request.JSONResponseSerializer(options: options),
- completionHandler: completionHandler
- )
- }
-}
-
-// MARK: - Property List
-
-extension Request {
-
- /**
- Creates a response serializer that returns an object constructed from the response data using
- `NSPropertyListSerialization` with the specified reading options.
-
- - parameter options: The property list reading options. `NSPropertyListReadOptions()` by default.
-
- - returns: A property list object response serializer.
- */
- public static func propertyListResponseSerializer(
- options options: NSPropertyListReadOptions = NSPropertyListReadOptions())
- -> ResponseSerializer
- {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success(NSNull()) }
-
- guard let validData = data where validData.length > 0 else {
- let failureReason = "Property list could not be serialized. Input data was nil or zero length."
- let error = Error.error(code: .PropertyListSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- do {
- let plist = try NSPropertyListSerialization.propertyListWithData(validData, options: options, format: nil)
- return .Success(plist)
- } catch {
- return .Failure(error as NSError)
- }
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter options: The property list reading options. `0` by default.
- - parameter completionHandler: A closure to be executed once the request has finished. The closure takes 3
- arguments: the URL request, the URL response, the server data and the result
- produced while creating the property list.
-
- - returns: The request.
- */
- public func responsePropertyList(
- queue queue: dispatch_queue_t? = nil,
- options: NSPropertyListReadOptions = NSPropertyListReadOptions(),
- completionHandler: Response -> Void)
- -> Self
- {
- return response(
- queue: queue,
- responseSerializer: Request.propertyListResponseSerializer(options: options),
- completionHandler: completionHandler
- )
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift
deleted file mode 100644
index 4aabf08bf8b4..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Result.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/**
- Used to represent whether a request was successful or encountered an error.
-
- - Success: The request and all post processing operations were successful resulting in the serialization of the
- provided associated value.
- - Failure: The request encountered an error resulting in a failure. The associated values are the original data
- provided by the server as well as the error that caused the failure.
-*/
-public enum Result {
- case Success(Value)
- case Failure(Error)
-
- /// Returns `true` if the result is a success, `false` otherwise.
- public var isSuccess: Bool {
- switch self {
- case .Success:
- return true
- case .Failure:
- return false
- }
- }
-
- /// Returns `true` if the result is a failure, `false` otherwise.
- public var isFailure: Bool {
- return !isSuccess
- }
-
- /// Returns the associated value if the result is a success, `nil` otherwise.
- public var value: Value? {
- switch self {
- case .Success(let value):
- return value
- case .Failure:
- return nil
- }
- }
-
- /// Returns the associated error value if the result is a failure, `nil` otherwise.
- public var error: Error? {
- switch self {
- case .Success:
- return nil
- case .Failure(let error):
- return error
- }
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Result: CustomStringConvertible {
- /// The textual representation used when written to an output stream, which includes whether the result was a
- /// success or failure.
- public var description: String {
- switch self {
- case .Success:
- return "SUCCESS"
- case .Failure:
- return "FAILURE"
- }
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Result: CustomDebugStringConvertible {
- /// The debug textual representation used when written to an output stream, which includes whether the result was a
- /// success or failure in addition to the value or error.
- public var debugDescription: String {
- switch self {
- case .Success(let value):
- return "SUCCESS: \(value)"
- case .Failure(let error):
- return "FAILURE: \(error)"
- }
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift
deleted file mode 100644
index 7da516e8038e..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift
+++ /dev/null
@@ -1,304 +0,0 @@
-//
-// ServerTrustPolicy.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host.
-public class ServerTrustPolicyManager {
- /// The dictionary of policies mapped to a particular host.
- public let policies: [String: ServerTrustPolicy]
-
- /**
- Initializes the `ServerTrustPolicyManager` instance with the given policies.
-
- Since different servers and web services can have different leaf certificates, intermediate and even root
- certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This
- allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key
- pinning for host3 and disabling evaluation for host4.
-
- - parameter policies: A dictionary of all policies mapped to a particular host.
-
- - returns: The new `ServerTrustPolicyManager` instance.
- */
- public init(policies: [String: ServerTrustPolicy]) {
- self.policies = policies
- }
-
- /**
- Returns the `ServerTrustPolicy` for the given host if applicable.
-
- By default, this method will return the policy that perfectly matches the given host. Subclasses could override
- this method and implement more complex mapping implementations such as wildcards.
-
- - parameter host: The host to use when searching for a matching policy.
-
- - returns: The server trust policy for the given host if found.
- */
- public func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? {
- return policies[host]
- }
-}
-
-// MARK: -
-
-extension NSURLSession {
- private struct AssociatedKeys {
- static var ManagerKey = "NSURLSession.ServerTrustPolicyManager"
- }
-
- var serverTrustPolicyManager: ServerTrustPolicyManager? {
- get {
- return objc_getAssociatedObject(self, &AssociatedKeys.ManagerKey) as? ServerTrustPolicyManager
- }
- set (manager) {
- objc_setAssociatedObject(self, &AssociatedKeys.ManagerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
- }
- }
-}
-
-// MARK: - ServerTrustPolicy
-
-/**
- The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when
- connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust
- with a given set of criteria to determine whether the server trust is valid and the connection should be made.
-
- Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other
- vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged
- to route all communication over an HTTPS connection with pinning enabled.
-
- - PerformDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to
- validate the host provided by the challenge. Applications are encouraged to always
- validate the host in production environments to guarantee the validity of the server's
- certificate chain.
-
- - PinCertificates: Uses the pinned certificates to validate the server trust. The server trust is
- considered valid if one of the pinned certificates match one of the server certificates.
- By validating both the certificate chain and host, certificate pinning provides a very
- secure form of server trust validation mitigating most, if not all, MITM attacks.
- Applications are encouraged to always validate the host and require a valid certificate
- chain in production environments.
-
- - PinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered
- valid if one of the pinned public keys match one of the server certificate public keys.
- By validating both the certificate chain and host, public key pinning provides a very
- secure form of server trust validation mitigating most, if not all, MITM attacks.
- Applications are encouraged to always validate the host and require a valid certificate
- chain in production environments.
-
- - DisableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid.
-
- - CustomEvaluation: Uses the associated closure to evaluate the validity of the server trust.
-*/
-public enum ServerTrustPolicy {
- case PerformDefaultEvaluation(validateHost: Bool)
- case PinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool)
- case PinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool)
- case DisableEvaluation
- case CustomEvaluation((serverTrust: SecTrust, host: String) -> Bool)
-
- // MARK: - Bundle Location
-
- /**
- Returns all certificates within the given bundle with a `.cer` file extension.
-
- - parameter bundle: The bundle to search for all `.cer` files.
-
- - returns: All certificates within the given bundle.
- */
- public static func certificatesInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecCertificate] {
- var certificates: [SecCertificate] = []
-
- let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in
- bundle.pathsForResourcesOfType(fileExtension, inDirectory: nil)
- }.flatten())
-
- for path in paths {
- if let
- certificateData = NSData(contentsOfFile: path),
- certificate = SecCertificateCreateWithData(nil, certificateData)
- {
- certificates.append(certificate)
- }
- }
-
- return certificates
- }
-
- /**
- Returns all public keys within the given bundle with a `.cer` file extension.
-
- - parameter bundle: The bundle to search for all `*.cer` files.
-
- - returns: All public keys within the given bundle.
- */
- public static func publicKeysInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecKey] {
- var publicKeys: [SecKey] = []
-
- for certificate in certificatesInBundle(bundle) {
- if let publicKey = publicKeyForCertificate(certificate) {
- publicKeys.append(publicKey)
- }
- }
-
- return publicKeys
- }
-
- // MARK: - Evaluation
-
- /**
- Evaluates whether the server trust is valid for the given host.
-
- - parameter serverTrust: The server trust to evaluate.
- - parameter host: The host of the challenge protection space.
-
- - returns: Whether the server trust is valid.
- */
- public func evaluateServerTrust(serverTrust: SecTrust, isValidForHost host: String) -> Bool {
- var serverTrustIsValid = false
-
- switch self {
- case let .PerformDefaultEvaluation(validateHost):
- let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil)
- SecTrustSetPolicies(serverTrust, [policy])
-
- serverTrustIsValid = trustIsValid(serverTrust)
- case let .PinCertificates(pinnedCertificates, validateCertificateChain, validateHost):
- if validateCertificateChain {
- let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil)
- SecTrustSetPolicies(serverTrust, [policy])
-
- SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates)
- SecTrustSetAnchorCertificatesOnly(serverTrust, true)
-
- serverTrustIsValid = trustIsValid(serverTrust)
- } else {
- let serverCertificatesDataArray = certificateDataForTrust(serverTrust)
- let pinnedCertificatesDataArray = certificateDataForCertificates(pinnedCertificates)
-
- outerLoop: for serverCertificateData in serverCertificatesDataArray {
- for pinnedCertificateData in pinnedCertificatesDataArray {
- if serverCertificateData.isEqualToData(pinnedCertificateData) {
- serverTrustIsValid = true
- break outerLoop
- }
- }
- }
- }
- case let .PinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost):
- var certificateChainEvaluationPassed = true
-
- if validateCertificateChain {
- let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil)
- SecTrustSetPolicies(serverTrust, [policy])
-
- certificateChainEvaluationPassed = trustIsValid(serverTrust)
- }
-
- if certificateChainEvaluationPassed {
- outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeysForTrust(serverTrust) as [AnyObject] {
- for pinnedPublicKey in pinnedPublicKeys as [AnyObject] {
- if serverPublicKey.isEqual(pinnedPublicKey) {
- serverTrustIsValid = true
- break outerLoop
- }
- }
- }
- }
- case .DisableEvaluation:
- serverTrustIsValid = true
- case let .CustomEvaluation(closure):
- serverTrustIsValid = closure(serverTrust: serverTrust, host: host)
- }
-
- return serverTrustIsValid
- }
-
- // MARK: - Private - Trust Validation
-
- private func trustIsValid(trust: SecTrust) -> Bool {
- var isValid = false
-
- var result = SecTrustResultType(kSecTrustResultInvalid)
- let status = SecTrustEvaluate(trust, &result)
-
- if status == errSecSuccess {
- let unspecified = SecTrustResultType(kSecTrustResultUnspecified)
- let proceed = SecTrustResultType(kSecTrustResultProceed)
-
- isValid = result == unspecified || result == proceed
- }
-
- return isValid
- }
-
- // MARK: - Private - Certificate Data
-
- private func certificateDataForTrust(trust: SecTrust) -> [NSData] {
- var certificates: [SecCertificate] = []
-
- for index in 0.. [NSData] {
- return certificates.map { SecCertificateCopyData($0) as NSData }
- }
-
- // MARK: - Private - Public Key Extraction
-
- private static func publicKeysForTrust(trust: SecTrust) -> [SecKey] {
- var publicKeys: [SecKey] = []
-
- for index in 0.. SecKey? {
- var publicKey: SecKey?
-
- let policy = SecPolicyCreateBasicX509()
- var trust: SecTrust?
- let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust)
-
- if let trust = trust where trustCreationStatus == errSecSuccess {
- publicKey = SecTrustCopyPublicKey(trust)
- }
-
- return publicKey
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift
deleted file mode 100644
index e463d9b2f818..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// Stream.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-#if !os(watchOS)
-
-@available(iOS 9.0, OSX 10.11, tvOS 9.0, *)
-extension Manager {
- private enum Streamable {
- case Stream(String, Int)
- case NetService(NSNetService)
- }
-
- private func stream(streamable: Streamable) -> Request {
- var streamTask: NSURLSessionStreamTask!
-
- switch streamable {
- case .Stream(let hostName, let port):
- dispatch_sync(queue) {
- streamTask = self.session.streamTaskWithHostName(hostName, port: port)
- }
- case .NetService(let netService):
- dispatch_sync(queue) {
- streamTask = self.session.streamTaskWithNetService(netService)
- }
- }
-
- let request = Request(session: session, task: streamTask)
-
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- /**
- Creates a request for bidirectional streaming with the given hostname and port.
-
- - parameter hostName: The hostname of the server to connect to.
- - parameter port: The port of the server to connect to.
-
- - returns: The created stream request.
- */
- public func stream(hostName hostName: String, port: Int) -> Request {
- return stream(.Stream(hostName, port))
- }
-
- /**
- Creates a request for bidirectional streaming with the given `NSNetService`.
-
- - parameter netService: The net service used to identify the endpoint.
-
- - returns: The created stream request.
- */
- public func stream(netService netService: NSNetService) -> Request {
- return stream(.NetService(netService))
- }
-}
-
-// MARK: -
-
-@available(iOS 9.0, OSX 10.11, tvOS 9.0, *)
-extension Manager.SessionDelegate: NSURLSessionStreamDelegate {
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:readClosedForStreamTask:`.
- public var streamTaskReadClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? {
- get {
- return _streamTaskReadClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void
- }
- set {
- _streamTaskReadClosed = newValue
- }
- }
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:writeClosedForStreamTask:`.
- public var streamTaskWriteClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? {
- get {
- return _streamTaskWriteClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void
- }
- set {
- _streamTaskWriteClosed = newValue
- }
- }
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:betterRouteDiscoveredForStreamTask:`.
- public var streamTaskBetterRouteDiscovered: ((NSURLSession, NSURLSessionStreamTask) -> Void)? {
- get {
- return _streamTaskBetterRouteDiscovered as? (NSURLSession, NSURLSessionStreamTask) -> Void
- }
- set {
- _streamTaskBetterRouteDiscovered = newValue
- }
- }
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:streamTask:didBecomeInputStream:outputStream:`.
- public var streamTaskDidBecomeInputStream: ((NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void)? {
- get {
- return _streamTaskDidBecomeInputStream as? (NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void
- }
- set {
- _streamTaskDidBecomeInputStream = newValue
- }
- }
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the read side of the connection has been closed.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- */
- public func URLSession(session: NSURLSession, readClosedForStreamTask streamTask: NSURLSessionStreamTask) {
- streamTaskReadClosed?(session, streamTask)
- }
-
- /**
- Tells the delegate that the write side of the connection has been closed.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- */
- public func URLSession(session: NSURLSession, writeClosedForStreamTask streamTask: NSURLSessionStreamTask) {
- streamTaskWriteClosed?(session, streamTask)
- }
-
- /**
- Tells the delegate that the system has determined that a better route to the host is available.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- */
- public func URLSession(session: NSURLSession, betterRouteDiscoveredForStreamTask streamTask: NSURLSessionStreamTask) {
- streamTaskBetterRouteDiscovered?(session, streamTask)
- }
-
- /**
- Tells the delegate that the stream task has been completed and provides the unopened stream objects.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- - parameter inputStream: The new input stream.
- - parameter outputStream: The new output stream.
- */
- public func URLSession(
- session: NSURLSession,
- streamTask: NSURLSessionStreamTask,
- didBecomeInputStream inputStream: NSInputStream,
- outputStream: NSOutputStream)
- {
- streamTaskDidBecomeInputStream?(session, streamTask, inputStream, outputStream)
- }
-}
-
-#endif
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift
deleted file mode 100644
index f34770579877..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// Timeline.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`.
-public struct Timeline {
- /// The time the request was initialized.
- public let requestStartTime: CFAbsoluteTime
-
- /// The time the first bytes were received from or sent to the server.
- public let initialResponseTime: CFAbsoluteTime
-
- /// The time when the request was completed.
- public let requestCompletedTime: CFAbsoluteTime
-
- /// The time when the response serialization was completed.
- public let serializationCompletedTime: CFAbsoluteTime
-
- /// The time interval in seconds from the time the request started to the initial response from the server.
- public let latency: NSTimeInterval
-
- /// The time interval in seconds from the time the request started to the time the request completed.
- public let requestDuration: NSTimeInterval
-
- /// The time interval in seconds from the time the request completed to the time response serialization completed.
- public let serializationDuration: NSTimeInterval
-
- /// The time interval in seconds from the time the request started to the time response serialization completed.
- public let totalDuration: NSTimeInterval
-
- /**
- Creates a new `Timeline` instance with the specified request times.
-
- - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`.
- - parameter initialResponseTime: The time the first bytes were received from or sent to the server.
- Defaults to `0.0`.
- - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`.
- - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults
- to `0.0`.
-
- - returns: The new `Timeline` instance.
- */
- public init(
- requestStartTime: CFAbsoluteTime = 0.0,
- initialResponseTime: CFAbsoluteTime = 0.0,
- requestCompletedTime: CFAbsoluteTime = 0.0,
- serializationCompletedTime: CFAbsoluteTime = 0.0)
- {
- self.requestStartTime = requestStartTime
- self.initialResponseTime = initialResponseTime
- self.requestCompletedTime = requestCompletedTime
- self.serializationCompletedTime = serializationCompletedTime
-
- self.latency = initialResponseTime - requestStartTime
- self.requestDuration = requestCompletedTime - requestStartTime
- self.serializationDuration = serializationCompletedTime - requestCompletedTime
- self.totalDuration = serializationCompletedTime - requestStartTime
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Timeline: CustomStringConvertible {
- /// The textual representation used when written to an output stream, which includes the latency, the request
- /// duration and the total duration.
- public var description: String {
- let latency = String(format: "%.3f", self.latency)
- let requestDuration = String(format: "%.3f", self.requestDuration)
- let serializationDuration = String(format: "%.3f", self.serializationDuration)
- let totalDuration = String(format: "%.3f", self.totalDuration)
-
- // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is
- // fixed, we should move back to string interpolation by reverting commit 7d4a43b1.
- let timings = [
- "\"Latency\": " + latency + " secs",
- "\"Request Duration\": " + requestDuration + " secs",
- "\"Serialization Duration\": " + serializationDuration + " secs",
- "\"Total Duration\": " + totalDuration + " secs"
- ]
-
- return "Timeline: { " + timings.joinWithSeparator(", ") + " }"
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Timeline: CustomDebugStringConvertible {
- /// The textual representation used when written to an output stream, which includes the request start time, the
- /// initial response time, the request completed time, the serialization completed time, the latency, the request
- /// duration and the total duration.
- public var debugDescription: String {
- let requestStartTime = String(format: "%.3f", self.requestStartTime)
- let initialResponseTime = String(format: "%.3f", self.initialResponseTime)
- let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime)
- let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime)
- let latency = String(format: "%.3f", self.latency)
- let requestDuration = String(format: "%.3f", self.requestDuration)
- let serializationDuration = String(format: "%.3f", self.serializationDuration)
- let totalDuration = String(format: "%.3f", self.totalDuration)
-
- // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is
- // fixed, we should move back to string interpolation by reverting commit 7d4a43b1.
- let timings = [
- "\"Request Start Time\": " + requestStartTime,
- "\"Initial Response Time\": " + initialResponseTime,
- "\"Request Completed Time\": " + requestCompletedTime,
- "\"Serialization Completed Time\": " + serializationCompletedTime,
- "\"Latency\": " + latency + " secs",
- "\"Request Duration\": " + requestDuration + " secs",
- "\"Serialization Duration\": " + serializationDuration + " secs",
- "\"Total Duration\": " + totalDuration + " secs"
- ]
-
- return "Timeline: { " + timings.joinWithSeparator(", ") + " }"
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift
deleted file mode 100644
index 21971e6e4657..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift
+++ /dev/null
@@ -1,376 +0,0 @@
-//
-// Upload.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-extension Manager {
- private enum Uploadable {
- case Data(NSURLRequest, NSData)
- case File(NSURLRequest, NSURL)
- case Stream(NSURLRequest, NSInputStream)
- }
-
- private func upload(uploadable: Uploadable) -> Request {
- var uploadTask: NSURLSessionUploadTask!
- var HTTPBodyStream: NSInputStream?
-
- switch uploadable {
- case .Data(let request, let data):
- dispatch_sync(queue) {
- uploadTask = self.session.uploadTaskWithRequest(request, fromData: data)
- }
- case .File(let request, let fileURL):
- dispatch_sync(queue) {
- uploadTask = self.session.uploadTaskWithRequest(request, fromFile: fileURL)
- }
- case .Stream(let request, let stream):
- dispatch_sync(queue) {
- uploadTask = self.session.uploadTaskWithStreamedRequest(request)
- }
-
- HTTPBodyStream = stream
- }
-
- let request = Request(session: session, task: uploadTask)
-
- if HTTPBodyStream != nil {
- request.delegate.taskNeedNewBodyStream = { _, _ in
- return HTTPBodyStream
- }
- }
-
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- // MARK: File
-
- /**
- Creates a request for uploading a file to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
- - parameter file: The file to upload
-
- - returns: The created upload request.
- */
- public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request {
- return upload(.File(URLRequest.URLRequest, file))
- }
-
- /**
- Creates a request for uploading a file to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter file: The file to upload
-
- - returns: The created upload request.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- file: NSURL)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
- return upload(mutableURLRequest, file: file)
- }
-
- // MARK: Data
-
- /**
- Creates a request for uploading data to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request.
- - parameter data: The data to upload.
-
- - returns: The created upload request.
- */
- public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request {
- return upload(.Data(URLRequest.URLRequest, data))
- }
-
- /**
- Creates a request for uploading data to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter data: The data to upload
-
- - returns: The created upload request.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- data: NSData)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
-
- return upload(mutableURLRequest, data: data)
- }
-
- // MARK: Stream
-
- /**
- Creates a request for uploading a stream to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
- */
- public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request {
- return upload(.Stream(URLRequest.URLRequest, stream))
- }
-
- /**
- Creates a request for uploading a stream to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- stream: NSInputStream)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
-
- return upload(mutableURLRequest, stream: stream)
- }
-
- // MARK: MultipartFormData
-
- /// Default memory threshold used when encoding `MultipartFormData`.
- public static let MultipartFormDataEncodingMemoryThreshold: UInt64 = 10 * 1024 * 1024
-
- /**
- Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as
- associated values.
-
- - Success: Represents a successful `MultipartFormData` encoding and contains the new `Request` along with
- streaming information.
- - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding
- error.
- */
- public enum MultipartFormDataEncodingResult {
- case Success(request: Request, streamingFromDisk: Bool, streamFileURL: NSURL?)
- case Failure(ErrorType)
- }
-
- /**
- Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request.
-
- It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative
- payload is small, encoding the data in-memory and directly uploading to a server is the by far the most
- efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to
- be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory
- footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be
- used for larger payloads such as video content.
-
- The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory
- or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`,
- encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk
- during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding
- technique was used.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (MultipartFormDataEncodingResult -> Void)?)
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
-
- return upload(
- mutableURLRequest,
- multipartFormData: multipartFormData,
- encodingMemoryThreshold: encodingMemoryThreshold,
- encodingCompletion: encodingCompletion
- )
- }
-
- /**
- Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request.
-
- It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative
- payload is small, encoding the data in-memory and directly uploading to a server is the by far the most
- efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to
- be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory
- footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be
- used for larger payloads such as video content.
-
- The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory
- or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`,
- encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk
- during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding
- technique was used.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
- */
- public func upload(
- URLRequest: URLRequestConvertible,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (MultipartFormDataEncodingResult -> Void)?)
- {
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
- let formData = MultipartFormData()
- multipartFormData(formData)
-
- let URLRequestWithContentType = URLRequest.URLRequest
- URLRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type")
-
- let isBackgroundSession = self.session.configuration.identifier != nil
-
- if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession {
- do {
- let data = try formData.encode()
- let encodingResult = MultipartFormDataEncodingResult.Success(
- request: self.upload(URLRequestWithContentType, data: data),
- streamingFromDisk: false,
- streamFileURL: nil
- )
-
- dispatch_async(dispatch_get_main_queue()) {
- encodingCompletion?(encodingResult)
- }
- } catch {
- dispatch_async(dispatch_get_main_queue()) {
- encodingCompletion?(.Failure(error as NSError))
- }
- }
- } else {
- let fileManager = NSFileManager.defaultManager()
- let tempDirectoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory())
- let directoryURL = tempDirectoryURL.URLByAppendingPathComponent("com.alamofire.manager/multipart.form.data")
- let fileName = NSUUID().UUIDString
- let fileURL = directoryURL.URLByAppendingPathComponent(fileName)
-
- do {
- try fileManager.createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil)
- try formData.writeEncodedDataToDisk(fileURL)
-
- dispatch_async(dispatch_get_main_queue()) {
- let encodingResult = MultipartFormDataEncodingResult.Success(
- request: self.upload(URLRequestWithContentType, file: fileURL),
- streamingFromDisk: true,
- streamFileURL: fileURL
- )
- encodingCompletion?(encodingResult)
- }
- } catch {
- dispatch_async(dispatch_get_main_queue()) {
- encodingCompletion?(.Failure(error as NSError))
- }
- }
- }
- }
- }
-}
-
-// MARK: -
-
-extension Request {
-
- // MARK: - UploadTaskDelegate
-
- class UploadTaskDelegate: DataTaskDelegate {
- var uploadTask: NSURLSessionUploadTask? { return task as? NSURLSessionUploadTask }
- var uploadProgress: ((Int64, Int64, Int64) -> Void)!
-
- // MARK: - NSURLSessionTaskDelegate
-
- // MARK: Override Closures
-
- var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didSendBodyData bytesSent: Int64,
- totalBytesSent: Int64,
- totalBytesExpectedToSend: Int64)
- {
- if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
-
- if let taskDidSendBodyData = taskDidSendBodyData {
- taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend)
- } else {
- progress.totalUnitCount = totalBytesExpectedToSend
- progress.completedUnitCount = totalBytesSent
-
- uploadProgress?(bytesSent, totalBytesSent, totalBytesExpectedToSend)
- }
- }
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift
deleted file mode 100644
index b94e07d1e4eb..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-// Validation.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-extension Request {
-
- /**
- Used to represent whether validation was successful or encountered an error resulting in a failure.
-
- - Success: The validation was successful.
- - Failure: The validation failed encountering the provided error.
- */
- public enum ValidationResult {
- case Success
- case Failure(NSError)
- }
-
- /**
- A closure used to validate a request that takes a URL request and URL response, and returns whether the
- request was valid.
- */
- public typealias Validation = (NSURLRequest?, NSHTTPURLResponse) -> ValidationResult
-
- /**
- Validates the request, using the specified closure.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - parameter validation: A closure to validate the request.
-
- - returns: The request.
- */
- public func validate(validation: Validation) -> Self {
- delegate.queue.addOperationWithBlock {
- if let
- response = self.response where self.delegate.error == nil,
- case let .Failure(error) = validation(self.request, response)
- {
- self.delegate.error = error
- }
- }
-
- return self
- }
-
- // MARK: - Status Code
-
- /**
- Validates that the response has a status code in the specified range.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - parameter range: The range of acceptable status codes.
-
- - returns: The request.
- */
- public func validate(statusCode acceptableStatusCode: S) -> Self {
- return validate { _, response in
- if acceptableStatusCode.contains(response.statusCode) {
- return .Success
- } else {
- let failureReason = "Response status code was unacceptable: \(response.statusCode)"
-
- let error = NSError(
- domain: Error.Domain,
- code: Error.Code.StatusCodeValidationFailed.rawValue,
- userInfo: [
- NSLocalizedFailureReasonErrorKey: failureReason,
- Error.UserInfoKeys.StatusCode: response.statusCode
- ]
- )
-
- return .Failure(error)
- }
- }
- }
-
- // MARK: - Content-Type
-
- private struct MIMEType {
- let type: String
- let subtype: String
-
- init?(_ string: String) {
- let components: [String] = {
- let stripped = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
- let split = stripped.substringToIndex(stripped.rangeOfString(";")?.startIndex ?? stripped.endIndex)
- return split.componentsSeparatedByString("/")
- }()
-
- if let
- type = components.first,
- subtype = components.last
- {
- self.type = type
- self.subtype = subtype
- } else {
- return nil
- }
- }
-
- func matches(MIME: MIMEType) -> Bool {
- switch (type, subtype) {
- case (MIME.type, MIME.subtype), (MIME.type, "*"), ("*", MIME.subtype), ("*", "*"):
- return true
- default:
- return false
- }
- }
- }
-
- /**
- Validates that the response has a content type in the specified array.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes.
-
- - returns: The request.
- */
- public func validate(contentType acceptableContentTypes: S) -> Self {
- return validate { _, response in
- guard let validData = self.delegate.data where validData.length > 0 else { return .Success }
-
- if let
- responseContentType = response.MIMEType,
- responseMIMEType = MIMEType(responseContentType)
- {
- for contentType in acceptableContentTypes {
- if let acceptableMIMEType = MIMEType(contentType) where acceptableMIMEType.matches(responseMIMEType) {
- return .Success
- }
- }
- } else {
- for contentType in acceptableContentTypes {
- if let MIMEType = MIMEType(contentType) where MIMEType.type == "*" && MIMEType.subtype == "*" {
- return .Success
- }
- }
- }
-
- let contentType: String
- let failureReason: String
-
- if let responseContentType = response.MIMEType {
- contentType = responseContentType
-
- failureReason = (
- "Response content type \"\(responseContentType)\" does not match any acceptable " +
- "content types: \(acceptableContentTypes)"
- )
- } else {
- contentType = ""
- failureReason = "Response content type was missing and acceptable content type does not match \"*/*\""
- }
-
- let error = NSError(
- domain: Error.Domain,
- code: Error.Code.ContentTypeValidationFailed.rawValue,
- userInfo: [
- NSLocalizedFailureReasonErrorKey: failureReason,
- Error.UserInfoKeys.ContentType: contentType
- ]
- )
-
- return .Failure(error)
- }
- }
-
- // MARK: - Automatic
-
- /**
- Validates that the response has a status code in the default acceptable range of 200...299, and that the content
- type matches any specified in the Accept HTTP header field.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - returns: The request.
- */
- public func validate() -> Self {
- let acceptableStatusCodes: Range = 200..<300
- let acceptableContentTypes: [String] = {
- if let accept = request?.valueForHTTPHeaderField("Accept") {
- return accept.componentsSeparatedByString(",")
- }
-
- return ["*/*"]
- }()
-
- return validate(statusCode: acceptableStatusCodes).validate(contentType: acceptableContentTypes)
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json
deleted file mode 100644
index 4cdc0899bd5a..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "PetstoreClient",
- "platforms": {
- "ios": "8.0",
- "osx": "10.9"
- },
- "version": "0.0.1",
- "source": {
- "git": "git@github.com:swagger-api/swagger-mustache.git",
- "tag": "v1.0.0"
- },
- "authors": "",
- "license": "Apache License, Version 2.0",
- "homepage": "https://github.com/swagger-api/swagger-codegen",
- "summary": "PetstoreClient",
- "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift",
- "dependencies": {
- "Alamofire": [
- "~> 3.4.1"
- ]
- }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Manifest.lock
deleted file mode 100644
index 5dc0c9e1151b..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Manifest.lock
+++ /dev/null
@@ -1,19 +0,0 @@
-PODS:
- - Alamofire (3.4.2)
- - PetstoreClient (0.0.1):
- - Alamofire (~> 3.4.1)
-
-DEPENDENCIES:
- - PetstoreClient (from `../`)
-
-EXTERNAL SOURCES:
- PetstoreClient:
- :path: "../"
-
-SPEC CHECKSUMS:
- Alamofire: 6aa33201d20d069e1598891cf928883ff1888c7a
- PetstoreClient: 7489b461499be1b2c4e0ed6624ca76c8db506297
-
-PODFILE CHECKSUM: 84472aca2a88b7f7ed9fcd63e9f5fdb5ad4aab94
-
-COCOAPODS: 1.0.0
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj
deleted file mode 100644
index 1b141de23529..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,1011 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 095406039B4D371E48D08B38A2975AC8 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1F9022AC9979CD59E8F83962DAF51D /* Error.swift */; };
- 121BA006C3D23D9290D868AA19E4BFBA /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */; };
- 16102E4E35FAA0FC4161282FECE56469 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DBA7F3642776C1964512C9A38829081 /* Timeline.swift */; };
- 1ED3811BA132299733D3A71543A4339C /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0266C5AE0B23A436291F6647902086 /* Models.swift */; };
- 2737DA3907C231E7CCCBF6075FCE4AB3 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */; };
- 2D3405986FC586FA6C0A5E0B6BA7E64E /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658CBED44D4009D80F990A188D7A8B3F /* Validation.swift */; };
- 34CCDCA848A701466256BC2927DA8856 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9278DA00F41E390EE68B6F3C8161C54 /* NetworkReachabilityManager.swift */; };
- 37D0F7B54F7677AEB499F204040C6DA1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; };
- 388FE86EB5084CB37EC19ED82DE8242C /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */; };
- 39EBC7781F42F6F790D3E54F3E8D8ED1 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */; };
- 3CA0C61EB5AA01268C12B7E61FF59C56 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; };
- 3EA8F215C9C1432D74E5CCA4834AA8C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2959D264574F227296E36F7CDF2E4F4F /* ResponseSerialization.swift */; };
- 4081EA628AF0B73AC51FFB9D7AB3B89E /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 101C763FD5409006D69EDB82815E4A61 /* Manager.swift */; };
- 40AED0FDEFFB776F649058C34D72BB95 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; };
- 45961D28C6B8E4BAB87690F714B8727B /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; };
- 562F951C949B9293B74C2E5D86BEF1BC /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */; };
- 59C731A013A3F62794AABFB1C1025B4F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8072E1108951F272C003553FC8926C7 /* APIs.swift */; };
- 5BC19E6E0F199276003F0AF96838BCE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09DC3EB7B14F56C5823591E484CC06DC /* Upload.swift */; };
- 5CB05FBCB32D21E194B5ECF680CB6AE0 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BCAC7849E43619A0E6BA6D3291D195 /* Download.swift */; };
- 62E8346F03C03E7F4D631361F325689E /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2C7A48545D8C54D52554343225FB8 /* Response.swift */; };
- 7B48852C4D848FA2DA416A98F6425869 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E07E98001DB6C163294A39CAB05963D /* ServerTrustPolicy.swift */; };
- 7D0C7E08FEC92B9C59B3EAFB8D15026D /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */; };
- 816BE1BBC1F4E434D7BD3F793F38B347 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 897283A0B7F5299913327CC8FD6CC997 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 8EB11202167FCDDF1257AAAB1D1FB244 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED443D528393D61A04FBD88603DE5F3 /* Alamofire.swift */; };
- 909E1A21FF97D3DFD0E2707B0E078686 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */; };
- 91C09AC2A52ED69A27C8D923139A006F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; };
- 93A9E4EBCD41B6C350DB55CB545D797E /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */; };
- 9469DF81ECB494E84675969B5E13374C /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = AE6827D6CBD3F8B59B79641ABF6ED159 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- A871DC508D9A11F280135D7B56266E97 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- AA314156AC500125F4078EE968DB14C6 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E393CF47FE31F265B29AA2D9B67C656 /* Result.swift */; };
- ADF19C953CE2A7D0B72EC93A81FCCC26 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FD74E0A1B7122513F9BCD2B66B65219 /* Alamofire-dummy.m */; };
- AE4CF87C02C042DF13ED5B21C4FDC1E0 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9039D48B1E893EF8AD87645A4FF820F /* Stream.swift */; };
- BE41196F6A3903E59C3306FE3F8B43FE /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79E32C97D15B18BFEB591B4A8B5C8477 /* Notifications.swift */; };
- C0DB70AB368765DC64BFB5FEA75E0696 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB714D2EF499EE0EF3E1957151533A5D /* ParameterEncoding.swift */; };
- C546890220177F840E8AFC829D0E3FEB /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; };
- C7B6DD7C0456C50289A2C381DFE9FA3F /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B09F376C277F027BDCD54137D76C547 /* MultipartFormData.swift */; };
- C8592AD030234E841A61CA09ED02059A /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; };
- CA8020EE393C1F6085F284A7CAE3B9E3 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */; };
- D228AFA3B6BFAE551ADA6A57A57F8DF9 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */; };
- DAF614ED4A24537ACAF1F517EF31668E /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */; };
- EFE92E8D3813DD26E78E93EEAF6D7E7E /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E2A29BA50E80B66E36C94B60FAD8863 /* Request.swift */; };
- F206C370F63155D3468E0C188498C5DC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 319E90B185211EB0F7DB65C268512703 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 757F9BBABE83623770250F65EAEE4FD6;
- remoteInfo = PetstoreClient;
- };
- 815A2A76D6EC0B2933867EA1BA7E51D8 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 79C040AFDDCE1BCBF6D8B5EB0B85887F;
- remoteInfo = Alamofire;
- };
- 9587C29FFB2EF204C279D7FF29DA45C2 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 79C040AFDDCE1BCBF6D8B5EB0B85887F;
- remoteInfo = Alamofire;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
- 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; };
- 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; };
- 09DC3EB7B14F56C5823591E484CC06DC /* Upload.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Upload.swift; path = Source/Upload.swift; sourceTree = ""; };
- 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; };
- 0DBA7F3642776C1964512C9A38829081 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; };
- 101C763FD5409006D69EDB82815E4A61 /* Manager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Manager.swift; path = Source/Manager.swift; sourceTree = ""; };
- 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; };
- 1E2A29BA50E80B66E36C94B60FAD8863 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; };
- 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; };
- 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; };
- 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; };
- 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; };
- 2959D264574F227296E36F7CDF2E4F4F /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; };
- 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; };
- 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; };
- 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
- 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; };
- 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; };
- 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 4E07E98001DB6C163294A39CAB05963D /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; };
- 4E393CF47FE31F265B29AA2D9B67C656 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; };
- 50BCAC7849E43619A0E6BA6D3291D195 /* Download.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Download.swift; path = Source/Download.swift; sourceTree = ""; };
- 5175E677ADC3F810A4FB10B104C4332B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; };
- 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; };
- 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; };
- 5B09F376C277F027BDCD54137D76C547 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; };
- 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; };
- 5C5763A83A1E028B6C4A073221CB764F /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = ""; };
- 658CBED44D4009D80F990A188D7A8B3F /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; };
- 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; };
- 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 6D1F9022AC9979CD59E8F83962DAF51D /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Source/Error.swift; sourceTree = ""; };
- 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 79E32C97D15B18BFEB591B4A8B5C8477 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; };
- 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 7ED443D528393D61A04FBD88603DE5F3 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; };
- 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; };
- 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; };
- 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 8F0266C5AE0B23A436291F6647902086 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; };
- 8FFF564423DBE209836D47626963E9D4 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; };
- 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; };
- 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
- 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; };
- 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; };
- 9FD74E0A1B7122513F9BCD2B66B65219 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; };
- A149BF2819128352A98494A4402603EE /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; };
- AB714D2EF499EE0EF3E1957151533A5D /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; };
- AE6827D6CBD3F8B59B79641ABF6ED159 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; };
- B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; };
- BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; };
- D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; };
- D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; };
- D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; };
- D8072E1108951F272C003553FC8926C7 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; };
- DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; };
- DDC2C7A48545D8C54D52554343225FB8 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; };
- DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; };
- E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; };
- E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PetstoreClient.modulemap; sourceTree = ""; };
- E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; };
- EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; };
- F9039D48B1E893EF8AD87645A4FF820F /* Stream.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Stream.swift; path = Source/Stream.swift; sourceTree = ""; };
- F9278DA00F41E390EE68B6F3C8161C54 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; };
- FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 2A7053C6AF6D6D7610A715632949C369 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3CA0C61EB5AA01268C12B7E61FF59C56 /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B1729F851F648EC60EE93CDB3C8BAEAD /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 91C09AC2A52ED69A27C8D923139A006F /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9AF472C2BBE112ACE182D6EA2B243E6 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 40AED0FDEFFB776F649058C34D72BB95 /* Alamofire.framework in Frameworks */,
- 37D0F7B54F7677AEB499F204040C6DA1 /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- FE8FC779CF4B0CFCC594E81C0FF86C7E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F206C370F63155D3468E0C188498C5DC /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 1322FED69118C64DAD026CAF7F4C38C6 /* Models */ = {
- isa = PBXGroup;
- children = (
- D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */,
- 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */,
- 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */,
- 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */,
- 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */,
- );
- path = Models;
- sourceTree = "";
- };
- 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = {
- isa = PBXGroup;
- children = (
- E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */,
- );
- name = "Development Pods";
- sourceTree = "";
- };
- 3332D79FDC0D66D4DF418974F676C0C0 /* iOS */ = {
- isa = PBXGroup;
- children = (
- 41EA265E42E2F53F87DD98BDA6BDEFD5 /* Foundation.framework */,
- );
- name = iOS;
- sourceTree = "";
- };
- 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = {
- isa = PBXGroup;
- children = (
- 6E519FC8760483F5D136181B2EBCBDEB /* Alamofire */,
- );
- name = Pods;
- sourceTree = "";
- };
- 59B91F212518421F271EBA85D5530651 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */,
- 3332D79FDC0D66D4DF418974F676C0C0 /* iOS */,
- );
- name = Frameworks;
- sourceTree = "";
- };
- 68F6D4CBC8B6CDE1D634D9F379F37168 /* Support Files */ = {
- isa = PBXGroup;
- children = (
- 5C5763A83A1E028B6C4A073221CB764F /* Alamofire.modulemap */,
- A149BF2819128352A98494A4402603EE /* Alamofire.xcconfig */,
- 9FD74E0A1B7122513F9BCD2B66B65219 /* Alamofire-dummy.m */,
- 8FFF564423DBE209836D47626963E9D4 /* Alamofire-prefix.pch */,
- AE6827D6CBD3F8B59B79641ABF6ED159 /* Alamofire-umbrella.h */,
- 5175E677ADC3F810A4FB10B104C4332B /* Info.plist */,
- );
- name = "Support Files";
- path = "../Target Support Files/Alamofire";
- sourceTree = "";
- };
- 6E519FC8760483F5D136181B2EBCBDEB /* Alamofire */ = {
- isa = PBXGroup;
- children = (
- 7ED443D528393D61A04FBD88603DE5F3 /* Alamofire.swift */,
- 50BCAC7849E43619A0E6BA6D3291D195 /* Download.swift */,
- 6D1F9022AC9979CD59E8F83962DAF51D /* Error.swift */,
- 101C763FD5409006D69EDB82815E4A61 /* Manager.swift */,
- 5B09F376C277F027BDCD54137D76C547 /* MultipartFormData.swift */,
- F9278DA00F41E390EE68B6F3C8161C54 /* NetworkReachabilityManager.swift */,
- 79E32C97D15B18BFEB591B4A8B5C8477 /* Notifications.swift */,
- AB714D2EF499EE0EF3E1957151533A5D /* ParameterEncoding.swift */,
- 1E2A29BA50E80B66E36C94B60FAD8863 /* Request.swift */,
- DDC2C7A48545D8C54D52554343225FB8 /* Response.swift */,
- 2959D264574F227296E36F7CDF2E4F4F /* ResponseSerialization.swift */,
- 4E393CF47FE31F265B29AA2D9B67C656 /* Result.swift */,
- 4E07E98001DB6C163294A39CAB05963D /* ServerTrustPolicy.swift */,
- F9039D48B1E893EF8AD87645A4FF820F /* Stream.swift */,
- 0DBA7F3642776C1964512C9A38829081 /* Timeline.swift */,
- 09DC3EB7B14F56C5823591E484CC06DC /* Upload.swift */,
- 658CBED44D4009D80F990A188D7A8B3F /* Validation.swift */,
- 68F6D4CBC8B6CDE1D634D9F379F37168 /* Support Files */,
- );
- path = Alamofire;
- sourceTree = "";
- };
- 7DB346D0F39D3F0E887471402A8071AB = {
- isa = PBXGroup;
- children = (
- 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */,
- 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */,
- 59B91F212518421F271EBA85D5530651 /* Frameworks */,
- 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */,
- 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */,
- C1A60D10CED0E61146591438999C7502 /* Targets Support Files */,
- );
- sourceTree = "";
- };
- 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */ = {
- isa = PBXGroup;
- children = (
- 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */,
- DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */,
- 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */,
- E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */,
- 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */,
- BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */,
- D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */,
- 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */,
- 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */,
- 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */,
- );
- name = "Pods-SwaggerClient";
- path = "Target Support Files/Pods-SwaggerClient";
- sourceTree = "";
- };
- 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = {
- isa = PBXGroup;
- children = (
- F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */,
- E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */,
- DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */,
- 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */,
- B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */,
- 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */,
- );
- name = "Support Files";
- path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient";
- sourceTree = "";
- };
- 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */ = {
- isa = PBXGroup;
- children = (
- 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */,
- 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */,
- 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */,
- EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */,
- );
- name = Products;
- sourceTree = "";
- };
- AD94092456F8ABCB18F74CAC75AD85DE /* Classes */ = {
- isa = PBXGroup;
- children = (
- F64549CFCC17C7AC6479508BE180B18D /* Swaggers */,
- );
- path = Classes;
- sourceTree = "";
- };
- C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = {
- isa = PBXGroup;
- children = (
- 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */,
- D6D0CD30E3EAF2ED10AE0CBC07506C5A /* Pods-SwaggerClientTests */,
- );
- name = "Targets Support Files";
- sourceTree = "";
- };
- D6D0CD30E3EAF2ED10AE0CBC07506C5A /* Pods-SwaggerClientTests */ = {
- isa = PBXGroup;
- children = (
- 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */,
- 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */,
- FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */,
- 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */,
- 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */,
- 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */,
- E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */,
- F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */,
- 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */,
- 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */,
- );
- name = "Pods-SwaggerClientTests";
- path = "Target Support Files/Pods-SwaggerClientTests";
- sourceTree = "";
- };
- E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = {
- isa = PBXGroup;
- children = (
- AD94092456F8ABCB18F74CAC75AD85DE /* Classes */,
- );
- path = PetstoreClient;
- sourceTree = "";
- };
- E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */ = {
- isa = PBXGroup;
- children = (
- E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */,
- 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */,
- );
- name = PetstoreClient;
- path = ../..;
- sourceTree = "";
- };
- F64549CFCC17C7AC6479508BE180B18D /* Swaggers */ = {
- isa = PBXGroup;
- children = (
- 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */,
- D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */,
- D8072E1108951F272C003553FC8926C7 /* APIs.swift */,
- 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */,
- 8F0266C5AE0B23A436291F6647902086 /* Models.swift */,
- F92EFB558CBA923AB1CFA22F708E315A /* APIs */,
- 1322FED69118C64DAD026CAF7F4C38C6 /* Models */,
- );
- path = Swaggers;
- sourceTree = "";
- };
- F92EFB558CBA923AB1CFA22F708E315A /* APIs */ = {
- isa = PBXGroup;
- children = (
- 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */,
- 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */,
- 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */,
- );
- path = APIs;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- 6C794A7763C2F85750D66CDD002E271F /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- A871DC508D9A11F280135D7B56266E97 /* PetstoreClient-umbrella.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 8EB9FB8BCBCBC01234ED5877A870758B /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 816BE1BBC1F4E434D7BD3F793F38B347 /* Pods-SwaggerClient-umbrella.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- EFDF3B631BBB965A372347705CA14854 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9469DF81ECB494E84675969B5E13374C /* Alamofire-umbrella.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- FF84DA06E91FBBAA756A7832375803CE /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 897283A0B7F5299913327CC8FD6CC997 /* Pods-SwaggerClientTests-umbrella.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- 01C67FBB627BDC9D36B9F648C0BF5228 /* Pods-SwaggerClient */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = A255A180370C09C28653A0EC123D2678 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */;
- buildPhases = (
- C2AD20E62D6A15C7CE3E20F8A811548F /* Sources */,
- 2A7053C6AF6D6D7610A715632949C369 /* Frameworks */,
- 8EB9FB8BCBCBC01234ED5877A870758B /* Headers */,
- );
- buildRules = (
- );
- dependencies = (
- 9D7C00D5DABDA9EE2ED06BE7F85DD5EA /* PBXTargetDependency */,
- A51999658423B0F25DD2B4FEECD542E3 /* PBXTargetDependency */,
- );
- name = "Pods-SwaggerClient";
- productName = "Pods-SwaggerClient";
- productReference = 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */;
- productType = "com.apple.product-type.framework";
- };
- 462B200BD111D7F438E47B7C42B6772F /* Pods-SwaggerClientTests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 245A935A321D16F418F4D34C5D17D2B6 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */;
- buildPhases = (
- 0529825EC79AED06C77091DC0F061854 /* Sources */,
- FE8FC779CF4B0CFCC594E81C0FF86C7E /* Frameworks */,
- FF84DA06E91FBBAA756A7832375803CE /* Headers */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "Pods-SwaggerClientTests";
- productName = "Pods-SwaggerClientTests";
- productReference = EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */;
- productType = "com.apple.product-type.framework";
- };
- 757F9BBABE83623770250F65EAEE4FD6 /* PetstoreClient */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 75D763A79F74FE2B1D1C066F125F118E /* Build configuration list for PBXNativeTarget "PetstoreClient" */;
- buildPhases = (
- 34DFD8BA276C55B95699DFE7BF816A04 /* Sources */,
- F9AF472C2BBE112ACE182D6EA2B243E6 /* Frameworks */,
- 6C794A7763C2F85750D66CDD002E271F /* Headers */,
- );
- buildRules = (
- );
- dependencies = (
- A2B064722D89556FD34AF0A4A3EC3847 /* PBXTargetDependency */,
- );
- name = PetstoreClient;
- productName = PetstoreClient;
- productReference = 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */;
- productType = "com.apple.product-type.framework";
- };
- 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3CFB42910790CF0BDBCCEBAACD6B9367 /* Build configuration list for PBXNativeTarget "Alamofire" */;
- buildPhases = (
- 95CC2C7E06DC188A05DAAEE9CAA555A3 /* Sources */,
- B1729F851F648EC60EE93CDB3C8BAEAD /* Frameworks */,
- EFDF3B631BBB965A372347705CA14854 /* Headers */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Alamofire;
- productName = Alamofire;
- productReference = 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */;
- productType = "com.apple.product-type.framework";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- D41D8CD98F00B204E9800998ECF8427E /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastSwiftUpdateCheck = 0730;
- LastUpgradeCheck = 0700;
- };
- buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 7DB346D0F39D3F0E887471402A8071AB;
- productRefGroup = 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */,
- 757F9BBABE83623770250F65EAEE4FD6 /* PetstoreClient */,
- 01C67FBB627BDC9D36B9F648C0BF5228 /* Pods-SwaggerClient */,
- 462B200BD111D7F438E47B7C42B6772F /* Pods-SwaggerClientTests */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 0529825EC79AED06C77091DC0F061854 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- C546890220177F840E8AFC829D0E3FEB /* Pods-SwaggerClientTests-dummy.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 34DFD8BA276C55B95699DFE7BF816A04 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 388FE86EB5084CB37EC19ED82DE8242C /* AlamofireImplementations.swift in Sources */,
- 7D0C7E08FEC92B9C59B3EAFB8D15026D /* APIHelper.swift in Sources */,
- 59C731A013A3F62794AABFB1C1025B4F /* APIs.swift in Sources */,
- 121BA006C3D23D9290D868AA19E4BFBA /* Category.swift in Sources */,
- D228AFA3B6BFAE551ADA6A57A57F8DF9 /* Extensions.swift in Sources */,
- 1ED3811BA132299733D3A71543A4339C /* Models.swift in Sources */,
- DAF614ED4A24537ACAF1F517EF31668E /* Order.swift in Sources */,
- CA8020EE393C1F6085F284A7CAE3B9E3 /* Pet.swift in Sources */,
- 909E1A21FF97D3DFD0E2707B0E078686 /* PetAPI.swift in Sources */,
- 45961D28C6B8E4BAB87690F714B8727B /* PetstoreClient-dummy.m in Sources */,
- 562F951C949B9293B74C2E5D86BEF1BC /* StoreAPI.swift in Sources */,
- 39EBC7781F42F6F790D3E54F3E8D8ED1 /* Tag.swift in Sources */,
- 93A9E4EBCD41B6C350DB55CB545D797E /* User.swift in Sources */,
- 2737DA3907C231E7CCCBF6075FCE4AB3 /* UserAPI.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 95CC2C7E06DC188A05DAAEE9CAA555A3 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- ADF19C953CE2A7D0B72EC93A81FCCC26 /* Alamofire-dummy.m in Sources */,
- 8EB11202167FCDDF1257AAAB1D1FB244 /* Alamofire.swift in Sources */,
- 5CB05FBCB32D21E194B5ECF680CB6AE0 /* Download.swift in Sources */,
- 095406039B4D371E48D08B38A2975AC8 /* Error.swift in Sources */,
- 4081EA628AF0B73AC51FFB9D7AB3B89E /* Manager.swift in Sources */,
- C7B6DD7C0456C50289A2C381DFE9FA3F /* MultipartFormData.swift in Sources */,
- 34CCDCA848A701466256BC2927DA8856 /* NetworkReachabilityManager.swift in Sources */,
- BE41196F6A3903E59C3306FE3F8B43FE /* Notifications.swift in Sources */,
- C0DB70AB368765DC64BFB5FEA75E0696 /* ParameterEncoding.swift in Sources */,
- EFE92E8D3813DD26E78E93EEAF6D7E7E /* Request.swift in Sources */,
- 62E8346F03C03E7F4D631361F325689E /* Response.swift in Sources */,
- 3EA8F215C9C1432D74E5CCA4834AA8C0 /* ResponseSerialization.swift in Sources */,
- AA314156AC500125F4078EE968DB14C6 /* Result.swift in Sources */,
- 7B48852C4D848FA2DA416A98F6425869 /* ServerTrustPolicy.swift in Sources */,
- AE4CF87C02C042DF13ED5B21C4FDC1E0 /* Stream.swift in Sources */,
- 16102E4E35FAA0FC4161282FECE56469 /* Timeline.swift in Sources */,
- 5BC19E6E0F199276003F0AF96838BCE5 /* Upload.swift in Sources */,
- 2D3405986FC586FA6C0A5E0B6BA7E64E /* Validation.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- C2AD20E62D6A15C7CE3E20F8A811548F /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- C8592AD030234E841A61CA09ED02059A /* Pods-SwaggerClient-dummy.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 9D7C00D5DABDA9EE2ED06BE7F85DD5EA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = Alamofire;
- target = 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */;
- targetProxy = 9587C29FFB2EF204C279D7FF29DA45C2 /* PBXContainerItemProxy */;
- };
- A2B064722D89556FD34AF0A4A3EC3847 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = Alamofire;
- target = 79C040AFDDCE1BCBF6D8B5EB0B85887F /* Alamofire */;
- targetProxy = 815A2A76D6EC0B2933867EA1BA7E51D8 /* PBXContainerItemProxy */;
- };
- A51999658423B0F25DD2B4FEECD542E3 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = PetstoreClient;
- target = 757F9BBABE83623770250F65EAEE4FD6 /* PetstoreClient */;
- targetProxy = 319E90B185211EB0F7DB65C268512703 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 32AD5F8918CA8B349E4671410FA624C9 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = A149BF2819128352A98494A4402603EE /* Alamofire.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch";
- INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap";
- MTL_ENABLE_DEBUG_INFO = NO;
- PRODUCT_NAME = Alamofire;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Release;
- };
- 51E864C21FD4E8BF48B7DE196DE05017 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = dwarf;
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 9.2;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MACH_O_TYPE = staticlib;
- MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap";
- MTL_ENABLE_DEBUG_INFO = YES;
- OTHER_LDFLAGS = "";
- OTHER_LIBTOOLFLAGS = "";
- PODS_ROOT = "$(SRCROOT)";
- PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
- PRODUCT_NAME = Pods_SwaggerClient;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Debug;
- };
- 75218111E718FACE36F771E8ABECDB62 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = A149BF2819128352A98494A4402603EE /* Alamofire.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = dwarf;
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch";
- INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap";
- MTL_ENABLE_DEBUG_INFO = YES;
- PRODUCT_NAME = Alamofire;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Debug;
- };
- 7C4A68800C97518F39692FF062F013EE /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 9.2;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MACH_O_TYPE = staticlib;
- MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap";
- MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_LDFLAGS = "";
- OTHER_LIBTOOLFLAGS = "";
- PODS_ROOT = "$(SRCROOT)";
- PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
- PRODUCT_NAME = Pods_SwaggerClient;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Release;
- };
- 7EA02FDF9D26C9AD275654E73F406F04 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = dwarf;
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 9.2;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MACH_O_TYPE = staticlib;
- MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap";
- MTL_ENABLE_DEBUG_INFO = YES;
- OTHER_LDFLAGS = "";
- OTHER_LIBTOOLFLAGS = "";
- PODS_ROOT = "$(SRCROOT)";
- PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
- PRODUCT_NAME = Pods_SwaggerClientTests;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Debug;
- };
- 84FD87D359382A37B07149A12641B965 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "POD_CONFIGURATION_DEBUG=1",
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 9.2;
- ONLY_ACTIVE_ARCH = YES;
- STRIP_INSTALLED_PRODUCT = NO;
- SYMROOT = "${SRCROOT}/../build";
- };
- name = Debug;
- };
- 95F68EBF32996F2AC8422FE5C210682D /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch";
- INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap";
- MTL_ENABLE_DEBUG_INFO = NO;
- PRODUCT_NAME = PetstoreClient;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Release;
- };
- B316166B7E92675830371A4D5A9C5B6B /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = dwarf;
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch";
- INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap";
- MTL_ENABLE_DEBUG_INFO = YES;
- PRODUCT_NAME = PetstoreClient;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Debug;
- };
- F594C655D48020EC34B00AA63E001773 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- ENABLE_NS_ASSERTIONS = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "POD_CONFIGURATION_RELEASE=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 9.2;
- STRIP_INSTALLED_PRODUCT = NO;
- SYMROOT = "${SRCROOT}/../build";
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- FCA939A415B281DBA1BE816C25790182 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */;
- buildSettings = {
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_NO_COMMON_BLOCKS = YES;
- INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 9.2;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MACH_O_TYPE = staticlib;
- MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap";
- MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_LDFLAGS = "";
- OTHER_LIBTOOLFLAGS = "";
- PODS_ROOT = "$(SRCROOT)";
- PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
- PRODUCT_NAME = Pods_SwaggerClientTests;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 245A935A321D16F418F4D34C5D17D2B6 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 7EA02FDF9D26C9AD275654E73F406F04 /* Debug */,
- FCA939A415B281DBA1BE816C25790182 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 84FD87D359382A37B07149A12641B965 /* Debug */,
- F594C655D48020EC34B00AA63E001773 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3CFB42910790CF0BDBCCEBAACD6B9367 /* Build configuration list for PBXNativeTarget "Alamofire" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 75218111E718FACE36F771E8ABECDB62 /* Debug */,
- 32AD5F8918CA8B349E4671410FA624C9 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 75D763A79F74FE2B1D1C066F125F118E /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B316166B7E92675830371A4D5A9C5B6B /* Debug */,
- 95F68EBF32996F2AC8422FE5C210682D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- A255A180370C09C28653A0EC123D2678 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 51E864C21FD4E8BF48B7DE196DE05017 /* Debug */,
- 7C4A68800C97518F39692FF062F013EE /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m
deleted file mode 100644
index a6c4594242e9..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m
+++ /dev/null
@@ -1,5 +0,0 @@
-#import
-@interface PodsDummy_Alamofire : NSObject
-@end
-@implementation PodsDummy_Alamofire
-@end
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch
deleted file mode 100644
index aa992a4adb2f..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __OBJC__
-#import
-#endif
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h
deleted file mode 100644
index 6b71676a9bd4..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#import
-
-
-FOUNDATION_EXPORT double AlamofireVersionNumber;
-FOUNDATION_EXPORT const unsigned char AlamofireVersionString[];
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap
deleted file mode 100644
index d1f125fab6b0..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap
+++ /dev/null
@@ -1,6 +0,0 @@
-framework module Alamofire {
- umbrella header "Alamofire-umbrella.h"
-
- export *
- module * { export * }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig
deleted file mode 100644
index 772ef0b2bca3..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig
+++ /dev/null
@@ -1,9 +0,0 @@
-CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Alamofire
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
-OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}
-PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
-SKIP_INSTALL = YES
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist
deleted file mode 100644
index 152c333e4414..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleIdentifier
- ${PRODUCT_BUNDLE_IDENTIFIER}
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- ${PRODUCT_NAME}
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 3.4.2
- CFBundleSignature
- ????
- CFBundleVersion
- ${CURRENT_PROJECT_VERSION}
- NSPrincipalClass
-
-
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist
deleted file mode 100644
index cba258550bd0..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleIdentifier
- ${PRODUCT_BUNDLE_IDENTIFIER}
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- ${PRODUCT_NAME}
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 0.0.1
- CFBundleSignature
- ????
- CFBundleVersion
- ${CURRENT_PROJECT_VERSION}
- NSPrincipalClass
-
-
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m
deleted file mode 100644
index 749b412f85c0..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m
+++ /dev/null
@@ -1,5 +0,0 @@
-#import
-@interface PodsDummy_PetstoreClient : NSObject
-@end
-@implementation PodsDummy_PetstoreClient
-@end
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch
deleted file mode 100644
index aa992a4adb2f..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __OBJC__
-#import
-#endif
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h
deleted file mode 100644
index 75c63f7c53e0..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#import
-
-
-FOUNDATION_EXPORT double PetstoreClientVersionNumber;
-FOUNDATION_EXPORT const unsigned char PetstoreClientVersionString[];
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap
deleted file mode 100644
index 7fdfc46cf796..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap
+++ /dev/null
@@ -1,6 +0,0 @@
-framework module PetstoreClient {
- umbrella header "PetstoreClient-umbrella.h"
-
- export *
- module * { export * }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig
deleted file mode 100644
index 323b0fc6f1de..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/PetstoreClient
-FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire"
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
-OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}
-PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
-SKIP_INSTALL = YES
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist
deleted file mode 100644
index 2243fe6e27dc..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleIdentifier
- ${PRODUCT_BUNDLE_IDENTIFIER}
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- ${PRODUCT_NAME}
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0.0
- CFBundleSignature
- ????
- CFBundleVersion
- ${CURRENT_PROJECT_VERSION}
- NSPrincipalClass
-
-
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown
deleted file mode 100644
index 938fc5f29a83..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown
+++ /dev/null
@@ -1,231 +0,0 @@
-# Acknowledgements
-This application makes use of the following third party libraries:
-
-## Alamofire
-
-Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-
-## PetstoreClient
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-Generated by CocoaPods - https://cocoapods.org
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist
deleted file mode 100644
index 289edb2592c2..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist
+++ /dev/null
@@ -1,265 +0,0 @@
-
-
-
-
- PreferenceSpecifiers
-
-
- FooterText
- This application makes use of the following third party libraries:
- Title
- Acknowledgements
- Type
- PSGroupSpecifier
-
-
- FooterText
- Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
- Title
- Alamofire
- Type
- PSGroupSpecifier
-
-
- FooterText
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Title
- PetstoreClient
- Type
- PSGroupSpecifier
-
-
- FooterText
- Generated by CocoaPods - https://cocoapods.org
- Title
-
- Type
- PSGroupSpecifier
-
-
- StringsTable
- Acknowledgements
- Title
- Acknowledgements
-
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m
deleted file mode 100644
index 6236440163b8..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m
+++ /dev/null
@@ -1,5 +0,0 @@
-#import
-@interface PodsDummy_Pods_SwaggerClient : NSObject
-@end
-@implementation PodsDummy_Pods_SwaggerClient
-@end
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh
deleted file mode 100755
index d3d3acc30255..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-set -e
-
-echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
-mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
-
-SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
-
-install_framework()
-{
- if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
- local source="${BUILT_PRODUCTS_DIR}/$1"
- elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
- local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
- elif [ -r "$1" ]; then
- local source="$1"
- fi
-
- local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
-
- if [ -L "${source}" ]; then
- echo "Symlinked..."
- source="$(readlink "${source}")"
- fi
-
- # use filter instead of exclude so missing patterns dont' throw errors
- echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
- rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
-
- local basename
- basename="$(basename -s .framework "$1")"
- binary="${destination}/${basename}.framework/${basename}"
- if ! [ -r "$binary" ]; then
- binary="${destination}/${basename}"
- fi
-
- # Strip invalid architectures so "fat" simulator / device frameworks work on device
- if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
- strip_invalid_archs "$binary"
- fi
-
- # Resign the code if required by the build settings to avoid unstable apps
- code_sign_if_enabled "${destination}/$(basename "$1")"
-
- # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
- if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
- local swift_runtime_libs
- swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
- for lib in $swift_runtime_libs; do
- echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
- rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
- code_sign_if_enabled "${destination}/${lib}"
- done
- fi
-}
-
-# Signs a framework with the provided identity
-code_sign_if_enabled() {
- if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
- # Use the current code_sign_identitiy
- echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
- echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
- /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
- fi
-}
-
-# Strip invalid architectures
-strip_invalid_archs() {
- binary="$1"
- # Get architectures for current file
- archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
- stripped=""
- for arch in $archs; do
- if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
- # Strip non-valid architectures in-place
- lipo -remove "$arch" -output "$binary" "$binary" || exit 1
- stripped="$stripped $arch"
- fi
- done
- if [[ "$stripped" ]]; then
- echo "Stripped $binary of architectures:$stripped"
- fi
-}
-
-
-if [[ "$CONFIGURATION" == "Debug" ]]; then
- install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework"
- install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework"
-fi
-if [[ "$CONFIGURATION" == "Release" ]]; then
- install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework"
- install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework"
-fi
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh
deleted file mode 100755
index e768f92993ec..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/sh
-set -e
-
-mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-
-RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
-> "$RESOURCES_TO_COPY"
-
-XCASSET_FILES=()
-
-case "${TARGETED_DEVICE_FAMILY}" in
- 1,2)
- TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
- ;;
- 1)
- TARGET_DEVICE_ARGS="--target-device iphone"
- ;;
- 2)
- TARGET_DEVICE_ARGS="--target-device ipad"
- ;;
- *)
- TARGET_DEVICE_ARGS="--target-device mac"
- ;;
-esac
-
-realpath() {
- DIRECTORY="$(cd "${1%/*}" && pwd)"
- FILENAME="${1##*/}"
- echo "$DIRECTORY/$FILENAME"
-}
-
-install_resource()
-{
- if [[ "$1" = /* ]] ; then
- RESOURCE_PATH="$1"
- else
- RESOURCE_PATH="${PODS_ROOT}/$1"
- fi
- if [[ ! -e "$RESOURCE_PATH" ]] ; then
- cat << EOM
-error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
-EOM
- exit 1
- fi
- case $RESOURCE_PATH in
- *.storyboard)
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
- ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
- ;;
- *.xib)
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
- ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
- ;;
- *.framework)
- echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- ;;
- *.xcdatamodel)
- echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
- xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
- ;;
- *.xcdatamodeld)
- echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
- xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
- ;;
- *.xcmappingmodel)
- echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
- xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
- ;;
- *.xcassets)
- ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
- XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
- ;;
- *)
- echo "$RESOURCE_PATH"
- echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
- ;;
- esac
-}
-
-mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
- mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
- rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-fi
-rm -f "$RESOURCES_TO_COPY"
-
-if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
-then
- # Find all other xcassets (this unfortunately includes those of path pods and other targets).
- OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
- while read line; do
- if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
- XCASSET_FILES+=("$line")
- fi
- done <<<"$OTHER_XCASSETS"
-
- printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-fi
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h
deleted file mode 100644
index b68fbb9611fa..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#import
-
-
-FOUNDATION_EXPORT double Pods_SwaggerClientVersionNumber;
-FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientVersionString[];
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig
deleted file mode 100644
index 405ae0ee99e6..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
-FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient"
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
-OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers"
-OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient"
-OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}/Pods
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap
deleted file mode 100644
index ef919b6c0d1f..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap
+++ /dev/null
@@ -1,6 +0,0 @@
-framework module Pods_SwaggerClient {
- umbrella header "Pods-SwaggerClient-umbrella.h"
-
- export *
- module * { export * }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig
deleted file mode 100644
index 405ae0ee99e6..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
-FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient"
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
-OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers"
-OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient"
-OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}/Pods
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist
deleted file mode 100644
index 2243fe6e27dc..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleIdentifier
- ${PRODUCT_BUNDLE_IDENTIFIER}
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- ${PRODUCT_NAME}
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0.0
- CFBundleSignature
- ????
- CFBundleVersion
- ${CURRENT_PROJECT_VERSION}
- NSPrincipalClass
-
-
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown
deleted file mode 100644
index 102af7538517..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown
+++ /dev/null
@@ -1,3 +0,0 @@
-# Acknowledgements
-This application makes use of the following third party libraries:
-Generated by CocoaPods - https://cocoapods.org
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist
deleted file mode 100644
index 7acbad1eabbf..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
- PreferenceSpecifiers
-
-
- FooterText
- This application makes use of the following third party libraries:
- Title
- Acknowledgements
- Type
- PSGroupSpecifier
-
-
- FooterText
- Generated by CocoaPods - https://cocoapods.org
- Title
-
- Type
- PSGroupSpecifier
-
-
- StringsTable
- Acknowledgements
- Title
- Acknowledgements
-
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m
deleted file mode 100644
index bb17fa2b80ff..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m
+++ /dev/null
@@ -1,5 +0,0 @@
-#import
-@interface PodsDummy_Pods_SwaggerClientTests : NSObject
-@end
-@implementation PodsDummy_Pods_SwaggerClientTests
-@end
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh
deleted file mode 100755
index 893c16a6313f..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-set -e
-
-echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
-mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
-
-SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
-
-install_framework()
-{
- if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
- local source="${BUILT_PRODUCTS_DIR}/$1"
- elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
- local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
- elif [ -r "$1" ]; then
- local source="$1"
- fi
-
- local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
-
- if [ -L "${source}" ]; then
- echo "Symlinked..."
- source="$(readlink "${source}")"
- fi
-
- # use filter instead of exclude so missing patterns dont' throw errors
- echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
- rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
-
- local basename
- basename="$(basename -s .framework "$1")"
- binary="${destination}/${basename}.framework/${basename}"
- if ! [ -r "$binary" ]; then
- binary="${destination}/${basename}"
- fi
-
- # Strip invalid architectures so "fat" simulator / device frameworks work on device
- if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
- strip_invalid_archs "$binary"
- fi
-
- # Resign the code if required by the build settings to avoid unstable apps
- code_sign_if_enabled "${destination}/$(basename "$1")"
-
- # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
- if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
- local swift_runtime_libs
- swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
- for lib in $swift_runtime_libs; do
- echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
- rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
- code_sign_if_enabled "${destination}/${lib}"
- done
- fi
-}
-
-# Signs a framework with the provided identity
-code_sign_if_enabled() {
- if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
- # Use the current code_sign_identitiy
- echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
- echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
- /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
- fi
-}
-
-# Strip invalid architectures
-strip_invalid_archs() {
- binary="$1"
- # Get architectures for current file
- archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
- stripped=""
- for arch in $archs; do
- if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
- # Strip non-valid architectures in-place
- lipo -remove "$arch" -output "$binary" "$binary" || exit 1
- stripped="$stripped $arch"
- fi
- done
- if [[ "$stripped" ]]; then
- echo "Stripped $binary of architectures:$stripped"
- fi
-}
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh
deleted file mode 100755
index e768f92993ec..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/sh
-set -e
-
-mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-
-RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
-> "$RESOURCES_TO_COPY"
-
-XCASSET_FILES=()
-
-case "${TARGETED_DEVICE_FAMILY}" in
- 1,2)
- TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
- ;;
- 1)
- TARGET_DEVICE_ARGS="--target-device iphone"
- ;;
- 2)
- TARGET_DEVICE_ARGS="--target-device ipad"
- ;;
- *)
- TARGET_DEVICE_ARGS="--target-device mac"
- ;;
-esac
-
-realpath() {
- DIRECTORY="$(cd "${1%/*}" && pwd)"
- FILENAME="${1##*/}"
- echo "$DIRECTORY/$FILENAME"
-}
-
-install_resource()
-{
- if [[ "$1" = /* ]] ; then
- RESOURCE_PATH="$1"
- else
- RESOURCE_PATH="${PODS_ROOT}/$1"
- fi
- if [[ ! -e "$RESOURCE_PATH" ]] ; then
- cat << EOM
-error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
-EOM
- exit 1
- fi
- case $RESOURCE_PATH in
- *.storyboard)
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
- ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
- ;;
- *.xib)
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
- ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
- ;;
- *.framework)
- echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
- ;;
- *.xcdatamodel)
- echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
- xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
- ;;
- *.xcdatamodeld)
- echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
- xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
- ;;
- *.xcmappingmodel)
- echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
- xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
- ;;
- *.xcassets)
- ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
- XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
- ;;
- *)
- echo "$RESOURCE_PATH"
- echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
- ;;
- esac
-}
-
-mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
- mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
- rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-fi
-rm -f "$RESOURCES_TO_COPY"
-
-if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
-then
- # Find all other xcassets (this unfortunately includes those of path pods and other targets).
- OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
- while read line; do
- if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
- XCASSET_FILES+=("$line")
- fi
- done <<<"$OTHER_XCASSETS"
-
- printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
-fi
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h
deleted file mode 100644
index fb4cae0c0fdc..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#import
-
-
-FOUNDATION_EXPORT double Pods_SwaggerClientTestsVersionNumber;
-FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientTestsVersionString[];
-
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig
deleted file mode 100644
index 4078df842f87..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig
+++ /dev/null
@@ -1,7 +0,0 @@
-FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient"
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
-OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}/Pods
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap
deleted file mode 100644
index a848da7ffb30..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap
+++ /dev/null
@@ -1,6 +0,0 @@
-framework module Pods_SwaggerClientTests {
- umbrella header "Pods-SwaggerClientTests-umbrella.h"
-
- export *
- module * { export * }
-}
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig
deleted file mode 100644
index 4078df842f87..000000000000
--- a/samples/client/petstore/swift/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig
+++ /dev/null
@@ -1,7 +0,0 @@
-FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient"
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
-OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}/Pods
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
index 7cbaf74825f6..2d5a2ca7d4c6 100644
--- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
+++ b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj
@@ -143,7 +143,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */;
buildPhases = (
- A16DAFA9EF474E5065B5B1C2 /* 📦 Check Pods Manifest.lock */,
+ A16DAFA9EF474E5065B5B1C2 /* [CP] Check Pods Manifest.lock */,
CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */,
1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */,
6D4EFB8D1C692C6300B96B06 /* Sources */,
@@ -167,7 +167,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */;
buildPhases = (
- FE27E864CEDDA2D12F7972B1 /* 📦 Check Pods Manifest.lock */,
+ FE27E864CEDDA2D12F7972B1 /* [CP] Check Pods Manifest.lock */,
B4DB169E5F018305D6759D34 /* [CP] Check Pods Manifest.lock */,
79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */,
6D4EFBA11C692C6300B96B06 /* Sources */,
@@ -367,19 +367,19 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- A16DAFA9EF474E5065B5B1C2 /* 📦 Check Pods Manifest.lock */ = {
+ A16DAFA9EF474E5065B5B1C2 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Check Pods Manifest.lock";
+ name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
B4DB169E5F018305D6759D34 /* [CP] Check Pods Manifest.lock */ = {
@@ -442,19 +442,19 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- FE27E864CEDDA2D12F7972B1 /* 📦 Check Pods Manifest.lock */ = {
+ FE27E864CEDDA2D12F7972B1 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Check Pods Manifest.lock";
+ name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml b/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml
index 9eefe4a7a371..741fd2170882 100644
--- a/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml
+++ b/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml
@@ -26,19 +26,6 @@
exec-maven-plugin
1.2.1
-
- install-pods
- pre-integration-test
-
- exec
-
-
- pod
-
- install
-
-
-
xcodebuild-test
integration-test
@@ -46,16 +33,7 @@
exec
- xcodebuild
-
- -workspace
- SwaggerClient.xcworkspace
- -scheme
- SwaggerClient
- test
- -destination
- platform=iOS Simulator,name=iPhone 6,OS=9.3
-
+ ./run_xcodebuild.sh
diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh
new file mode 100755
index 000000000000..edcc142971b7
--- /dev/null
+++ b/samples/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+#pod install && xcodebuild clean test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty
+
+pod install && xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty
diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift/promisekit/PetstoreClient.podspec
index d4bd9c77e6fa..b832ebd8ca8e 100644
--- a/samples/client/petstore/swift/promisekit/PetstoreClient.podspec
+++ b/samples/client/petstore/swift/promisekit/PetstoreClient.podspec
@@ -9,6 +9,6 @@ Pod::Spec.new do |s|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
- s.dependency 'PromiseKit', '~> 3.1.1'
- s.dependency 'Alamofire', '~> 3.4.1'
+ s.dependency 'PromiseKit', '~> 3.5.3'
+ s.dependency 'Alamofire', '~> 3.5.1'
end
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md
deleted file mode 100644
index cce2041d9d98..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md
+++ /dev/null
@@ -1,1297 +0,0 @@
-
-
-[](https://travis-ci.org/Alamofire/Alamofire)
-[](https://img.shields.io/cocoapods/v/Alamofire.svg)
-[](https://github.com/Carthage/Carthage)
-[](http://cocoadocs.org/docsets/Alamofire)
-[](http://twitter.com/AlamofireSF)
-
-Alamofire is an HTTP networking library written in Swift.
-
-## Features
-
-- [x] Chainable Request / Response methods
-- [x] URL / JSON / plist Parameter Encoding
-- [x] Upload File / Data / Stream / MultipartFormData
-- [x] Download using Request or Resume data
-- [x] Authentication with NSURLCredential
-- [x] HTTP Response Validation
-- [x] TLS Certificate and Public Key Pinning
-- [x] Progress Closure & NSProgress
-- [x] cURL Debug Output
-- [x] Comprehensive Unit Test Coverage
-- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire)
-
-## Component Libraries
-
-In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem.
-
-* [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system.
-* [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `NSURLSession` instances not managed by Alamofire.
-
-## Requirements
-
-- iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+
-- Xcode 7.3+
-
-## Migration Guides
-
-- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md)
-- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md)
-
-## Communication
-
-- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire')
-- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire).
-- If you **found a bug**, open an issue.
-- If you **have a feature request**, open an issue.
-- If you **want to contribute**, submit a pull request.
-
-## Installation
-
-> **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).**
->
-> Alamofire is no longer supported on iOS 7 due to the lack of support for frameworks. Without frameworks, running Travis-CI against iOS 7 would require a second duplicated test target. The separate test suite would need to import all the Swift files and the tests would need to be duplicated and re-written. This split would be too difficult to maintain to ensure the highest possible quality of the Alamofire ecosystem.
-
-### CocoaPods
-
-[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
-
-```bash
-$ gem install cocoapods
-```
-
-> CocoaPods 0.39.0+ is required to build Alamofire 3.0.0+.
-
-To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`:
-
-```ruby
-source 'https://github.com/CocoaPods/Specs.git'
-platform :ios, '9.0'
-use_frameworks!
-
-target '' do
- pod 'Alamofire', '~> 3.4'
-end
-```
-
-Then, run the following command:
-
-```bash
-$ pod install
-```
-
-### Carthage
-
-[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
-
-You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
-
-```bash
-$ brew update
-$ brew install carthage
-```
-
-To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`:
-
-```ogdl
-github "Alamofire/Alamofire" ~> 3.4
-```
-
-Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project.
-
-### Manually
-
-If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually.
-
-#### Embedded Framework
-
-- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
-
-```bash
-$ git init
-```
-
-- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command:
-
-```bash
-$ git submodule add https://github.com/Alamofire/Alamofire.git
-```
-
-- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project.
-
- > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.
-
-- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target.
-- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
-- In the tab bar at the top of that window, open the "General" panel.
-- Click on the `+` button under the "Embedded Binaries" section.
-- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder.
-
- > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`.
-
-- Select the top `Alamofire.framework` for iOS and the bottom one for OS X.
-
- > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS` or `Alamofire OSX`.
-
-- And that's it!
-
-> The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.
-
----
-
-## Usage
-
-### Making a Request
-
-```swift
-import Alamofire
-
-Alamofire.request(.GET, "https://httpbin.org/get")
-```
-
-### Response Handling
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .responseJSON { response in
- print(response.request) // original URL request
- print(response.response) // URL response
- print(response.data) // server data
- print(response.result) // result of response serialization
-
- if let JSON = response.result.value {
- print("JSON: \(JSON)")
- }
- }
-```
-
-> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way.
-
-> Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) is specified to handle the response once it's received. The result of a request is only available inside the scope of a response handler. Any execution contingent on the response or data received from the server must be done within a handler.
-
-### Validation
-
-By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type.
-
-#### Manual Validation
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate(statusCode: 200..<300)
- .validate(contentType: ["application/json"])
- .response { response in
- print(response)
- }
-```
-
-#### Automatic Validation
-
-Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided.
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .responseJSON { response in
- switch response.result {
- case .Success:
- print("Validation Successful")
- case .Failure(let error):
- print(error)
- }
- }
-```
-
-### Response Serialization
-
-**Built-in Response Methods**
-
-- `response()`
-- `responseData()`
-- `responseString(encoding: NSStringEncoding)`
-- `responseJSON(options: NSJSONReadingOptions)`
-- `responsePropertyList(options: NSPropertyListReadOptions)`
-
-#### Response Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .response { request, response, data, error in
- print(request)
- print(response)
- print(data)
- print(error)
- }
-```
-
-> The `response` serializer does NOT evaluate any of the response data. It merely forwards on all the information directly from the URL session delegate. We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types.
-
-#### Response Data Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .responseData { response in
- print(response.request)
- print(response.response)
- print(response.result)
- }
-```
-
-#### Response String Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
- .validate()
- .responseString { response in
- print("Success: \(response.result.isSuccess)")
- print("Response String: \(response.result.value)")
- }
-```
-
-#### Response JSON Handler
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
- .validate()
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-#### Chained Response Handlers
-
-Response handlers can even be chained:
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
- .validate()
- .responseString { response in
- print("Response String: \(response.result.value)")
- }
- .responseJSON { response in
- print("Response JSON: \(response.result.value)")
- }
-```
-
-### HTTP Methods
-
-`Alamofire.Method` lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3):
-
-```swift
-public enum Method: String {
- case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT
-}
-```
-
-These values can be passed as the first argument of the `Alamofire.request` method:
-
-```swift
-Alamofire.request(.POST, "https://httpbin.org/post")
-
-Alamofire.request(.PUT, "https://httpbin.org/put")
-
-Alamofire.request(.DELETE, "https://httpbin.org/delete")
-```
-
-### Parameters
-
-#### GET Request With URL-Encoded Parameters
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
-// https://httpbin.org/get?foo=bar
-```
-
-#### POST Request With URL-Encoded Parameters
-
-```swift
-let parameters = [
- "foo": "bar",
- "baz": ["a", 1],
- "qux": [
- "x": 1,
- "y": 2,
- "z": 3
- ]
-]
-
-Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters)
-// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3
-```
-
-### Parameter Encoding
-
-Parameters can also be encoded as JSON, Property List, or any custom format, using the `ParameterEncoding` enum:
-
-```swift
-enum ParameterEncoding {
- case URL
- case URLEncodedInURL
- case JSON
- case PropertyList(format: NSPropertyListFormat, options: NSPropertyListWriteOptions)
- case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?))
-
- func encode(request: NSURLRequest, parameters: [String: AnyObject]?) -> (NSURLRequest, NSError?)
- { ... }
-}
-```
-
-- `URL`: A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. _Since there is no published specification for how to encode collection types, Alamofire follows the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`)._
-- `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same implementation as the `.URL` case, but always applies the encoded result to the URL.
-- `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`.
-- `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`.
-- `Custom`: Uses the associated closure value to construct a new request given an existing request and parameters.
-
-#### Manual Parameter Encoding of an NSURLRequest
-
-```swift
-let URL = NSURL(string: "https://httpbin.org/get")!
-var request = NSMutableURLRequest(URL: URL)
-
-let parameters = ["foo": "bar"]
-let encoding = Alamofire.ParameterEncoding.URL
-(request, _) = encoding.encode(request, parameters: parameters)
-```
-
-#### POST Request with JSON-encoded Parameters
-
-```swift
-let parameters = [
- "foo": [1,2,3],
- "bar": [
- "baz": "qux"
- ]
-]
-
-Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON)
-// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}}
-```
-
-### HTTP Headers
-
-Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing.
-
-> For HTTP headers that do not change, it is recommended to set them on the `NSURLSessionConfiguration` so they are automatically applied to any `NSURLSessionTask` created by the underlying `NSURLSession`.
-
-```swift
-let headers = [
- "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
- "Accept": "application/json"
-]
-
-Alamofire.request(.GET, "https://httpbin.org/get", headers: headers)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-### Caching
-
-Caching is handled on the system framework level by [`NSURLCache`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache).
-
-### Uploading
-
-**Supported Upload Types**
-
-- File
-- Data
-- Stream
-- MultipartFormData
-
-#### Uploading a File
-
-```swift
-let fileURL = NSBundle.mainBundle().URLForResource("Default", withExtension: "png")
-Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL)
-```
-
-#### Uploading with Progress
-
-```swift
-Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL)
- .progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in
- print(totalBytesWritten)
-
- // This closure is NOT called on the main queue for performance
- // reasons. To update your ui, dispatch to the main queue.
- dispatch_async(dispatch_get_main_queue()) {
- print("Total bytes written on main queue: \(totalBytesWritten)")
- }
- }
- .validate()
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-#### Uploading MultipartFormData
-
-```swift
-Alamofire.upload(
- .POST,
- "https://httpbin.org/post",
- multipartFormData: { multipartFormData in
- multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn")
- multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow")
- },
- encodingCompletion: { encodingResult in
- switch encodingResult {
- case .Success(let upload, _, _):
- upload.responseJSON { response in
- debugPrint(response)
- }
- case .Failure(let encodingError):
- print(encodingError)
- }
- }
-)
-```
-
-### Downloading
-
-**Supported Download Types**
-
-- Request
-- Resume Data
-
-#### Downloading a File
-
-```swift
-Alamofire.download(.GET, "https://httpbin.org/stream/100") { temporaryURL, response in
- let fileManager = NSFileManager.defaultManager()
- let directoryURL = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]
- let pathComponent = response.suggestedFilename
-
- return directoryURL.URLByAppendingPathComponent(pathComponent!)
-}
-```
-
-#### Using the Default Download Destination
-
-```swift
-let destination = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask)
-Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
-```
-
-#### Downloading a File w/Progress
-
-```swift
-Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
- .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in
- print(totalBytesRead)
-
- // This closure is NOT called on the main queue for performance
- // reasons. To update your ui, dispatch to the main queue.
- dispatch_async(dispatch_get_main_queue()) {
- print("Total bytes read on main queue: \(totalBytesRead)")
- }
- }
- .response { _, _, _, error in
- if let error = error {
- print("Failed with error: \(error)")
- } else {
- print("Downloaded file successfully")
- }
- }
-```
-
-#### Accessing Resume Data for Failed Downloads
-
-```swift
-Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
- .response { _, _, data, _ in
- if let
- data = data,
- resumeDataString = NSString(data: data, encoding: NSUTF8StringEncoding)
- {
- print("Resume Data: \(resumeDataString)")
- } else {
- print("Resume Data was empty")
- }
- }
-```
-
-> The `data` parameter is automatically populated with the `resumeData` if available.
-
-```swift
-let download = Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination)
-download.response { _, _, _, _ in
- if let
- resumeData = download.resumeData,
- resumeDataString = NSString(data: resumeData, encoding: NSUTF8StringEncoding)
- {
- print("Resume Data: \(resumeDataString)")
- } else {
- print("Resume Data was empty")
- }
-}
-```
-
-### Authentication
-
-Authentication is handled on the system framework level by [`NSURLCredential` and `NSURLAuthenticationChallenge`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html).
-
-**Supported Authentication Schemes**
-
-- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication)
-- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication)
-- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29)
-- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager)
-
-#### HTTP Basic Authentication
-
-The `authenticate` method on a `Request` will automatically provide an `NSURLCredential` to an `NSURLAuthenticationChallenge` when appropriate:
-
-```swift
-let user = "user"
-let password = "password"
-
-Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)")
- .authenticate(user: user, password: password)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-Depending upon your server implementation, an `Authorization` header may also be appropriate:
-
-```swift
-let user = "user"
-let password = "password"
-
-let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)!
-let base64Credentials = credentialData.base64EncodedStringWithOptions([])
-
-let headers = ["Authorization": "Basic \(base64Credentials)"]
-
-Alamofire.request(.GET, "https://httpbin.org/basic-auth/user/password", headers: headers)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-#### Authentication with NSURLCredential
-
-```swift
-let user = "user"
-let password = "password"
-
-let credential = NSURLCredential(user: user, password: password, persistence: .ForSession)
-
-Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)")
- .authenticate(usingCredential: credential)
- .responseJSON { response in
- debugPrint(response)
- }
-```
-
-### Timeline
-
-Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on a `Response`.
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
- .validate()
- .responseJSON { response in
- print(response.timeline)
- }
-```
-
-The above reports the following `Timeline` info:
-
-- `Latency`: 0.428 seconds
-- `Request Duration`: 0.428 seconds
-- `Serialization Duration`: 0.001 seconds
-- `Total Duration`: 0.429 seconds
-
-### Printable
-
-```swift
-let request = Alamofire.request(.GET, "https://httpbin.org/ip")
-
-print(request)
-// GET https://httpbin.org/ip (200)
-```
-
-### DebugPrintable
-
-```swift
-let request = Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
-
-debugPrint(request)
-```
-
-#### Output (cURL)
-
-```bash
-$ curl -i \
- -H "User-Agent: Alamofire" \
- -H "Accept-Encoding: Accept-Encoding: gzip;q=1.0,compress;q=0.5" \
- -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \
- "https://httpbin.org/get?foo=bar"
-```
-
----
-
-## Advanced Usage
-
-> Alamofire is built on `NSURLSession` and the Foundation URL Loading System. To make the most of
-this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack.
-
-**Recommended Reading**
-
-- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html)
-- [NSURLSession Class Reference](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/Introduction/Introduction.html#//apple_ref/occ/cl/NSURLSession)
-- [NSURLCache Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache)
-- [NSURLAuthenticationChallenge Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html)
-
-### Manager
-
-Top-level convenience methods like `Alamofire.request` use a shared instance of `Alamofire.Manager`, which is configured with the default `NSURLSessionConfiguration`.
-
-As such, the following two statements are equivalent:
-
-```swift
-Alamofire.request(.GET, "https://httpbin.org/get")
-```
-
-```swift
-let manager = Alamofire.Manager.sharedInstance
-manager.request(NSURLRequest(URL: NSURL(string: "https://httpbin.org/get")!))
-```
-
-Applications can create managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`HTTPAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`).
-
-#### Creating a Manager with Default Configuration
-
-```swift
-let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-#### Creating a Manager with Background Configuration
-
-```swift
-let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier("com.example.app.background")
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-#### Creating a Manager with Ephemeral Configuration
-
-```swift
-let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration()
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-#### Modifying Session Configuration
-
-```swift
-var defaultHeaders = Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders ?? [:]
-defaultHeaders["DNT"] = "1 (Do Not Track Enabled)"
-
-let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
-configuration.HTTPAdditionalHeaders = defaultHeaders
-
-let manager = Alamofire.Manager(configuration: configuration)
-```
-
-> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use `URLRequestConvertible` and `ParameterEncoding`, respectively.
-
-### Request
-
-The result of a `request`, `upload`, or `download` method is an instance of `Alamofire.Request`. A request is always created using a constructor method from an owning manager, and never initialized directly.
-
-Methods like `authenticate`, `validate` and `responseData` return the caller in order to facilitate chaining.
-
-Requests can be suspended, resumed, and cancelled:
-
-- `suspend()`: Suspends the underlying task and dispatch queue
-- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start.
-- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers.
-
-### Response Serialization
-
-#### Handling Errors
-
-Before implementing custom response serializers or object serialization methods, it's important to be prepared to handle any errors that may occur. Alamofire recommends handling these through the use of either your own `NSError` creation methods, or a simple `enum` that conforms to `ErrorType`. For example, this `BackendError` type, which will be used in later examples:
-
-```swift
-enum BackendError: ErrorType {
- case Network(error: NSError)
- case DataSerialization(reason: String)
- case JSONSerialization(error: NSError)
- case ObjectSerialization(reason: String)
- case XMLSerialization(error: NSError)
-}
-```
-
-#### Creating a Custom Response Serializer
-
-Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.Request`.
-
-For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented:
-
-```swift
-extension Request {
- public static func XMLResponseSerializer() -> ResponseSerializer {
- return ResponseSerializer { request, response, data, error in
- guard error == nil else { return .Failure(.Network(error: error!)) }
-
- guard let validData = data else {
- return .Failure(.DataSerialization(reason: "Data could not be serialized. Input data was nil."))
- }
-
- do {
- let XML = try ONOXMLDocument(data: validData)
- return .Success(XML)
- } catch {
- return .Failure(.XMLSerialization(error: error as NSError))
- }
- }
- }
-
- public func responseXMLDocument(completionHandler: Response -> Void) -> Self {
- return response(responseSerializer: Request.XMLResponseSerializer(), completionHandler: completionHandler)
- }
-}
-```
-
-#### Generic Response Object Serialization
-
-Generics can be used to provide automatic, type-safe response object serialization.
-
-```swift
-public protocol ResponseObjectSerializable {
- init?(response: NSHTTPURLResponse, representation: AnyObject)
-}
-
-extension Request {
- public func responseObject(completionHandler: Response -> Void) -> Self {
- let responseSerializer = ResponseSerializer { request, response, data, error in
- guard error == nil else { return .Failure(.Network(error: error!)) }
-
- let JSONResponseSerializer = Request.JSONResponseSerializer(options: .AllowFragments)
- let result = JSONResponseSerializer.serializeResponse(request, response, data, error)
-
- switch result {
- case .Success(let value):
- if let
- response = response,
- responseObject = T(response: response, representation: value)
- {
- return .Success(responseObject)
- } else {
- return .Failure(.ObjectSerialization(reason: "JSON could not be serialized into response object: \(value)"))
- }
- case .Failure(let error):
- return .Failure(.JSONSerialization(error: error))
- }
- }
-
- return response(responseSerializer: responseSerializer, completionHandler: completionHandler)
- }
-}
-```
-
-```swift
-final class User: ResponseObjectSerializable {
- let username: String
- let name: String
-
- init?(response: NSHTTPURLResponse, representation: AnyObject) {
- self.username = response.URL!.lastPathComponent!
- self.name = representation.valueForKeyPath("name") as! String
- }
-}
-```
-
-```swift
-Alamofire.request(.GET, "https://example.com/users/mattt")
- .responseObject { (response: Response) in
- debugPrint(response)
- }
-```
-
-The same approach can also be used to handle endpoints that return a representation of a collection of objects:
-
-```swift
-public protocol ResponseCollectionSerializable {
- static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self]
-}
-
-extension ResponseCollectionSerializable where Self: ResponseObjectSerializable {
- static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self] {
- var collection = [Self]()
-
- if let representation = representation as? [[String: AnyObject]] {
- for itemRepresentation in representation {
- if let item = Self(response: response, representation: itemRepresentation) {
- collection.append(item)
- }
- }
- }
-
- return collection
- }
-}
-
-extension Alamofire.Request {
- public func responseCollection(completionHandler: Response<[T], BackendError> -> Void) -> Self {
- let responseSerializer = ResponseSerializer<[T], BackendError> { request, response, data, error in
- guard error == nil else { return .Failure(.Network(error: error!)) }
-
- let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments)
- let result = JSONSerializer.serializeResponse(request, response, data, error)
-
- switch result {
- case .Success(let value):
- if let response = response {
- return .Success(T.collection(response: response, representation: value))
- } else {
- return .Failure(. ObjectSerialization(reason: "Response collection could not be serialized due to nil response"))
- }
- case .Failure(let error):
- return .Failure(.JSONSerialization(error: error))
- }
- }
-
- return response(responseSerializer: responseSerializer, completionHandler: completionHandler)
- }
-}
-```
-
-```swift
-final class User: ResponseObjectSerializable, ResponseCollectionSerializable {
- let username: String
- let name: String
-
- init?(response: NSHTTPURLResponse, representation: AnyObject) {
- self.username = response.URL!.lastPathComponent!
- self.name = representation.valueForKeyPath("name") as! String
- }
-}
-```
-
-```swift
-Alamofire.request(.GET, "http://example.com/users")
- .responseCollection { (response: Response<[User], BackendError>) in
- debugPrint(response)
- }
-```
-
-### URLStringConvertible
-
-Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to construct URL requests. `NSString`, `NSURL`, `NSURLComponents`, and `NSURLRequest` conform to `URLStringConvertible` by default, allowing any of them to be passed as `URLString` parameters to the `request`, `upload`, and `download` methods:
-
-```swift
-let string = NSString(string: "https://httpbin.org/post")
-Alamofire.request(.POST, string)
-
-let URL = NSURL(string: string)!
-Alamofire.request(.POST, URL)
-
-let URLRequest = NSURLRequest(URL: URL)
-Alamofire.request(.POST, URLRequest) // overrides `HTTPMethod` of `URLRequest`
-
-let URLComponents = NSURLComponents(URL: URL, resolvingAgainstBaseURL: true)
-Alamofire.request(.POST, URLComponents)
-```
-
-Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLStringConvertible` as a convenient way to map domain-specific models to server resources.
-
-#### Type-Safe Routing
-
-```swift
-extension User: URLStringConvertible {
- static let baseURLString = "http://example.com"
-
- var URLString: String {
- return User.baseURLString + "/users/\(username)/"
- }
-}
-```
-
-```swift
-let user = User(username: "mattt")
-Alamofire.request(.GET, user) // http://example.com/users/mattt
-```
-
-### URLRequestConvertible
-
-Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `NSURLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests):
-
-```swift
-let URL = NSURL(string: "https://httpbin.org/post")!
-let mutableURLRequest = NSMutableURLRequest(URL: URL)
-mutableURLRequest.HTTPMethod = "POST"
-
-let parameters = ["foo": "bar"]
-
-do {
- mutableURLRequest.HTTPBody = try NSJSONSerialization.dataWithJSONObject(parameters, options: NSJSONWritingOptions())
-} catch {
- // No-op
-}
-
-mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
-
-Alamofire.request(mutableURLRequest)
-```
-
-Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state.
-
-#### API Parameter Abstraction
-
-```swift
-enum Router: URLRequestConvertible {
- static let baseURLString = "http://example.com"
- static let perPage = 50
-
- case Search(query: String, page: Int)
-
- // MARK: URLRequestConvertible
-
- var URLRequest: NSMutableURLRequest {
- let result: (path: String, parameters: [String: AnyObject]) = {
- switch self {
- case .Search(let query, let page) where page > 0:
- return ("/search", ["q": query, "offset": Router.perPage * page])
- case .Search(let query, _):
- return ("/search", ["q": query])
- }
- }()
-
- let URL = NSURL(string: Router.baseURLString)!
- let URLRequest = NSURLRequest(URL: URL.URLByAppendingPathComponent(result.path))
- let encoding = Alamofire.ParameterEncoding.URL
-
- return encoding.encode(URLRequest, parameters: result.parameters).0
- }
-}
-```
-
-```swift
-Alamofire.request(Router.Search(query: "foo bar", page: 1)) // ?q=foo%20bar&offset=50
-```
-
-#### CRUD & Authorization
-
-```swift
-enum Router: URLRequestConvertible {
- static let baseURLString = "http://example.com"
- static var OAuthToken: String?
-
- case CreateUser([String: AnyObject])
- case ReadUser(String)
- case UpdateUser(String, [String: AnyObject])
- case DestroyUser(String)
-
- var method: Alamofire.Method {
- switch self {
- case .CreateUser:
- return .POST
- case .ReadUser:
- return .GET
- case .UpdateUser:
- return .PUT
- case .DestroyUser:
- return .DELETE
- }
- }
-
- var path: String {
- switch self {
- case .CreateUser:
- return "/users"
- case .ReadUser(let username):
- return "/users/\(username)"
- case .UpdateUser(let username, _):
- return "/users/\(username)"
- case .DestroyUser(let username):
- return "/users/\(username)"
- }
- }
-
- // MARK: URLRequestConvertible
-
- var URLRequest: NSMutableURLRequest {
- let URL = NSURL(string: Router.baseURLString)!
- let mutableURLRequest = NSMutableURLRequest(URL: URL.URLByAppendingPathComponent(path))
- mutableURLRequest.HTTPMethod = method.rawValue
-
- if let token = Router.OAuthToken {
- mutableURLRequest.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
- }
-
- switch self {
- case .CreateUser(let parameters):
- return Alamofire.ParameterEncoding.JSON.encode(mutableURLRequest, parameters: parameters).0
- case .UpdateUser(_, let parameters):
- return Alamofire.ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0
- default:
- return mutableURLRequest
- }
- }
-}
-```
-
-```swift
-Alamofire.request(Router.ReadUser("mattt")) // GET /users/mattt
-```
-
-### SessionDelegate
-
-By default, an Alamofire `Manager` instance creates an internal `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `NSURLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons.
-
-#### Override Closures
-
-The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available:
-
-```swift
-/// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`.
-public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
-
-/// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`.
-public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)?
-
-/// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`.
-public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)?
-
-/// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`.
-public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)?
-```
-
-The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains.
-
-```swift
-let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
-
-delegate.taskWillPerformHTTPRedirection = { session, task, response, request in
- var finalRequest = request
-
- if let originalRequest = task.originalRequest where originalRequest.URLString.containsString("apple.com") {
- finalRequest = originalRequest
- }
-
- return finalRequest
-}
-```
-
-#### Subclassing
-
-Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs.
-
-```swift
-class LoggingSessionDelegate: Manager.SessionDelegate {
- override func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- willPerformHTTPRedirection response: NSHTTPURLResponse,
- newRequest request: NSURLRequest,
- completionHandler: NSURLRequest? -> Void)
- {
- print("URLSession will perform HTTP redirection to request: \(request)")
-
- super.URLSession(
- session,
- task: task,
- willPerformHTTPRedirection: response,
- newRequest: request,
- completionHandler: completionHandler
- )
- }
-}
-```
-
-Generally, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort.
-
-> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks.
-
-### Security
-
-Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`.
-
-#### ServerTrustPolicy
-
-The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection.
-
-```swift
-let serverTrustPolicy = ServerTrustPolicy.PinCertificates(
- certificates: ServerTrustPolicy.certificatesInBundle(),
- validateCertificateChain: true,
- validateHost: true
-)
-```
-
-There are many different cases of server trust evaluation giving you complete control over the validation process:
-
-* `PerformDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge.
-* `PinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates.
-* `PinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys.
-* `DisableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid.
-* `CustomEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution.
-
-#### Server Trust Policy Manager
-
-The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy.
-
-```swift
-let serverTrustPolicies: [String: ServerTrustPolicy] = [
- "test.example.com": .PinCertificates(
- certificates: ServerTrustPolicy.certificatesInBundle(),
- validateCertificateChain: true,
- validateHost: true
- ),
- "insecure.expired-apis.com": .DisableEvaluation
-]
-
-let manager = Manager(
- serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies)
-)
-```
-
-> Make sure to keep a reference to the new `Manager` instance, otherwise your requests will all get cancelled when your `manager` is deallocated.
-
-These server trust policies will result in the following behavior:
-
-* `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed:
- * Certificate chain MUST be valid.
- * Certificate chain MUST include one of the pinned certificates.
- * Challenge host MUST match the host in the certificate chain's leaf certificate.
-* `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed.
-* All other hosts will use the default evaluation provided by Apple.
-
-##### Subclassing Server Trust Policy Manager
-
-If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation.
-
-```swift
-class CustomServerTrustPolicyManager: ServerTrustPolicyManager {
- override func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? {
- var policy: ServerTrustPolicy?
-
- // Implement your custom domain matching behavior...
-
- return policy
- }
-}
-```
-
-#### Validating the Host
-
-The `.PerformDefaultEvaluation`, `.PinCertificates` and `.PinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate.
-
-> It is recommended that `validateHost` always be set to `true` in production environments.
-
-#### Validating the Certificate Chain
-
-Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check.
-
-There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server.
-
-> It is recommended that `validateCertificateChain` always be set to `true` in production environments.
-
-#### App Transport Security
-
-With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust.
-
-If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`.
-
-```xml
-
- NSAppTransportSecurity
-
- NSExceptionDomains
-
- example.com
-
- NSExceptionAllowsInsecureHTTPLoads
-
- NSExceptionRequiresForwardSecrecy
-
- NSIncludesSubdomains
-
-
- NSTemporaryExceptionMinimumTLSVersion
- TLSv1.2
-
-
-
-
-```
-
-Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`.
-
-> It is recommended to always use valid certificates in production environments.
-
-### Network Reachability
-
-The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces.
-
-```swift
-let manager = NetworkReachabilityManager(host: "www.apple.com")
-
-manager?.listener = { status in
- print("Network Status Changed: \(status)")
-}
-
-manager?.startListening()
-```
-
-> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported.
-
-There are some important things to remember when using network reachability to determine what to do next.
-
-* **Do NOT** use Reachability to determine if a network request should be sent.
- * You should **ALWAYS** send it.
-* When Reachability is restored, use the event to retry failed network requests.
- * Even though the network requests may still fail, this is a good moment to retry them.
-* The network reachability status can be useful for determining why a network request may have failed.
- * If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out."
-
-> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info.
-
----
-
-## Open Rdars
-
-The following rdars have some affect on the current implementation of Alamofire.
-
-* [rdar://21349340](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case
-* [rdar://26761490](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage
-
-## FAQ
-
-### What's the origin of the name Alamofire?
-
-Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas.
-
----
-
-## Credits
-
-Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases.
-
-### Security Disclosure
-
-If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker.
-
-## Donations
-
-The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to:
-
-* Pay our legal fees to register as a federal non-profit organization
-* Pay our yearly legal fees to keep the non-profit in good status
-* Pay for our mail servers to help us stay on top of all questions and security issues
-* Potentially fund test servers to make it easier for us to test the edge cases
-* Potentially fund developers to work on one of our projects full-time
-
-The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated.
-
-
-
-## License
-
-Alamofire is released under the MIT license. See LICENSE for details.
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift
deleted file mode 100644
index cb4b36afbd36..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift
+++ /dev/null
@@ -1,370 +0,0 @@
-//
-// Alamofire.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-// MARK: - URLStringConvertible
-
-/**
- Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to
- construct URL requests.
-*/
-public protocol URLStringConvertible {
- /**
- A URL that conforms to RFC 2396.
-
- Methods accepting a `URLStringConvertible` type parameter parse it according to RFCs 1738 and 1808.
-
- See https://tools.ietf.org/html/rfc2396
- See https://tools.ietf.org/html/rfc1738
- See https://tools.ietf.org/html/rfc1808
- */
- var URLString: String { get }
-}
-
-extension String: URLStringConvertible {
- public var URLString: String {
- return self
- }
-}
-
-extension NSURL: URLStringConvertible {
- public var URLString: String {
- return absoluteString
- }
-}
-
-extension NSURLComponents: URLStringConvertible {
- public var URLString: String {
- return URL!.URLString
- }
-}
-
-extension NSURLRequest: URLStringConvertible {
- public var URLString: String {
- return URL!.URLString
- }
-}
-
-// MARK: - URLRequestConvertible
-
-/**
- Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests.
-*/
-public protocol URLRequestConvertible {
- /// The URL request.
- var URLRequest: NSMutableURLRequest { get }
-}
-
-extension NSURLRequest: URLRequestConvertible {
- public var URLRequest: NSMutableURLRequest {
- return self.mutableCopy() as! NSMutableURLRequest
- }
-}
-
-// MARK: - Convenience
-
-func URLRequest(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil)
- -> NSMutableURLRequest
-{
- let mutableURLRequest = NSMutableURLRequest(URL: NSURL(string: URLString.URLString)!)
- mutableURLRequest.HTTPMethod = method.rawValue
-
- if let headers = headers {
- for (headerField, headerValue) in headers {
- mutableURLRequest.setValue(headerValue, forHTTPHeaderField: headerField)
- }
- }
-
- return mutableURLRequest
-}
-
-// MARK: - Request Methods
-
-/**
- Creates a request using the shared manager instance for the specified method, URL string, parameters, and
- parameter encoding.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
-
- - returns: The created request.
-*/
-public func request(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil)
- -> Request
-{
- return Manager.sharedInstance.request(
- method,
- URLString,
- parameters: parameters,
- encoding: encoding,
- headers: headers
- )
-}
-
-/**
- Creates a request using the shared manager instance for the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
-
- - returns: The created request.
-*/
-public func request(URLRequest: URLRequestConvertible) -> Request {
- return Manager.sharedInstance.request(URLRequest.URLRequest)
-}
-
-// MARK: - Upload Methods
-
-// MARK: File
-
-/**
- Creates an upload request using the shared manager instance for the specified method, URL string, and file.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter file: The file to upload.
-
- - returns: The created upload request.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- file: NSURL)
- -> Request
-{
- return Manager.sharedInstance.upload(method, URLString, headers: headers, file: file)
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified URL request and file.
-
- - parameter URLRequest: The URL request.
- - parameter file: The file to upload.
-
- - returns: The created upload request.
-*/
-public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request {
- return Manager.sharedInstance.upload(URLRequest, file: file)
-}
-
-// MARK: Data
-
-/**
- Creates an upload request using the shared manager instance for the specified method, URL string, and data.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter data: The data to upload.
-
- - returns: The created upload request.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- data: NSData)
- -> Request
-{
- return Manager.sharedInstance.upload(method, URLString, headers: headers, data: data)
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified URL request and data.
-
- - parameter URLRequest: The URL request.
- - parameter data: The data to upload.
-
- - returns: The created upload request.
-*/
-public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request {
- return Manager.sharedInstance.upload(URLRequest, data: data)
-}
-
-// MARK: Stream
-
-/**
- Creates an upload request using the shared manager instance for the specified method, URL string, and stream.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- stream: NSInputStream)
- -> Request
-{
- return Manager.sharedInstance.upload(method, URLString, headers: headers, stream: stream)
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified URL request and stream.
-
- - parameter URLRequest: The URL request.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
-*/
-public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request {
- return Manager.sharedInstance.upload(URLRequest, stream: stream)
-}
-
-// MARK: MultipartFormData
-
-/**
- Creates an upload request using the shared manager instance for the specified method and URL string.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
-*/
-public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?)
-{
- return Manager.sharedInstance.upload(
- method,
- URLString,
- headers: headers,
- multipartFormData: multipartFormData,
- encodingMemoryThreshold: encodingMemoryThreshold,
- encodingCompletion: encodingCompletion
- )
-}
-
-/**
- Creates an upload request using the shared manager instance for the specified method and URL string.
-
- - parameter URLRequest: The URL request.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
-*/
-public func upload(
- URLRequest: URLRequestConvertible,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?)
-{
- return Manager.sharedInstance.upload(
- URLRequest,
- multipartFormData: multipartFormData,
- encodingMemoryThreshold: encodingMemoryThreshold,
- encodingCompletion: encodingCompletion
- )
-}
-
-// MARK: - Download Methods
-
-// MARK: URL Request
-
-/**
- Creates a download request using the shared manager instance for the specified method and URL string.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
-*/
-public func download(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil,
- destination: Request.DownloadFileDestination)
- -> Request
-{
- return Manager.sharedInstance.download(
- method,
- URLString,
- parameters: parameters,
- encoding: encoding,
- headers: headers,
- destination: destination
- )
-}
-
-/**
- Creates a download request using the shared manager instance for the specified URL request.
-
- - parameter URLRequest: The URL request.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
-*/
-public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request {
- return Manager.sharedInstance.download(URLRequest, destination: destination)
-}
-
-// MARK: Resume Data
-
-/**
- Creates a request using the shared manager instance for downloading from the resume data produced from a
- previous request cancellation.
-
- - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask`
- when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional
- information.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
-*/
-public func download(resumeData data: NSData, destination: Request.DownloadFileDestination) -> Request {
- return Manager.sharedInstance.download(data, destination: destination)
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift
deleted file mode 100644
index 97b146fc0168..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift
+++ /dev/null
@@ -1,248 +0,0 @@
-//
-// Download.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-extension Manager {
- private enum Downloadable {
- case Request(NSURLRequest)
- case ResumeData(NSData)
- }
-
- private func download(downloadable: Downloadable, destination: Request.DownloadFileDestination) -> Request {
- var downloadTask: NSURLSessionDownloadTask!
-
- switch downloadable {
- case .Request(let request):
- dispatch_sync(queue) {
- downloadTask = self.session.downloadTaskWithRequest(request)
- }
- case .ResumeData(let resumeData):
- dispatch_sync(queue) {
- downloadTask = self.session.downloadTaskWithResumeData(resumeData)
- }
- }
-
- let request = Request(session: session, task: downloadTask)
-
- if let downloadDelegate = request.delegate as? Request.DownloadTaskDelegate {
- downloadDelegate.downloadTaskDidFinishDownloadingToURL = { session, downloadTask, URL in
- return destination(URL, downloadTask.response as! NSHTTPURLResponse)
- }
- }
-
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- // MARK: Request
-
- /**
- Creates a download request for the specified method, URL string, parameters, parameter encoding, headers
- and destination.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
- */
- public func download(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil,
- destination: Request.DownloadFileDestination)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
- let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0
-
- return download(encodedURLRequest, destination: destination)
- }
-
- /**
- Creates a request for downloading from the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
- */
- public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request {
- return download(.Request(URLRequest.URLRequest), destination: destination)
- }
-
- // MARK: Resume Data
-
- /**
- Creates a request for downloading from the resume data produced from a previous request cancellation.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask`
- when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for
- additional information.
- - parameter destination: The closure used to determine the destination of the downloaded file.
-
- - returns: The created download request.
- */
- public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request {
- return download(.ResumeData(resumeData), destination: destination)
- }
-}
-
-// MARK: -
-
-extension Request {
- /**
- A closure executed once a request has successfully completed in order to determine where to move the temporary
- file written to during the download process. The closure takes two arguments: the temporary file URL and the URL
- response, and returns a single argument: the file URL where the temporary file should be moved.
- */
- public typealias DownloadFileDestination = (NSURL, NSHTTPURLResponse) -> NSURL
-
- /**
- Creates a download file destination closure which uses the default file manager to move the temporary file to a
- file URL in the first available directory with the specified search path directory and search path domain mask.
-
- - parameter directory: The search path directory. `.DocumentDirectory` by default.
- - parameter domain: The search path domain mask. `.UserDomainMask` by default.
-
- - returns: A download file destination closure.
- */
- public class func suggestedDownloadDestination(
- directory directory: NSSearchPathDirectory = .DocumentDirectory,
- domain: NSSearchPathDomainMask = .UserDomainMask)
- -> DownloadFileDestination
- {
- return { temporaryURL, response -> NSURL in
- let directoryURLs = NSFileManager.defaultManager().URLsForDirectory(directory, inDomains: domain)
-
- if !directoryURLs.isEmpty {
- return directoryURLs[0].URLByAppendingPathComponent(response.suggestedFilename!)
- }
-
- return temporaryURL
- }
- }
-
- /// The resume data of the underlying download task if available after a failure.
- public var resumeData: NSData? {
- var data: NSData?
-
- if let delegate = delegate as? DownloadTaskDelegate {
- data = delegate.resumeData
- }
-
- return data
- }
-
- // MARK: - DownloadTaskDelegate
-
- class DownloadTaskDelegate: TaskDelegate, NSURLSessionDownloadDelegate {
- var downloadTask: NSURLSessionDownloadTask? { return task as? NSURLSessionDownloadTask }
- var downloadProgress: ((Int64, Int64, Int64) -> Void)?
-
- var resumeData: NSData?
- override var data: NSData? { return resumeData }
-
- // MARK: - NSURLSessionDownloadDelegate
-
- // MARK: Override Closures
-
- var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> NSURL)?
- var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)?
- var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didFinishDownloadingToURL location: NSURL)
- {
- if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL {
- do {
- let destination = downloadTaskDidFinishDownloadingToURL(session, downloadTask, location)
- try NSFileManager.defaultManager().moveItemAtURL(location, toURL: destination)
- } catch {
- self.error = error as NSError
- }
- }
- }
-
- func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didWriteData bytesWritten: Int64,
- totalBytesWritten: Int64,
- totalBytesExpectedToWrite: Int64)
- {
- if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
-
- if let downloadTaskDidWriteData = downloadTaskDidWriteData {
- downloadTaskDidWriteData(
- session,
- downloadTask,
- bytesWritten,
- totalBytesWritten,
- totalBytesExpectedToWrite
- )
- } else {
- progress.totalUnitCount = totalBytesExpectedToWrite
- progress.completedUnitCount = totalBytesWritten
-
- downloadProgress?(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite)
- }
- }
-
- func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didResumeAtOffset fileOffset: Int64,
- expectedTotalBytes: Int64)
- {
- if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset {
- downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes)
- } else {
- progress.totalUnitCount = expectedTotalBytes
- progress.completedUnitCount = fileOffset
- }
- }
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Error.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Error.swift
deleted file mode 100644
index 467d99c916c5..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Error.swift
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// Error.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// The `Error` struct provides a convenience for creating custom Alamofire NSErrors.
-public struct Error {
- /// The domain used for creating all Alamofire errors.
- public static let Domain = "com.alamofire.error"
-
- /// The custom error codes generated by Alamofire.
- public enum Code: Int {
- case InputStreamReadFailed = -6000
- case OutputStreamWriteFailed = -6001
- case ContentTypeValidationFailed = -6002
- case StatusCodeValidationFailed = -6003
- case DataSerializationFailed = -6004
- case StringSerializationFailed = -6005
- case JSONSerializationFailed = -6006
- case PropertyListSerializationFailed = -6007
- }
-
- /// Custom keys contained within certain NSError `userInfo` dictionaries generated by Alamofire.
- public struct UserInfoKeys {
- /// The content type user info key for a `.ContentTypeValidationFailed` error stored as a `String` value.
- public static let ContentType = "ContentType"
-
- /// The status code user info key for a `.StatusCodeValidationFailed` error stored as an `Int` value.
- public static let StatusCode = "StatusCode"
- }
-
- /**
- Creates an `NSError` with the given error code and failure reason.
-
- - parameter code: The error code.
- - parameter failureReason: The failure reason.
-
- - returns: An `NSError` with the given error code and failure reason.
- */
- @available(*, deprecated=3.4.0)
- public static func errorWithCode(code: Code, failureReason: String) -> NSError {
- return errorWithCode(code.rawValue, failureReason: failureReason)
- }
-
- /**
- Creates an `NSError` with the given error code and failure reason.
-
- - parameter code: The error code.
- - parameter failureReason: The failure reason.
-
- - returns: An `NSError` with the given error code and failure reason.
- */
- @available(*, deprecated=3.4.0)
- public static func errorWithCode(code: Int, failureReason: String) -> NSError {
- let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason]
- return NSError(domain: Domain, code: code, userInfo: userInfo)
- }
-
- static func error(domain domain: String = Error.Domain, code: Code, failureReason: String) -> NSError {
- return error(domain: domain, code: code.rawValue, failureReason: failureReason)
- }
-
- static func error(domain domain: String = Error.Domain, code: Int, failureReason: String) -> NSError {
- let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason]
- return NSError(domain: domain, code: code, userInfo: userInfo)
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift
deleted file mode 100644
index 691d31f62f78..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift
+++ /dev/null
@@ -1,778 +0,0 @@
-//
-// Manager.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/**
- Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`.
-*/
-public class Manager {
-
- // MARK: - Properties
-
- /**
- A shared instance of `Manager`, used by top-level Alamofire request methods, and suitable for use directly
- for any ad hoc requests.
- */
- public static let sharedInstance: Manager = {
- let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
- configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders
-
- return Manager(configuration: configuration)
- }()
-
- /**
- Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers.
- */
- public static let defaultHTTPHeaders: [String: String] = {
- // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3
- let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5"
-
- // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5
- let acceptLanguage = NSLocale.preferredLanguages().prefix(6).enumerate().map { index, languageCode in
- let quality = 1.0 - (Double(index) * 0.1)
- return "\(languageCode);q=\(quality)"
- }.joinWithSeparator(", ")
-
- // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3
- let userAgent: String = {
- if let info = NSBundle.mainBundle().infoDictionary {
- let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown"
- let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown"
- let version = info[kCFBundleVersionKey as String] as? String ?? "Unknown"
-
- let osNameVersion: String = {
- let versionString: String
-
- if #available(OSX 10.10, *) {
- let version = NSProcessInfo.processInfo().operatingSystemVersion
- versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)"
- } else {
- versionString = "10.9"
- }
-
- let osName: String = {
- #if os(iOS)
- return "iOS"
- #elseif os(watchOS)
- return "watchOS"
- #elseif os(tvOS)
- return "tvOS"
- #elseif os(OSX)
- return "OS X"
- #elseif os(Linux)
- return "Linux"
- #else
- return "Unknown"
- #endif
- }()
-
- return "\(osName) \(versionString)"
- }()
-
- return "\(executable)/\(bundle) (\(version); \(osNameVersion))"
- }
-
- return "Alamofire"
- }()
-
- return [
- "Accept-Encoding": acceptEncoding,
- "Accept-Language": acceptLanguage,
- "User-Agent": userAgent
- ]
- }()
-
- let queue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL)
-
- /// The underlying session.
- public let session: NSURLSession
-
- /// The session delegate handling all the task and session delegate callbacks.
- public let delegate: SessionDelegate
-
- /// Whether to start requests immediately after being constructed. `true` by default.
- public var startRequestsImmediately: Bool = true
-
- /**
- The background completion handler closure provided by the UIApplicationDelegate
- `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background
- completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation
- will automatically call the handler.
-
- If you need to handle your own events before the handler is called, then you need to override the
- SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished.
-
- `nil` by default.
- */
- public var backgroundCompletionHandler: (() -> Void)?
-
- // MARK: - Lifecycle
-
- /**
- Initializes the `Manager` instance with the specified configuration, delegate and server trust policy.
-
- - parameter configuration: The configuration used to construct the managed session.
- `NSURLSessionConfiguration.defaultSessionConfiguration()` by default.
- - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by
- default.
- - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust
- challenges. `nil` by default.
-
- - returns: The new `Manager` instance.
- */
- public init(
- configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(),
- delegate: SessionDelegate = SessionDelegate(),
- serverTrustPolicyManager: ServerTrustPolicyManager? = nil)
- {
- self.delegate = delegate
- self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil)
-
- commonInit(serverTrustPolicyManager: serverTrustPolicyManager)
- }
-
- /**
- Initializes the `Manager` instance with the specified session, delegate and server trust policy.
-
- - parameter session: The URL session.
- - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate.
- - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust
- challenges. `nil` by default.
-
- - returns: The new `Manager` instance if the URL session's delegate matches the delegate parameter.
- */
- public init?(
- session: NSURLSession,
- delegate: SessionDelegate,
- serverTrustPolicyManager: ServerTrustPolicyManager? = nil)
- {
- guard delegate === session.delegate else { return nil }
-
- self.delegate = delegate
- self.session = session
-
- commonInit(serverTrustPolicyManager: serverTrustPolicyManager)
- }
-
- private func commonInit(serverTrustPolicyManager serverTrustPolicyManager: ServerTrustPolicyManager?) {
- session.serverTrustPolicyManager = serverTrustPolicyManager
-
- delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in
- guard let strongSelf = self else { return }
- dispatch_async(dispatch_get_main_queue()) { strongSelf.backgroundCompletionHandler?() }
- }
- }
-
- deinit {
- session.invalidateAndCancel()
- }
-
- // MARK: - Request
-
- /**
- Creates a request for the specified method, URL string, parameters, parameter encoding and headers.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter parameters: The parameters. `nil` by default.
- - parameter encoding: The parameter encoding. `.URL` by default.
- - parameter headers: The HTTP headers. `nil` by default.
-
- - returns: The created request.
- */
- public func request(
- method: Method,
- _ URLString: URLStringConvertible,
- parameters: [String: AnyObject]? = nil,
- encoding: ParameterEncoding = .URL,
- headers: [String: String]? = nil)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
- let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0
- return request(encodedURLRequest)
- }
-
- /**
- Creates a request for the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
-
- - returns: The created request.
- */
- public func request(URLRequest: URLRequestConvertible) -> Request {
- var dataTask: NSURLSessionDataTask!
- dispatch_sync(queue) { dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) }
-
- let request = Request(session: session, task: dataTask)
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- // MARK: - SessionDelegate
-
- /**
- Responsible for handling all delegate callbacks for the underlying session.
- */
- public class SessionDelegate: NSObject, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate {
- private var subdelegates: [Int: Request.TaskDelegate] = [:]
- private let subdelegateQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT)
-
- /// Access the task delegate for the specified task in a thread-safe manner.
- public subscript(task: NSURLSessionTask) -> Request.TaskDelegate? {
- get {
- var subdelegate: Request.TaskDelegate?
- dispatch_sync(subdelegateQueue) { subdelegate = self.subdelegates[task.taskIdentifier] }
-
- return subdelegate
- }
- set {
- dispatch_barrier_async(subdelegateQueue) { self.subdelegates[task.taskIdentifier] = newValue }
- }
- }
-
- /**
- Initializes the `SessionDelegate` instance.
-
- - returns: The new `SessionDelegate` instance.
- */
- public override init() {
- super.init()
- }
-
- // MARK: - NSURLSessionDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didBecomeInvalidWithError:`.
- public var sessionDidBecomeInvalidWithError: ((NSURLSession, NSError?) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`.
- public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
-
- /// Overrides all behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:` and requires the caller to call the `completionHandler`.
- public var sessionDidReceiveChallengeWithCompletion: ((NSURLSession, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`.
- public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the session has been invalidated.
-
- - parameter session: The session object that was invalidated.
- - parameter error: The error that caused invalidation, or nil if the invalidation was explicit.
- */
- public func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) {
- sessionDidBecomeInvalidWithError?(session, error)
- }
-
- /**
- Requests credentials from the delegate in response to a session-level authentication request from the remote server.
-
- - parameter session: The session containing the task that requested authentication.
- - parameter challenge: An object that contains the request for authentication.
- - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential.
- */
- public func URLSession(
- session: NSURLSession,
- didReceiveChallenge challenge: NSURLAuthenticationChallenge,
- completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void))
- {
- guard sessionDidReceiveChallengeWithCompletion == nil else {
- sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler)
- return
- }
-
- var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling
- var credential: NSURLCredential?
-
- if let sessionDidReceiveChallenge = sessionDidReceiveChallenge {
- (disposition, credential) = sessionDidReceiveChallenge(session, challenge)
- } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
- let host = challenge.protectionSpace.host
-
- if let
- serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host),
- serverTrust = challenge.protectionSpace.serverTrust
- {
- if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) {
- disposition = .UseCredential
- credential = NSURLCredential(forTrust: serverTrust)
- } else {
- disposition = .CancelAuthenticationChallenge
- }
- }
- }
-
- completionHandler(disposition, credential)
- }
-
- /**
- Tells the delegate that all messages enqueued for a session have been delivered.
-
- - parameter session: The session that no longer has any outstanding requests.
- */
- public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) {
- sessionDidFinishEventsForBackgroundURLSession?(session)
- }
-
- // MARK: - NSURLSessionTaskDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`.
- public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)?
-
- /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:` and
- /// requires the caller to call the `completionHandler`.
- public var taskWillPerformHTTPRedirectionWithCompletion: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, NSURLRequest? -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:`.
- public var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
-
- /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:` and
- /// requires the caller to call the `completionHandler`.
- public var taskDidReceiveChallengeWithCompletion: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:`.
- public var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)?
-
- /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:` and
- /// requires the caller to call the `completionHandler`.
- public var taskNeedNewBodyStreamWithCompletion: ((NSURLSession, NSURLSessionTask, NSInputStream? -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`.
- public var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)?
-
- /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didCompleteWithError:`.
- public var taskDidComplete: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the remote server requested an HTTP redirect.
-
- - parameter session: The session containing the task whose request resulted in a redirect.
- - parameter task: The task whose request resulted in a redirect.
- - parameter response: An object containing the server’s response to the original request.
- - parameter request: A URL request object filled out with the new location.
- - parameter completionHandler: A closure that your handler should call with either the value of the request
- parameter, a modified URL request object, or NULL to refuse the redirect and
- return the body of the redirect response.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- willPerformHTTPRedirection response: NSHTTPURLResponse,
- newRequest request: NSURLRequest,
- completionHandler: NSURLRequest? -> Void)
- {
- guard taskWillPerformHTTPRedirectionWithCompletion == nil else {
- taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler)
- return
- }
-
- var redirectRequest: NSURLRequest? = request
-
- if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection {
- redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request)
- }
-
- completionHandler(redirectRequest)
- }
-
- /**
- Requests credentials from the delegate in response to an authentication request from the remote server.
-
- - parameter session: The session containing the task whose request requires authentication.
- - parameter task: The task whose request requires authentication.
- - parameter challenge: An object that contains the request for authentication.
- - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didReceiveChallenge challenge: NSURLAuthenticationChallenge,
- completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)
- {
- guard taskDidReceiveChallengeWithCompletion == nil else {
- taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler)
- return
- }
-
- if let taskDidReceiveChallenge = taskDidReceiveChallenge {
- let result = taskDidReceiveChallenge(session, task, challenge)
- completionHandler(result.0, result.1)
- } else if let delegate = self[task] {
- delegate.URLSession(
- session,
- task: task,
- didReceiveChallenge: challenge,
- completionHandler: completionHandler
- )
- } else {
- URLSession(session, didReceiveChallenge: challenge, completionHandler: completionHandler)
- }
- }
-
- /**
- Tells the delegate when a task requires a new request body stream to send to the remote server.
-
- - parameter session: The session containing the task that needs a new body stream.
- - parameter task: The task that needs a new body stream.
- - parameter completionHandler: A completion handler that your delegate method should call with the new body stream.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- needNewBodyStream completionHandler: NSInputStream? -> Void)
- {
- guard taskNeedNewBodyStreamWithCompletion == nil else {
- taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler)
- return
- }
-
- if let taskNeedNewBodyStream = taskNeedNewBodyStream {
- completionHandler(taskNeedNewBodyStream(session, task))
- } else if let delegate = self[task] {
- delegate.URLSession(session, task: task, needNewBodyStream: completionHandler)
- }
- }
-
- /**
- Periodically informs the delegate of the progress of sending body content to the server.
-
- - parameter session: The session containing the data task.
- - parameter task: The data task.
- - parameter bytesSent: The number of bytes sent since the last time this delegate method was called.
- - parameter totalBytesSent: The total number of bytes sent so far.
- - parameter totalBytesExpectedToSend: The expected length of the body data.
- */
- public func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didSendBodyData bytesSent: Int64,
- totalBytesSent: Int64,
- totalBytesExpectedToSend: Int64)
- {
- if let taskDidSendBodyData = taskDidSendBodyData {
- taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend)
- } else if let delegate = self[task] as? Request.UploadTaskDelegate {
- delegate.URLSession(
- session,
- task: task,
- didSendBodyData: bytesSent,
- totalBytesSent: totalBytesSent,
- totalBytesExpectedToSend: totalBytesExpectedToSend
- )
- }
- }
-
- /**
- Tells the delegate that the task finished transferring data.
-
- - parameter session: The session containing the task whose request finished transferring data.
- - parameter task: The task whose request finished transferring data.
- - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil.
- */
- public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
- if let taskDidComplete = taskDidComplete {
- taskDidComplete(session, task, error)
- } else if let delegate = self[task] {
- delegate.URLSession(session, task: task, didCompleteWithError: error)
- }
-
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidComplete, object: task)
-
- self[task] = nil
- }
-
- // MARK: - NSURLSessionDataDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:`.
- public var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)?
-
- /// Overrides all behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:` and
- /// requires caller to call the `completionHandler`.
- public var dataTaskDidReceiveResponseWithCompletion: ((NSURLSession, NSURLSessionDataTask, NSURLResponse, NSURLSessionResponseDisposition -> Void) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didBecomeDownloadTask:`.
- public var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveData:`.
- public var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`.
- public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)?
-
- /// Overrides all behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:` and
- /// requires caller to call the `completionHandler`.
- public var dataTaskWillCacheResponseWithCompletion: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, NSCachedURLResponse? -> Void) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the data task received the initial reply (headers) from the server.
-
- - parameter session: The session containing the data task that received an initial reply.
- - parameter dataTask: The data task that received an initial reply.
- - parameter response: A URL response object populated with headers.
- - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a
- constant to indicate whether the transfer should continue as a data task or
- should become a download task.
- */
- public func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didReceiveResponse response: NSURLResponse,
- completionHandler: NSURLSessionResponseDisposition -> Void)
- {
- guard dataTaskDidReceiveResponseWithCompletion == nil else {
- dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler)
- return
- }
-
- var disposition: NSURLSessionResponseDisposition = .Allow
-
- if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse {
- disposition = dataTaskDidReceiveResponse(session, dataTask, response)
- }
-
- completionHandler(disposition)
- }
-
- /**
- Tells the delegate that the data task was changed to a download task.
-
- - parameter session: The session containing the task that was replaced by a download task.
- - parameter dataTask: The data task that was replaced by a download task.
- - parameter downloadTask: The new download task that replaced the data task.
- */
- public func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask)
- {
- if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask {
- dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask)
- } else {
- let downloadDelegate = Request.DownloadTaskDelegate(task: downloadTask)
- self[downloadTask] = downloadDelegate
- }
- }
-
- /**
- Tells the delegate that the data task has received some of the expected data.
-
- - parameter session: The session containing the data task that provided data.
- - parameter dataTask: The data task that provided data.
- - parameter data: A data object containing the transferred data.
- */
- public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
- if let dataTaskDidReceiveData = dataTaskDidReceiveData {
- dataTaskDidReceiveData(session, dataTask, data)
- } else if let delegate = self[dataTask] as? Request.DataTaskDelegate {
- delegate.URLSession(session, dataTask: dataTask, didReceiveData: data)
- }
- }
-
- /**
- Asks the delegate whether the data (or upload) task should store the response in the cache.
-
- - parameter session: The session containing the data (or upload) task.
- - parameter dataTask: The data (or upload) task.
- - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current
- caching policy and the values of certain received headers, such as the Pragma
- and Cache-Control headers.
- - parameter completionHandler: A block that your handler must call, providing either the original proposed
- response, a modified version of that response, or NULL to prevent caching the
- response. If your delegate implements this method, it must call this completion
- handler; otherwise, your app leaks memory.
- */
- public func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- willCacheResponse proposedResponse: NSCachedURLResponse,
- completionHandler: NSCachedURLResponse? -> Void)
- {
- guard dataTaskWillCacheResponseWithCompletion == nil else {
- dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler)
- return
- }
-
- if let dataTaskWillCacheResponse = dataTaskWillCacheResponse {
- completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse))
- } else if let delegate = self[dataTask] as? Request.DataTaskDelegate {
- delegate.URLSession(
- session,
- dataTask: dataTask,
- willCacheResponse: proposedResponse,
- completionHandler: completionHandler
- )
- } else {
- completionHandler(proposedResponse)
- }
- }
-
- // MARK: - NSURLSessionDownloadDelegate
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didFinishDownloadingToURL:`.
- public var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`.
- public var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)?
-
- /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`.
- public var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)?
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that a download task has finished downloading.
-
- - parameter session: The session containing the download task that finished.
- - parameter downloadTask: The download task that finished.
- - parameter location: A file URL for the temporary file. Because the file is temporary, you must either
- open the file for reading or move it to a permanent location in your app’s sandbox
- container directory before returning from this delegate method.
- */
- public func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didFinishDownloadingToURL location: NSURL)
- {
- if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL {
- downloadTaskDidFinishDownloadingToURL(session, downloadTask, location)
- } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate {
- delegate.URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location)
- }
- }
-
- /**
- Periodically informs the delegate about the download’s progress.
-
- - parameter session: The session containing the download task.
- - parameter downloadTask: The download task.
- - parameter bytesWritten: The number of bytes transferred since the last time this delegate
- method was called.
- - parameter totalBytesWritten: The total number of bytes transferred so far.
- - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length
- header. If this header was not provided, the value is
- `NSURLSessionTransferSizeUnknown`.
- */
- public func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didWriteData bytesWritten: Int64,
- totalBytesWritten: Int64,
- totalBytesExpectedToWrite: Int64)
- {
- if let downloadTaskDidWriteData = downloadTaskDidWriteData {
- downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite)
- } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate {
- delegate.URLSession(
- session,
- downloadTask: downloadTask,
- didWriteData: bytesWritten,
- totalBytesWritten: totalBytesWritten,
- totalBytesExpectedToWrite: totalBytesExpectedToWrite
- )
- }
- }
-
- /**
- Tells the delegate that the download task has resumed downloading.
-
- - parameter session: The session containing the download task that finished.
- - parameter downloadTask: The download task that resumed. See explanation in the discussion.
- - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the
- existing content, then this value is zero. Otherwise, this value is an
- integer representing the number of bytes on disk that do not need to be
- retrieved again.
- - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header.
- If this header was not provided, the value is NSURLSessionTransferSizeUnknown.
- */
- public func URLSession(
- session: NSURLSession,
- downloadTask: NSURLSessionDownloadTask,
- didResumeAtOffset fileOffset: Int64,
- expectedTotalBytes: Int64)
- {
- if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset {
- downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes)
- } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate {
- delegate.URLSession(
- session,
- downloadTask: downloadTask,
- didResumeAtOffset: fileOffset,
- expectedTotalBytes: expectedTotalBytes
- )
- }
- }
-
- // MARK: - NSURLSessionStreamDelegate
-
- var _streamTaskReadClosed: Any?
- var _streamTaskWriteClosed: Any?
- var _streamTaskBetterRouteDiscovered: Any?
- var _streamTaskDidBecomeInputStream: Any?
-
- // MARK: - NSObject
-
- public override func respondsToSelector(selector: Selector) -> Bool {
- #if !os(OSX)
- if selector == #selector(NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession(_:)) {
- return sessionDidFinishEventsForBackgroundURLSession != nil
- }
- #endif
-
- switch selector {
- case #selector(NSURLSessionDelegate.URLSession(_:didBecomeInvalidWithError:)):
- return sessionDidBecomeInvalidWithError != nil
- case #selector(NSURLSessionDelegate.URLSession(_:didReceiveChallenge:completionHandler:)):
- return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil)
- case #selector(NSURLSessionTaskDelegate.URLSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)):
- return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil)
- case #selector(NSURLSessionDataDelegate.URLSession(_:dataTask:didReceiveResponse:completionHandler:)):
- return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil)
- default:
- return self.dynamicType.instancesRespondToSelector(selector)
- }
- }
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift
deleted file mode 100644
index b4087eca830d..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift
+++ /dev/null
@@ -1,659 +0,0 @@
-//
-// MultipartFormData.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-#if os(iOS) || os(watchOS) || os(tvOS)
-import MobileCoreServices
-#elseif os(OSX)
-import CoreServices
-#endif
-
-/**
- Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode
- multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead
- to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the
- data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for
- larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset.
-
- For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well
- and the w3 form documentation.
-
- - https://www.ietf.org/rfc/rfc2388.txt
- - https://www.ietf.org/rfc/rfc2045.txt
- - https://www.w3.org/TR/html401/interact/forms.html#h-17.13
-*/
-public class MultipartFormData {
-
- // MARK: - Helper Types
-
- struct EncodingCharacters {
- static let CRLF = "\r\n"
- }
-
- struct BoundaryGenerator {
- enum BoundaryType {
- case Initial, Encapsulated, Final
- }
-
- static func randomBoundary() -> String {
- return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random())
- }
-
- static func boundaryData(boundaryType boundaryType: BoundaryType, boundary: String) -> NSData {
- let boundaryText: String
-
- switch boundaryType {
- case .Initial:
- boundaryText = "--\(boundary)\(EncodingCharacters.CRLF)"
- case .Encapsulated:
- boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)\(EncodingCharacters.CRLF)"
- case .Final:
- boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)--\(EncodingCharacters.CRLF)"
- }
-
- return boundaryText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
- }
- }
-
- class BodyPart {
- let headers: [String: String]
- let bodyStream: NSInputStream
- let bodyContentLength: UInt64
- var hasInitialBoundary = false
- var hasFinalBoundary = false
-
- init(headers: [String: String], bodyStream: NSInputStream, bodyContentLength: UInt64) {
- self.headers = headers
- self.bodyStream = bodyStream
- self.bodyContentLength = bodyContentLength
- }
- }
-
- // MARK: - Properties
-
- /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`.
- public var contentType: String { return "multipart/form-data; boundary=\(boundary)" }
-
- /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries.
- public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } }
-
- /// The boundary used to separate the body parts in the encoded form data.
- public let boundary: String
-
- private var bodyParts: [BodyPart]
- private var bodyPartError: NSError?
- private let streamBufferSize: Int
-
- // MARK: - Lifecycle
-
- /**
- Creates a multipart form data object.
-
- - returns: The multipart form data object.
- */
- public init() {
- self.boundary = BoundaryGenerator.randomBoundary()
- self.bodyParts = []
-
- /**
- * The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more
- * information, please refer to the following article:
- * - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html
- */
-
- self.streamBufferSize = 1024
- }
-
- // MARK: - Body Parts
-
- /**
- Creates a body part from the data and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}` (HTTP Header)
- - Encoded data
- - Multipart form boundary
-
- - parameter data: The data to encode into the multipart form data.
- - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header.
- */
- public func appendBodyPart(data data: NSData, name: String) {
- let headers = contentHeaders(name: name)
- let stream = NSInputStream(data: data)
- let length = UInt64(data.length)
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the data and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}` (HTTP Header)
- - `Content-Type: #{generated mimeType}` (HTTP Header)
- - Encoded data
- - Multipart form boundary
-
- - parameter data: The data to encode into the multipart form data.
- - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(data data: NSData, name: String, mimeType: String) {
- let headers = contentHeaders(name: name, mimeType: mimeType)
- let stream = NSInputStream(data: data)
- let length = UInt64(data.length)
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the data and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header)
- - `Content-Type: #{mimeType}` (HTTP Header)
- - Encoded file data
- - Multipart form boundary
-
- - parameter data: The data to encode into the multipart form data.
- - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header.
- - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(data data: NSData, name: String, fileName: String, mimeType: String) {
- let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType)
- let stream = NSInputStream(data: data)
- let length = UInt64(data.length)
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the file and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header)
- - `Content-Type: #{generated mimeType}` (HTTP Header)
- - Encoded file data
- - Multipart form boundary
-
- The filename in the `Content-Disposition` HTTP header is generated from the last path component of the
- `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the
- system associated MIME type.
-
- - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data.
- - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header.
- */
- public func appendBodyPart(fileURL fileURL: NSURL, name: String) {
- if let
- fileName = fileURL.lastPathComponent,
- pathExtension = fileURL.pathExtension
- {
- let mimeType = mimeTypeForPathExtension(pathExtension)
- appendBodyPart(fileURL: fileURL, name: name, fileName: fileName, mimeType: mimeType)
- } else {
- let failureReason = "Failed to extract the fileName of the provided URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- }
- }
-
- /**
- Creates a body part from the file and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header)
- - Content-Type: #{mimeType} (HTTP Header)
- - Encoded file data
- - Multipart form boundary
-
- - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data.
- - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header.
- - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(fileURL fileURL: NSURL, name: String, fileName: String, mimeType: String) {
- let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType)
-
- //============================================================
- // Check 1 - is file URL?
- //============================================================
-
- guard fileURL.fileURL else {
- let failureReason = "The file URL does not point to a file URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- return
- }
-
- //============================================================
- // Check 2 - is file URL reachable?
- //============================================================
-
- var isReachable = true
-
- if #available(OSX 10.10, *) {
- isReachable = fileURL.checkPromisedItemIsReachableAndReturnError(nil)
- }
-
- guard isReachable else {
- setBodyPartError(code: NSURLErrorBadURL, failureReason: "The file URL is not reachable: \(fileURL)")
- return
- }
-
- //============================================================
- // Check 3 - is file URL a directory?
- //============================================================
-
- var isDirectory: ObjCBool = false
-
- guard let
- path = fileURL.path
- where NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDirectory) && !isDirectory else
- {
- let failureReason = "The file URL is a directory, not a file: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- return
- }
-
- //============================================================
- // Check 4 - can the file size be extracted?
- //============================================================
-
- var bodyContentLength: UInt64?
-
- do {
- if let
- path = fileURL.path,
- fileSize = try NSFileManager.defaultManager().attributesOfItemAtPath(path)[NSFileSize] as? NSNumber
- {
- bodyContentLength = fileSize.unsignedLongLongValue
- }
- } catch {
- // No-op
- }
-
- guard let length = bodyContentLength else {
- let failureReason = "Could not fetch attributes from the file URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason)
- return
- }
-
- //============================================================
- // Check 5 - can a stream be created from file URL?
- //============================================================
-
- guard let stream = NSInputStream(URL: fileURL) else {
- let failureReason = "Failed to create an input stream from the file URL: \(fileURL)"
- setBodyPartError(code: NSURLErrorCannotOpenFile, failureReason: failureReason)
- return
- }
-
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part from the stream and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header)
- - `Content-Type: #{mimeType}` (HTTP Header)
- - Encoded stream data
- - Multipart form boundary
-
- - parameter stream: The input stream to encode in the multipart form data.
- - parameter length: The content length of the stream.
- - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header.
- - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header.
- - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header.
- */
- public func appendBodyPart(
- stream stream: NSInputStream,
- length: UInt64,
- name: String,
- fileName: String,
- mimeType: String)
- {
- let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType)
- appendBodyPart(stream: stream, length: length, headers: headers)
- }
-
- /**
- Creates a body part with the headers, stream and length and appends it to the multipart form data object.
-
- The body part data will be encoded using the following format:
-
- - HTTP headers
- - Encoded stream data
- - Multipart form boundary
-
- - parameter stream: The input stream to encode in the multipart form data.
- - parameter length: The content length of the stream.
- - parameter headers: The HTTP headers for the body part.
- */
- public func appendBodyPart(stream stream: NSInputStream, length: UInt64, headers: [String: String]) {
- let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length)
- bodyParts.append(bodyPart)
- }
-
- // MARK: - Data Encoding
-
- /**
- Encodes all the appended body parts into a single `NSData` object.
-
- It is important to note that this method will load all the appended body parts into memory all at the same
- time. This method should only be used when the encoded data will have a small memory footprint. For large data
- cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method.
-
- - throws: An `NSError` if encoding encounters an error.
-
- - returns: The encoded `NSData` if encoding is successful.
- */
- public func encode() throws -> NSData {
- if let bodyPartError = bodyPartError {
- throw bodyPartError
- }
-
- let encoded = NSMutableData()
-
- bodyParts.first?.hasInitialBoundary = true
- bodyParts.last?.hasFinalBoundary = true
-
- for bodyPart in bodyParts {
- let encodedData = try encodeBodyPart(bodyPart)
- encoded.appendData(encodedData)
- }
-
- return encoded
- }
-
- /**
- Writes the appended body parts into the given file URL.
-
- This process is facilitated by reading and writing with input and output streams, respectively. Thus,
- this approach is very memory efficient and should be used for large body part data.
-
- - parameter fileURL: The file URL to write the multipart form data into.
-
- - throws: An `NSError` if encoding encounters an error.
- */
- public func writeEncodedDataToDisk(fileURL: NSURL) throws {
- if let bodyPartError = bodyPartError {
- throw bodyPartError
- }
-
- if let path = fileURL.path where NSFileManager.defaultManager().fileExistsAtPath(path) {
- let failureReason = "A file already exists at the given file URL: \(fileURL)"
- throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorBadURL, failureReason: failureReason)
- } else if !fileURL.fileURL {
- let failureReason = "The URL does not point to a valid file: \(fileURL)"
- throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorBadURL, failureReason: failureReason)
- }
-
- let outputStream: NSOutputStream
-
- if let possibleOutputStream = NSOutputStream(URL: fileURL, append: false) {
- outputStream = possibleOutputStream
- } else {
- let failureReason = "Failed to create an output stream with the given URL: \(fileURL)"
- throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorCannotOpenFile, failureReason: failureReason)
- }
-
- outputStream.open()
-
- self.bodyParts.first?.hasInitialBoundary = true
- self.bodyParts.last?.hasFinalBoundary = true
-
- for bodyPart in self.bodyParts {
- try writeBodyPart(bodyPart, toOutputStream: outputStream)
- }
-
- outputStream.close()
- }
-
- // MARK: - Private - Body Part Encoding
-
- private func encodeBodyPart(bodyPart: BodyPart) throws -> NSData {
- let encoded = NSMutableData()
-
- let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData()
- encoded.appendData(initialData)
-
- let headerData = encodeHeaderDataForBodyPart(bodyPart)
- encoded.appendData(headerData)
-
- let bodyStreamData = try encodeBodyStreamDataForBodyPart(bodyPart)
- encoded.appendData(bodyStreamData)
-
- if bodyPart.hasFinalBoundary {
- encoded.appendData(finalBoundaryData())
- }
-
- return encoded
- }
-
- private func encodeHeaderDataForBodyPart(bodyPart: BodyPart) -> NSData {
- var headerText = ""
-
- for (key, value) in bodyPart.headers {
- headerText += "\(key): \(value)\(EncodingCharacters.CRLF)"
- }
- headerText += EncodingCharacters.CRLF
-
- return headerText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
- }
-
- private func encodeBodyStreamDataForBodyPart(bodyPart: BodyPart) throws -> NSData {
- let inputStream = bodyPart.bodyStream
- inputStream.open()
-
- var error: NSError?
- let encoded = NSMutableData()
-
- while inputStream.hasBytesAvailable {
- var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0)
- let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize)
-
- if inputStream.streamError != nil {
- error = inputStream.streamError
- break
- }
-
- if bytesRead > 0 {
- encoded.appendBytes(buffer, length: bytesRead)
- } else if bytesRead < 0 {
- let failureReason = "Failed to read from input stream: \(inputStream)"
- error = Error.error(domain: NSURLErrorDomain, code: .InputStreamReadFailed, failureReason: failureReason)
- break
- } else {
- break
- }
- }
-
- inputStream.close()
-
- if let error = error {
- throw error
- }
-
- return encoded
- }
-
- // MARK: - Private - Writing Body Part to Output Stream
-
- private func writeBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws {
- try writeInitialBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream)
- try writeHeaderDataForBodyPart(bodyPart, toOutputStream: outputStream)
- try writeBodyStreamForBodyPart(bodyPart, toOutputStream: outputStream)
- try writeFinalBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream)
- }
-
- private func writeInitialBoundaryDataForBodyPart(
- bodyPart: BodyPart,
- toOutputStream outputStream: NSOutputStream)
- throws
- {
- let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData()
- return try writeData(initialData, toOutputStream: outputStream)
- }
-
- private func writeHeaderDataForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws {
- let headerData = encodeHeaderDataForBodyPart(bodyPart)
- return try writeData(headerData, toOutputStream: outputStream)
- }
-
- private func writeBodyStreamForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws {
- let inputStream = bodyPart.bodyStream
- inputStream.open()
-
- while inputStream.hasBytesAvailable {
- var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0)
- let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize)
-
- if let streamError = inputStream.streamError {
- throw streamError
- }
-
- if bytesRead > 0 {
- if buffer.count != bytesRead {
- buffer = Array(buffer[0.. 0 {
- if outputStream.hasSpaceAvailable {
- let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite)
-
- if let streamError = outputStream.streamError {
- throw streamError
- }
-
- if bytesWritten < 0 {
- let failureReason = "Failed to write to output stream: \(outputStream)"
- throw Error.error(domain: NSURLErrorDomain, code: .OutputStreamWriteFailed, failureReason: failureReason)
- }
-
- bytesToWrite -= bytesWritten
-
- if bytesToWrite > 0 {
- buffer = Array(buffer[bytesWritten.. String {
- if let
- id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension, nil)?.takeRetainedValue(),
- contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue()
- {
- return contentType as String
- }
-
- return "application/octet-stream"
- }
-
- // MARK: - Private - Content Headers
-
- private func contentHeaders(name name: String) -> [String: String] {
- return ["Content-Disposition": "form-data; name=\"\(name)\""]
- }
-
- private func contentHeaders(name name: String, mimeType: String) -> [String: String] {
- return [
- "Content-Disposition": "form-data; name=\"\(name)\"",
- "Content-Type": "\(mimeType)"
- ]
- }
-
- private func contentHeaders(name name: String, fileName: String, mimeType: String) -> [String: String] {
- return [
- "Content-Disposition": "form-data; name=\"\(name)\"; filename=\"\(fileName)\"",
- "Content-Type": "\(mimeType)"
- ]
- }
-
- // MARK: - Private - Boundary Encoding
-
- private func initialBoundaryData() -> NSData {
- return BoundaryGenerator.boundaryData(boundaryType: .Initial, boundary: boundary)
- }
-
- private func encapsulatedBoundaryData() -> NSData {
- return BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundary: boundary)
- }
-
- private func finalBoundaryData() -> NSData {
- return BoundaryGenerator.boundaryData(boundaryType: .Final, boundary: boundary)
- }
-
- // MARK: - Private - Errors
-
- private func setBodyPartError(code code: Int, failureReason: String) {
- guard bodyPartError == nil else { return }
- bodyPartError = Error.error(domain: NSURLErrorDomain, code: code, failureReason: failureReason)
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift
deleted file mode 100644
index 1e5c7b030d3d..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// NetworkReachabilityManager.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#if !os(watchOS)
-
-import Foundation
-import SystemConfiguration
-
-/**
- The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and
- WiFi network interfaces.
-
- Reachability can be used to determine background information about why a network operation failed, or to retry
- network requests when a connection is established. It should not be used to prevent a user from initiating a network
- request, as it's possible that an initial request may be required to establish reachability.
-*/
-public class NetworkReachabilityManager {
- /**
- Defines the various states of network reachability.
-
- - Unknown: It is unknown whether the network is reachable.
- - NotReachable: The network is not reachable.
- - ReachableOnWWAN: The network is reachable over the WWAN connection.
- - ReachableOnWiFi: The network is reachable over the WiFi connection.
- */
- public enum NetworkReachabilityStatus {
- case Unknown
- case NotReachable
- case Reachable(ConnectionType)
- }
-
- /**
- Defines the various connection types detected by reachability flags.
-
- - EthernetOrWiFi: The connection type is either over Ethernet or WiFi.
- - WWAN: The connection type is a WWAN connection.
- */
- public enum ConnectionType {
- case EthernetOrWiFi
- case WWAN
- }
-
- /// A closure executed when the network reachability status changes. The closure takes a single argument: the
- /// network reachability status.
- public typealias Listener = NetworkReachabilityStatus -> Void
-
- // MARK: - Properties
-
- /// Whether the network is currently reachable.
- public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi }
-
- /// Whether the network is currently reachable over the WWAN interface.
- public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .Reachable(.WWAN) }
-
- /// Whether the network is currently reachable over Ethernet or WiFi interface.
- public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .Reachable(.EthernetOrWiFi) }
-
- /// The current network reachability status.
- public var networkReachabilityStatus: NetworkReachabilityStatus {
- guard let flags = self.flags else { return .Unknown }
- return networkReachabilityStatusForFlags(flags)
- }
-
- /// The dispatch queue to execute the `listener` closure on.
- public var listenerQueue: dispatch_queue_t = dispatch_get_main_queue()
-
- /// A closure executed when the network reachability status changes.
- public var listener: Listener?
-
- private var flags: SCNetworkReachabilityFlags? {
- var flags = SCNetworkReachabilityFlags()
-
- if SCNetworkReachabilityGetFlags(reachability, &flags) {
- return flags
- }
-
- return nil
- }
-
- private let reachability: SCNetworkReachability
- private var previousFlags: SCNetworkReachabilityFlags
-
- // MARK: - Initialization
-
- /**
- Creates a `NetworkReachabilityManager` instance with the specified host.
-
- - parameter host: The host used to evaluate network reachability.
-
- - returns: The new `NetworkReachabilityManager` instance.
- */
- public convenience init?(host: String) {
- guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil }
- self.init(reachability: reachability)
- }
-
- /**
- Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0.
-
- Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing
- status of the device, both IPv4 and IPv6.
-
- - returns: The new `NetworkReachabilityManager` instance.
- */
- public convenience init?() {
- var address = sockaddr_in()
- address.sin_len = UInt8(sizeofValue(address))
- address.sin_family = sa_family_t(AF_INET)
-
- guard let reachability = withUnsafePointer(&address, {
- SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0))
- }) else { return nil }
-
- self.init(reachability: reachability)
- }
-
- private init(reachability: SCNetworkReachability) {
- self.reachability = reachability
- self.previousFlags = SCNetworkReachabilityFlags()
- }
-
- deinit {
- stopListening()
- }
-
- // MARK: - Listening
-
- /**
- Starts listening for changes in network reachability status.
-
- - returns: `true` if listening was started successfully, `false` otherwise.
- */
- public func startListening() -> Bool {
- var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil)
- context.info = UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque())
-
- let callbackEnabled = SCNetworkReachabilitySetCallback(
- reachability,
- { (_, flags, info) in
- let reachability = Unmanaged.fromOpaque(COpaquePointer(info)).takeUnretainedValue()
- reachability.notifyListener(flags)
- },
- &context
- )
-
- let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue)
-
- dispatch_async(listenerQueue) {
- self.previousFlags = SCNetworkReachabilityFlags()
- self.notifyListener(self.flags ?? SCNetworkReachabilityFlags())
- }
-
- return callbackEnabled && queueEnabled
- }
-
- /**
- Stops listening for changes in network reachability status.
- */
- public func stopListening() {
- SCNetworkReachabilitySetCallback(reachability, nil, nil)
- SCNetworkReachabilitySetDispatchQueue(reachability, nil)
- }
-
- // MARK: - Internal - Listener Notification
-
- func notifyListener(flags: SCNetworkReachabilityFlags) {
- guard previousFlags != flags else { return }
- previousFlags = flags
-
- listener?(networkReachabilityStatusForFlags(flags))
- }
-
- // MARK: - Internal - Network Reachability Status
-
- func networkReachabilityStatusForFlags(flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus {
- guard flags.contains(.Reachable) else { return .NotReachable }
-
- var networkStatus: NetworkReachabilityStatus = .NotReachable
-
- if !flags.contains(.ConnectionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) }
-
- if flags.contains(.ConnectionOnDemand) || flags.contains(.ConnectionOnTraffic) {
- if !flags.contains(.InterventionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) }
- }
-
- #if os(iOS)
- if flags.contains(.IsWWAN) { networkStatus = .Reachable(.WWAN) }
- #endif
-
- return networkStatus
- }
-}
-
-// MARK: -
-
-extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {}
-
-/**
- Returns whether the two network reachability status values are equal.
-
- - parameter lhs: The left-hand side value to compare.
- - parameter rhs: The right-hand side value to compare.
-
- - returns: `true` if the two values are equal, `false` otherwise.
-*/
-public func ==(
- lhs: NetworkReachabilityManager.NetworkReachabilityStatus,
- rhs: NetworkReachabilityManager.NetworkReachabilityStatus)
- -> Bool
-{
- switch (lhs, rhs) {
- case (.Unknown, .Unknown):
- return true
- case (.NotReachable, .NotReachable):
- return true
- case let (.Reachable(lhsConnectionType), .Reachable(rhsConnectionType)):
- return lhsConnectionType == rhsConnectionType
- default:
- return false
- }
-}
-
-#endif
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift
deleted file mode 100644
index cece87a170df..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Notifications.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Contains all the `NSNotification` names posted by Alamofire with descriptions of each notification's payload.
-public struct Notifications {
- /// Used as a namespace for all `NSURLSessionTask` related notifications.
- public struct Task {
- /// Notification posted when an `NSURLSessionTask` is resumed. The notification `object` contains the resumed
- /// `NSURLSessionTask`.
- public static let DidResume = "com.alamofire.notifications.task.didResume"
-
- /// Notification posted when an `NSURLSessionTask` is suspended. The notification `object` contains the
- /// suspended `NSURLSessionTask`.
- public static let DidSuspend = "com.alamofire.notifications.task.didSuspend"
-
- /// Notification posted when an `NSURLSessionTask` is cancelled. The notification `object` contains the
- /// cancelled `NSURLSessionTask`.
- public static let DidCancel = "com.alamofire.notifications.task.didCancel"
-
- /// Notification posted when an `NSURLSessionTask` is completed. The notification `object` contains the
- /// completed `NSURLSessionTask`.
- public static let DidComplete = "com.alamofire.notifications.task.didComplete"
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift
deleted file mode 100644
index 32e63d9b7be0..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift
+++ /dev/null
@@ -1,261 +0,0 @@
-//
-// ParameterEncoding.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/**
- HTTP method definitions.
-
- See https://tools.ietf.org/html/rfc7231#section-4.3
-*/
-public enum Method: String {
- case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT
-}
-
-// MARK: ParameterEncoding
-
-/**
- Used to specify the way in which a set of parameters are applied to a URL request.
-
- - `URL`: Creates a query string to be set as or appended to any existing URL query for `GET`, `HEAD`,
- and `DELETE` requests, or set as the body for requests with any other HTTP method. The
- `Content-Type` HTTP header field of an encoded request with HTTP body is set to
- `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification
- for how to encode collection types, the convention of appending `[]` to the key for array
- values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested
- dictionary values (`foo[bar]=baz`).
-
- - `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same
- implementation as the `.URL` case, but always applies the encoded result to the URL.
-
- - `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is
- set as the body of the request. The `Content-Type` HTTP header field of an encoded request is
- set to `application/json`.
-
- - `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object,
- according to the associated format and write options values, which is set as the body of the
- request. The `Content-Type` HTTP header field of an encoded request is set to
- `application/x-plist`.
-
- - `Custom`: Uses the associated closure value to construct a new request given an existing request and
- parameters.
-*/
-public enum ParameterEncoding {
- case URL
- case URLEncodedInURL
- case JSON
- case PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions)
- case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?))
-
- /**
- 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.
-
- - returns: A tuple containing the constructed request and the error that occurred during parameter encoding,
- if any.
- */
- public func encode(
- URLRequest: URLRequestConvertible,
- parameters: [String: AnyObject]?)
- -> (NSMutableURLRequest, NSError?)
- {
- var mutableURLRequest = URLRequest.URLRequest
-
- guard let parameters = parameters else { return (mutableURLRequest, nil) }
-
- var encodingError: NSError? = nil
-
- switch self {
- case .URL, .URLEncodedInURL:
- func query(parameters: [String: AnyObject]) -> String {
- var components: [(String, String)] = []
-
- for key in parameters.keys.sort(<) {
- let value = parameters[key]!
- components += queryComponents(key, value)
- }
-
- return (components.map { "\($0)=\($1)" } as [String]).joinWithSeparator("&")
- }
-
- func encodesParametersInURL(method: Method) -> Bool {
- switch self {
- case .URLEncodedInURL:
- return true
- default:
- break
- }
-
- switch method {
- case .GET, .HEAD, .DELETE:
- return true
- default:
- return false
- }
- }
-
- if let method = Method(rawValue: mutableURLRequest.HTTPMethod) where encodesParametersInURL(method) {
- if let
- URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false)
- where !parameters.isEmpty
- {
- let percentEncodedQuery = (URLComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters)
- URLComponents.percentEncodedQuery = percentEncodedQuery
- mutableURLRequest.URL = URLComponents.URL
- }
- } else {
- if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil {
- mutableURLRequest.setValue(
- "application/x-www-form-urlencoded; charset=utf-8",
- forHTTPHeaderField: "Content-Type"
- )
- }
-
- mutableURLRequest.HTTPBody = query(parameters).dataUsingEncoding(
- NSUTF8StringEncoding,
- allowLossyConversion: false
- )
- }
- case .JSON:
- do {
- let options = NSJSONWritingOptions()
- let data = try NSJSONSerialization.dataWithJSONObject(parameters, options: options)
-
- if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil {
- mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
- }
-
- mutableURLRequest.HTTPBody = data
- } catch {
- encodingError = error as NSError
- }
- case .PropertyList(let format, let options):
- do {
- let data = try NSPropertyListSerialization.dataWithPropertyList(
- parameters,
- format: format,
- options: options
- )
-
- if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil {
- mutableURLRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type")
- }
-
- mutableURLRequest.HTTPBody = data
- } catch {
- encodingError = error as NSError
- }
- case .Custom(let closure):
- (mutableURLRequest, encodingError) = closure(mutableURLRequest, parameters)
- }
-
- return (mutableURLRequest, encodingError)
- }
-
- /**
- Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion.
-
- - parameter key: The key of the query component.
- - parameter value: The value of the query component.
-
- - returns: The percent-escaped, URL encoded query string components.
- */
- public func queryComponents(key: String, _ value: AnyObject) -> [(String, String)] {
- var components: [(String, String)] = []
-
- if let dictionary = value as? [String: AnyObject] {
- for (nestedKey, value) in dictionary {
- components += queryComponents("\(key)[\(nestedKey)]", value)
- }
- } else if let array = value as? [AnyObject] {
- for value in array {
- components += queryComponents("\(key)[]", value)
- }
- } else {
- components.append((escape(key), escape("\(value)")))
- }
-
- return components
- }
-
- /**
- Returns a percent-escaped string following RFC 3986 for a query string key or value.
-
- RFC 3986 states that the following characters are "reserved" characters.
-
- - General Delimiters: ":", "#", "[", "]", "@", "?", "/"
- - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="
-
- In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow
- query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/"
- should be percent-escaped in the query string.
-
- - parameter string: The string to be percent-escaped.
-
- - returns: The percent-escaped string.
- */
- public func escape(string: String) -> String {
- let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4
- let subDelimitersToEncode = "!$&'()*+,;="
-
- let allowedCharacterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet
- allowedCharacterSet.removeCharactersInString(generalDelimitersToEncode + subDelimitersToEncode)
-
- var escaped = ""
-
- //==========================================================================================================
- //
- // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few
- // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no
- // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more
- // info, please refer to:
- //
- // - https://github.com/Alamofire/Alamofire/issues/206
- //
- //==========================================================================================================
-
- if #available(iOS 8.3, OSX 10.10, *) {
- escaped = string.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? string
- } else {
- let batchSize = 50
- var index = string.startIndex
-
- while index != string.endIndex {
- let startIndex = index
- let endIndex = index.advancedBy(batchSize, limit: string.endIndex)
- let range = startIndex.. Self
- {
- let credential = NSURLCredential(user: user, password: password, persistence: persistence)
-
- return authenticate(usingCredential: credential)
- }
-
- /**
- Associates a specified credential with the request.
-
- - parameter credential: The credential.
-
- - returns: The request.
- */
- public func authenticate(usingCredential credential: NSURLCredential) -> Self {
- delegate.credential = credential
-
- return self
- }
-
- /**
- Returns a base64 encoded basic authentication credential as an authorization header dictionary.
-
- - parameter user: The user.
- - parameter password: The password.
-
- - returns: A dictionary with Authorization key and credential value or empty dictionary if encoding fails.
- */
- public static func authorizationHeader(user user: String, password: String) -> [String: String] {
- guard let data = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding) else { return [:] }
-
- let credential = data.base64EncodedStringWithOptions([])
-
- return ["Authorization": "Basic \(credential)"]
- }
-
- // MARK: - Progress
-
- /**
- Sets a closure to be called periodically during the lifecycle of the request as data is written to or read
- from the server.
-
- - For uploads, the progress closure returns the bytes written, total bytes written, and total bytes expected
- to write.
- - For downloads and data tasks, the progress closure returns the bytes read, total bytes read, and total bytes
- expected to read.
-
- - parameter closure: The code to be executed periodically during the lifecycle of the request.
-
- - returns: The request.
- */
- public func progress(closure: ((Int64, Int64, Int64) -> Void)? = nil) -> Self {
- if let uploadDelegate = delegate as? UploadTaskDelegate {
- uploadDelegate.uploadProgress = closure
- } else if let dataDelegate = delegate as? DataTaskDelegate {
- dataDelegate.dataProgress = closure
- } else if let downloadDelegate = delegate as? DownloadTaskDelegate {
- downloadDelegate.downloadProgress = closure
- }
-
- return self
- }
-
- /**
- Sets a closure to be called periodically during the lifecycle of the request as data is read from the server.
-
- This closure returns the bytes most recently received from the server, not including data from previous calls.
- If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is
- also important to note that the `response` closure will be called with nil `responseData`.
-
- - parameter closure: The code to be executed periodically during the lifecycle of the request.
-
- - returns: The request.
- */
- public func stream(closure: (NSData -> Void)? = nil) -> Self {
- if let dataDelegate = delegate as? DataTaskDelegate {
- dataDelegate.dataStream = closure
- }
-
- return self
- }
-
- // MARK: - State
-
- /**
- Resumes the request.
- */
- public func resume() {
- if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() }
-
- task.resume()
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidResume, object: task)
- }
-
- /**
- Suspends the request.
- */
- public func suspend() {
- task.suspend()
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidSuspend, object: task)
- }
-
- /**
- Cancels the request.
- */
- public func cancel() {
- if let
- downloadDelegate = delegate as? DownloadTaskDelegate,
- downloadTask = downloadDelegate.downloadTask
- {
- downloadTask.cancelByProducingResumeData { data in
- downloadDelegate.resumeData = data
- }
- } else {
- task.cancel()
- }
-
- NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidCancel, object: task)
- }
-
- // MARK: - TaskDelegate
-
- /**
- The task delegate is responsible for handling all delegate callbacks for the underlying task as well as
- executing all operations attached to the serial operation queue upon task completion.
- */
- public class TaskDelegate: NSObject {
-
- /// The serial operation queue used to execute all operations after the task completes.
- public let queue: NSOperationQueue
-
- let task: NSURLSessionTask
- let progress: NSProgress
-
- var data: NSData? { return nil }
- var error: NSError?
-
- var initialResponseTime: CFAbsoluteTime?
- var credential: NSURLCredential?
-
- init(task: NSURLSessionTask) {
- self.task = task
- self.progress = NSProgress(totalUnitCount: 0)
- self.queue = {
- let operationQueue = NSOperationQueue()
- operationQueue.maxConcurrentOperationCount = 1
- operationQueue.suspended = true
-
- if #available(OSX 10.10, *) {
- operationQueue.qualityOfService = NSQualityOfService.Utility
- }
-
- return operationQueue
- }()
- }
-
- deinit {
- queue.cancelAllOperations()
- queue.suspended = false
- }
-
- // MARK: - NSURLSessionTaskDelegate
-
- // MARK: Override Closures
-
- var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)?
- var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))?
- var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)?
- var taskDidCompleteWithError: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- willPerformHTTPRedirection response: NSHTTPURLResponse,
- newRequest request: NSURLRequest,
- completionHandler: ((NSURLRequest?) -> Void))
- {
- var redirectRequest: NSURLRequest? = request
-
- if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection {
- redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request)
- }
-
- completionHandler(redirectRequest)
- }
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didReceiveChallenge challenge: NSURLAuthenticationChallenge,
- completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void))
- {
- var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling
- var credential: NSURLCredential?
-
- if let taskDidReceiveChallenge = taskDidReceiveChallenge {
- (disposition, credential) = taskDidReceiveChallenge(session, task, challenge)
- } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
- let host = challenge.protectionSpace.host
-
- if let
- serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host),
- serverTrust = challenge.protectionSpace.serverTrust
- {
- if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) {
- disposition = .UseCredential
- credential = NSURLCredential(forTrust: serverTrust)
- } else {
- disposition = .CancelAuthenticationChallenge
- }
- }
- } else {
- if challenge.previousFailureCount > 0 {
- disposition = .RejectProtectionSpace
- } else {
- credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
-
- if credential != nil {
- disposition = .UseCredential
- }
- }
- }
-
- completionHandler(disposition, credential)
- }
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- needNewBodyStream completionHandler: ((NSInputStream?) -> Void))
- {
- var bodyStream: NSInputStream?
-
- if let taskNeedNewBodyStream = taskNeedNewBodyStream {
- bodyStream = taskNeedNewBodyStream(session, task)
- }
-
- completionHandler(bodyStream)
- }
-
- func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
- if let taskDidCompleteWithError = taskDidCompleteWithError {
- taskDidCompleteWithError(session, task, error)
- } else {
- if let error = error {
- self.error = error
-
- if let
- downloadDelegate = self as? DownloadTaskDelegate,
- userInfo = error.userInfo as? [String: AnyObject],
- resumeData = userInfo[NSURLSessionDownloadTaskResumeData] as? NSData
- {
- downloadDelegate.resumeData = resumeData
- }
- }
-
- queue.suspended = false
- }
- }
- }
-
- // MARK: - DataTaskDelegate
-
- class DataTaskDelegate: TaskDelegate, NSURLSessionDataDelegate {
- var dataTask: NSURLSessionDataTask? { return task as? NSURLSessionDataTask }
-
- private var totalBytesReceived: Int64 = 0
- private var mutableData: NSMutableData
- override var data: NSData? {
- if dataStream != nil {
- return nil
- } else {
- return mutableData
- }
- }
-
- private var expectedContentLength: Int64?
- private var dataProgress: ((bytesReceived: Int64, totalBytesReceived: Int64, totalBytesExpectedToReceive: Int64) -> Void)?
- private var dataStream: ((data: NSData) -> Void)?
-
- override init(task: NSURLSessionTask) {
- mutableData = NSMutableData()
- super.init(task: task)
- }
-
- // MARK: - NSURLSessionDataDelegate
-
- // MARK: Override Closures
-
- var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)?
- var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)?
- var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)?
- var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didReceiveResponse response: NSURLResponse,
- completionHandler: (NSURLSessionResponseDisposition -> Void))
- {
- var disposition: NSURLSessionResponseDisposition = .Allow
-
- expectedContentLength = response.expectedContentLength
-
- if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse {
- disposition = dataTaskDidReceiveResponse(session, dataTask, response)
- }
-
- completionHandler(disposition)
- }
-
- func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask)
- {
- dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask)
- }
-
- func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
- if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
-
- if let dataTaskDidReceiveData = dataTaskDidReceiveData {
- dataTaskDidReceiveData(session, dataTask, data)
- } else {
- if let dataStream = dataStream {
- dataStream(data: data)
- } else {
- mutableData.appendData(data)
- }
-
- totalBytesReceived += data.length
- let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown
-
- progress.totalUnitCount = totalBytesExpected
- progress.completedUnitCount = totalBytesReceived
-
- dataProgress?(
- bytesReceived: Int64(data.length),
- totalBytesReceived: totalBytesReceived,
- totalBytesExpectedToReceive: totalBytesExpected
- )
- }
- }
-
- func URLSession(
- session: NSURLSession,
- dataTask: NSURLSessionDataTask,
- willCacheResponse proposedResponse: NSCachedURLResponse,
- completionHandler: ((NSCachedURLResponse?) -> Void))
- {
- var cachedResponse: NSCachedURLResponse? = proposedResponse
-
- if let dataTaskWillCacheResponse = dataTaskWillCacheResponse {
- cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse)
- }
-
- completionHandler(cachedResponse)
- }
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Request: CustomStringConvertible {
-
- /**
- The textual representation used when written to an output stream, which includes the HTTP method and URL, as
- well as the response status code if a response has been received.
- */
- public var description: String {
- var components: [String] = []
-
- if let HTTPMethod = request?.HTTPMethod {
- components.append(HTTPMethod)
- }
-
- if let URLString = request?.URL?.absoluteString {
- components.append(URLString)
- }
-
- if let response = response {
- components.append("(\(response.statusCode))")
- }
-
- return components.joinWithSeparator(" ")
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Request: CustomDebugStringConvertible {
- func cURLRepresentation() -> String {
- var components = ["$ curl -i"]
-
- guard let
- request = self.request,
- URL = request.URL,
- host = URL.host
- else {
- return "$ curl command could not be created"
- }
-
- if let HTTPMethod = request.HTTPMethod where HTTPMethod != "GET" {
- components.append("-X \(HTTPMethod)")
- }
-
- if let credentialStorage = self.session.configuration.URLCredentialStorage {
- let protectionSpace = NSURLProtectionSpace(
- host: host,
- port: URL.port?.integerValue ?? 0,
- protocol: URL.scheme,
- realm: host,
- authenticationMethod: NSURLAuthenticationMethodHTTPBasic
- )
-
- if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values {
- for credential in credentials {
- components.append("-u \(credential.user!):\(credential.password!)")
- }
- } else {
- if let credential = delegate.credential {
- components.append("-u \(credential.user!):\(credential.password!)")
- }
- }
- }
-
- if session.configuration.HTTPShouldSetCookies {
- if let
- cookieStorage = session.configuration.HTTPCookieStorage,
- cookies = cookieStorage.cookiesForURL(URL) where !cookies.isEmpty
- {
- let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value ?? String());" }
- components.append("-b \"\(string.substringToIndex(string.endIndex.predecessor()))\"")
- }
- }
-
- var headers: [NSObject: AnyObject] = [:]
-
- if let additionalHeaders = session.configuration.HTTPAdditionalHeaders {
- for (field, value) in additionalHeaders where field != "Cookie" {
- headers[field] = value
- }
- }
-
- if let headerFields = request.allHTTPHeaderFields {
- for (field, value) in headerFields where field != "Cookie" {
- headers[field] = value
- }
- }
-
- for (field, value) in headers {
- components.append("-H \"\(field): \(value)\"")
- }
-
- if let
- HTTPBodyData = request.HTTPBody,
- HTTPBody = String(data: HTTPBodyData, encoding: NSUTF8StringEncoding)
- {
- var escapedBody = HTTPBody.stringByReplacingOccurrencesOfString("\\\"", withString: "\\\\\"")
- escapedBody = escapedBody.stringByReplacingOccurrencesOfString("\"", withString: "\\\"")
-
- components.append("-d \"\(escapedBody)\"")
- }
-
- components.append("\"\(URL.absoluteString)\"")
-
- return components.joinWithSeparator(" \\\n\t")
- }
-
- /// The textual representation used when written to an output stream, in the form of a cURL command.
- public var debugDescription: String {
- return cURLRepresentation()
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift
deleted file mode 100644
index dd700bb1c824..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// Response.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Used to store all response data returned from a completed `Request`.
-public struct Response {
- /// The URL request sent to the server.
- public let request: NSURLRequest?
-
- /// The server's response to the URL request.
- public let response: NSHTTPURLResponse?
-
- /// The data returned by the server.
- public let data: NSData?
-
- /// The result of response serialization.
- public let result: Result
-
- /// The timeline of the complete lifecycle of the `Request`.
- public let timeline: Timeline
-
- /**
- Initializes the `Response` instance with the specified URL request, URL response, server data and response
- serialization result.
-
- - parameter request: The URL request sent to the server.
- - parameter response: The server's response to the URL request.
- - parameter data: The data returned by the server.
- - parameter result: The result of response serialization.
- - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`.
-
- - returns: the new `Response` instance.
- */
- public init(
- request: NSURLRequest?,
- response: NSHTTPURLResponse?,
- data: NSData?,
- result: Result,
- timeline: Timeline = Timeline())
- {
- self.request = request
- self.response = response
- self.data = data
- self.result = result
- self.timeline = timeline
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Response: CustomStringConvertible {
- /// The textual representation used when written to an output stream, which includes whether the result was a
- /// success or failure.
- public var description: String {
- return result.debugDescription
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Response: CustomDebugStringConvertible {
- /// The debug textual representation used when written to an output stream, which includes the URL request, the URL
- /// response, the server data and the response serialization result.
- public var debugDescription: String {
- var output: [String] = []
-
- output.append(request != nil ? "[Request]: \(request!)" : "[Request]: nil")
- output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil")
- output.append("[Data]: \(data?.length ?? 0) bytes")
- output.append("[Result]: \(result.debugDescription)")
- output.append("[Timeline]: \(timeline.debugDescription)")
-
- return output.joinWithSeparator("\n")
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift
deleted file mode 100644
index 5b7b61f9002a..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift
+++ /dev/null
@@ -1,378 +0,0 @@
-//
-// ResponseSerialization.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-// MARK: ResponseSerializer
-
-/**
- The type in which all response serializers must conform to in order to serialize a response.
-*/
-public protocol ResponseSerializerType {
- /// The type of serialized object to be created by this `ResponseSerializerType`.
- associatedtype SerializedObject
-
- /// The type of error to be created by this `ResponseSerializer` if serialization fails.
- associatedtype ErrorObject: ErrorType
-
- /**
- A closure used by response handlers that takes a request, response, data and error and returns a result.
- */
- var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result { get }
-}
-
-// MARK: -
-
-/**
- A generic `ResponseSerializerType` used to serialize a request, response, and data into a serialized object.
-*/
-public struct ResponseSerializer: ResponseSerializerType {
- /// The type of serialized object to be created by this `ResponseSerializer`.
- public typealias SerializedObject = Value
-
- /// The type of error to be created by this `ResponseSerializer` if serialization fails.
- public typealias ErrorObject = Error
-
- /**
- A closure used by response handlers that takes a request, response, data and error and returns a result.
- */
- public var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result
-
- /**
- Initializes the `ResponseSerializer` instance with the given serialize response closure.
-
- - parameter serializeResponse: The closure used to serialize the response.
-
- - returns: The new generic response serializer instance.
- */
- public init(serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result) {
- self.serializeResponse = serializeResponse
- }
-}
-
-// MARK: - Default
-
-extension Request {
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter queue: The queue on which the completion handler is dispatched.
- - parameter completionHandler: The code to be executed once the request has finished.
-
- - returns: The request.
- */
- public func response(
- queue queue: dispatch_queue_t? = nil,
- completionHandler: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Void)
- -> Self
- {
- delegate.queue.addOperationWithBlock {
- dispatch_async(queue ?? dispatch_get_main_queue()) {
- completionHandler(self.request, self.response, self.delegate.data, self.delegate.error)
- }
- }
-
- return self
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter queue: The queue on which the completion handler is dispatched.
- - parameter responseSerializer: The response serializer responsible for serializing the request, response,
- and data.
- - parameter completionHandler: The code to be executed once the request has finished.
-
- - returns: The request.
- */
- public func response(
- queue queue: dispatch_queue_t? = nil,
- responseSerializer: T,
- completionHandler: Response -> Void)
- -> Self
- {
- delegate.queue.addOperationWithBlock {
- let result = responseSerializer.serializeResponse(
- self.request,
- self.response,
- self.delegate.data,
- self.delegate.error
- )
-
- let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent()
- let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime
-
- let timeline = Timeline(
- requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(),
- initialResponseTime: initialResponseTime,
- requestCompletedTime: requestCompletedTime,
- serializationCompletedTime: CFAbsoluteTimeGetCurrent()
- )
-
- let response = Response(
- request: self.request,
- response: self.response,
- data: self.delegate.data,
- result: result,
- timeline: timeline
- )
-
- dispatch_async(queue ?? dispatch_get_main_queue()) { completionHandler(response) }
- }
-
- return self
- }
-}
-
-// MARK: - Data
-
-extension Request {
-
- /**
- Creates a response serializer that returns the associated data as-is.
-
- - returns: A data response serializer.
- */
- public static func dataResponseSerializer() -> ResponseSerializer {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success(NSData()) }
-
- guard let validData = data else {
- let failureReason = "Data could not be serialized. Input data was nil."
- let error = Error.error(code: .DataSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- return .Success(validData)
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter completionHandler: The code to be executed once the request has finished.
-
- - returns: The request.
- */
- public func responseData(
- queue queue: dispatch_queue_t? = nil,
- completionHandler: Response -> Void)
- -> Self
- {
- return response(queue: queue, responseSerializer: Request.dataResponseSerializer(), completionHandler: completionHandler)
- }
-}
-
-// MARK: - String
-
-extension Request {
-
- /**
- Creates a response serializer that returns a string initialized from the response data with the specified
- string encoding.
-
- - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server
- response, falling back to the default HTTP default character set, ISO-8859-1.
-
- - returns: A string response serializer.
- */
- public static func stringResponseSerializer(
- encoding encoding: NSStringEncoding? = nil)
- -> ResponseSerializer
- {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success("") }
-
- guard let validData = data else {
- let failureReason = "String could not be serialized. Input data was nil."
- let error = Error.error(code: .StringSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- var convertedEncoding = encoding
-
- if let encodingName = response?.textEncodingName where convertedEncoding == nil {
- convertedEncoding = CFStringConvertEncodingToNSStringEncoding(
- CFStringConvertIANACharSetNameToEncoding(encodingName)
- )
- }
-
- let actualEncoding = convertedEncoding ?? NSISOLatin1StringEncoding
-
- if let string = String(data: validData, encoding: actualEncoding) {
- return .Success(string)
- } else {
- let failureReason = "String could not be serialized with encoding: \(actualEncoding)"
- let error = Error.error(code: .StringSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the
- server response, falling back to the default HTTP default character set,
- ISO-8859-1.
- - parameter completionHandler: A closure to be executed once the request has finished.
-
- - returns: The request.
- */
- public func responseString(
- queue queue: dispatch_queue_t? = nil,
- encoding: NSStringEncoding? = nil,
- completionHandler: Response -> Void)
- -> Self
- {
- return response(
- queue: queue,
- responseSerializer: Request.stringResponseSerializer(encoding: encoding),
- completionHandler: completionHandler
- )
- }
-}
-
-// MARK: - JSON
-
-extension Request {
-
- /**
- Creates a response serializer that returns a JSON object constructed from the response data using
- `NSJSONSerialization` with the specified reading options.
-
- - parameter options: The JSON serialization reading options. `.AllowFragments` by default.
-
- - returns: A JSON object response serializer.
- */
- public static func JSONResponseSerializer(
- options options: NSJSONReadingOptions = .AllowFragments)
- -> ResponseSerializer
- {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success(NSNull()) }
-
- guard let validData = data where validData.length > 0 else {
- let failureReason = "JSON could not be serialized. Input data was nil or zero length."
- let error = Error.error(code: .JSONSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- do {
- let JSON = try NSJSONSerialization.JSONObjectWithData(validData, options: options)
- return .Success(JSON)
- } catch {
- return .Failure(error as NSError)
- }
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter options: The JSON serialization reading options. `.AllowFragments` by default.
- - parameter completionHandler: A closure to be executed once the request has finished.
-
- - returns: The request.
- */
- public func responseJSON(
- queue queue: dispatch_queue_t? = nil,
- options: NSJSONReadingOptions = .AllowFragments,
- completionHandler: Response -> Void)
- -> Self
- {
- return response(
- queue: queue,
- responseSerializer: Request.JSONResponseSerializer(options: options),
- completionHandler: completionHandler
- )
- }
-}
-
-// MARK: - Property List
-
-extension Request {
-
- /**
- Creates a response serializer that returns an object constructed from the response data using
- `NSPropertyListSerialization` with the specified reading options.
-
- - parameter options: The property list reading options. `NSPropertyListReadOptions()` by default.
-
- - returns: A property list object response serializer.
- */
- public static func propertyListResponseSerializer(
- options options: NSPropertyListReadOptions = NSPropertyListReadOptions())
- -> ResponseSerializer
- {
- return ResponseSerializer { _, response, data, error in
- guard error == nil else { return .Failure(error!) }
-
- if let response = response where response.statusCode == 204 { return .Success(NSNull()) }
-
- guard let validData = data where validData.length > 0 else {
- let failureReason = "Property list could not be serialized. Input data was nil or zero length."
- let error = Error.error(code: .PropertyListSerializationFailed, failureReason: failureReason)
- return .Failure(error)
- }
-
- do {
- let plist = try NSPropertyListSerialization.propertyListWithData(validData, options: options, format: nil)
- return .Success(plist)
- } catch {
- return .Failure(error as NSError)
- }
- }
- }
-
- /**
- Adds a handler to be called once the request has finished.
-
- - parameter options: The property list reading options. `0` by default.
- - parameter completionHandler: A closure to be executed once the request has finished. The closure takes 3
- arguments: the URL request, the URL response, the server data and the result
- produced while creating the property list.
-
- - returns: The request.
- */
- public func responsePropertyList(
- queue queue: dispatch_queue_t? = nil,
- options: NSPropertyListReadOptions = NSPropertyListReadOptions(),
- completionHandler: Response -> Void)
- -> Self
- {
- return response(
- queue: queue,
- responseSerializer: Request.propertyListResponseSerializer(options: options),
- completionHandler: completionHandler
- )
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift
deleted file mode 100644
index ed1df0fc8458..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Result.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/**
- Used to represent whether a request was successful or encountered an error.
-
- - Success: The request and all post processing operations were successful resulting in the serialization of the
- provided associated value.
- - Failure: The request encountered an error resulting in a failure. The associated values are the original data
- provided by the server as well as the error that caused the failure.
-*/
-public enum Result {
- case Success(Value)
- case Failure(Error)
-
- /// Returns `true` if the result is a success, `false` otherwise.
- public var isSuccess: Bool {
- switch self {
- case .Success:
- return true
- case .Failure:
- return false
- }
- }
-
- /// Returns `true` if the result is a failure, `false` otherwise.
- public var isFailure: Bool {
- return !isSuccess
- }
-
- /// Returns the associated value if the result is a success, `nil` otherwise.
- public var value: Value? {
- switch self {
- case .Success(let value):
- return value
- case .Failure:
- return nil
- }
- }
-
- /// Returns the associated error value if the result is a failure, `nil` otherwise.
- public var error: Error? {
- switch self {
- case .Success:
- return nil
- case .Failure(let error):
- return error
- }
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Result: CustomStringConvertible {
- /// The textual representation used when written to an output stream, which includes whether the result was a
- /// success or failure.
- public var description: String {
- switch self {
- case .Success:
- return "SUCCESS"
- case .Failure:
- return "FAILURE"
- }
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Result: CustomDebugStringConvertible {
- /// The debug textual representation used when written to an output stream, which includes whether the result was a
- /// success or failure in addition to the value or error.
- public var debugDescription: String {
- switch self {
- case .Success(let value):
- return "SUCCESS: \(value)"
- case .Failure(let error):
- return "FAILURE: \(error)"
- }
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift
deleted file mode 100644
index 44ba100be43f..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift
+++ /dev/null
@@ -1,304 +0,0 @@
-//
-// ServerTrustPolicy.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host.
-public class ServerTrustPolicyManager {
- /// The dictionary of policies mapped to a particular host.
- public let policies: [String: ServerTrustPolicy]
-
- /**
- Initializes the `ServerTrustPolicyManager` instance with the given policies.
-
- Since different servers and web services can have different leaf certificates, intermediate and even root
- certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This
- allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key
- pinning for host3 and disabling evaluation for host4.
-
- - parameter policies: A dictionary of all policies mapped to a particular host.
-
- - returns: The new `ServerTrustPolicyManager` instance.
- */
- public init(policies: [String: ServerTrustPolicy]) {
- self.policies = policies
- }
-
- /**
- Returns the `ServerTrustPolicy` for the given host if applicable.
-
- By default, this method will return the policy that perfectly matches the given host. Subclasses could override
- this method and implement more complex mapping implementations such as wildcards.
-
- - parameter host: The host to use when searching for a matching policy.
-
- - returns: The server trust policy for the given host if found.
- */
- public func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? {
- return policies[host]
- }
-}
-
-// MARK: -
-
-extension NSURLSession {
- private struct AssociatedKeys {
- static var ManagerKey = "NSURLSession.ServerTrustPolicyManager"
- }
-
- var serverTrustPolicyManager: ServerTrustPolicyManager? {
- get {
- return objc_getAssociatedObject(self, &AssociatedKeys.ManagerKey) as? ServerTrustPolicyManager
- }
- set (manager) {
- objc_setAssociatedObject(self, &AssociatedKeys.ManagerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
- }
- }
-}
-
-// MARK: - ServerTrustPolicy
-
-/**
- The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when
- connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust
- with a given set of criteria to determine whether the server trust is valid and the connection should be made.
-
- Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other
- vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged
- to route all communication over an HTTPS connection with pinning enabled.
-
- - PerformDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to
- validate the host provided by the challenge. Applications are encouraged to always
- validate the host in production environments to guarantee the validity of the server's
- certificate chain.
-
- - PinCertificates: Uses the pinned certificates to validate the server trust. The server trust is
- considered valid if one of the pinned certificates match one of the server certificates.
- By validating both the certificate chain and host, certificate pinning provides a very
- secure form of server trust validation mitigating most, if not all, MITM attacks.
- Applications are encouraged to always validate the host and require a valid certificate
- chain in production environments.
-
- - PinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered
- valid if one of the pinned public keys match one of the server certificate public keys.
- By validating both the certificate chain and host, public key pinning provides a very
- secure form of server trust validation mitigating most, if not all, MITM attacks.
- Applications are encouraged to always validate the host and require a valid certificate
- chain in production environments.
-
- - DisableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid.
-
- - CustomEvaluation: Uses the associated closure to evaluate the validity of the server trust.
-*/
-public enum ServerTrustPolicy {
- case PerformDefaultEvaluation(validateHost: Bool)
- case PinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool)
- case PinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool)
- case DisableEvaluation
- case CustomEvaluation((serverTrust: SecTrust, host: String) -> Bool)
-
- // MARK: - Bundle Location
-
- /**
- Returns all certificates within the given bundle with a `.cer` file extension.
-
- - parameter bundle: The bundle to search for all `.cer` files.
-
- - returns: All certificates within the given bundle.
- */
- public static func certificatesInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecCertificate] {
- var certificates: [SecCertificate] = []
-
- let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in
- bundle.pathsForResourcesOfType(fileExtension, inDirectory: nil)
- }.flatten())
-
- for path in paths {
- if let
- certificateData = NSData(contentsOfFile: path),
- certificate = SecCertificateCreateWithData(nil, certificateData)
- {
- certificates.append(certificate)
- }
- }
-
- return certificates
- }
-
- /**
- Returns all public keys within the given bundle with a `.cer` file extension.
-
- - parameter bundle: The bundle to search for all `*.cer` files.
-
- - returns: All public keys within the given bundle.
- */
- public static func publicKeysInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecKey] {
- var publicKeys: [SecKey] = []
-
- for certificate in certificatesInBundle(bundle) {
- if let publicKey = publicKeyForCertificate(certificate) {
- publicKeys.append(publicKey)
- }
- }
-
- return publicKeys
- }
-
- // MARK: - Evaluation
-
- /**
- Evaluates whether the server trust is valid for the given host.
-
- - parameter serverTrust: The server trust to evaluate.
- - parameter host: The host of the challenge protection space.
-
- - returns: Whether the server trust is valid.
- */
- public func evaluateServerTrust(serverTrust: SecTrust, isValidForHost host: String) -> Bool {
- var serverTrustIsValid = false
-
- switch self {
- case let .PerformDefaultEvaluation(validateHost):
- let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil)
- SecTrustSetPolicies(serverTrust, [policy])
-
- serverTrustIsValid = trustIsValid(serverTrust)
- case let .PinCertificates(pinnedCertificates, validateCertificateChain, validateHost):
- if validateCertificateChain {
- let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil)
- SecTrustSetPolicies(serverTrust, [policy])
-
- SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates)
- SecTrustSetAnchorCertificatesOnly(serverTrust, true)
-
- serverTrustIsValid = trustIsValid(serverTrust)
- } else {
- let serverCertificatesDataArray = certificateDataForTrust(serverTrust)
- let pinnedCertificatesDataArray = certificateDataForCertificates(pinnedCertificates)
-
- outerLoop: for serverCertificateData in serverCertificatesDataArray {
- for pinnedCertificateData in pinnedCertificatesDataArray {
- if serverCertificateData.isEqualToData(pinnedCertificateData) {
- serverTrustIsValid = true
- break outerLoop
- }
- }
- }
- }
- case let .PinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost):
- var certificateChainEvaluationPassed = true
-
- if validateCertificateChain {
- let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil)
- SecTrustSetPolicies(serverTrust, [policy])
-
- certificateChainEvaluationPassed = trustIsValid(serverTrust)
- }
-
- if certificateChainEvaluationPassed {
- outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeysForTrust(serverTrust) as [AnyObject] {
- for pinnedPublicKey in pinnedPublicKeys as [AnyObject] {
- if serverPublicKey.isEqual(pinnedPublicKey) {
- serverTrustIsValid = true
- break outerLoop
- }
- }
- }
- }
- case .DisableEvaluation:
- serverTrustIsValid = true
- case let .CustomEvaluation(closure):
- serverTrustIsValid = closure(serverTrust: serverTrust, host: host)
- }
-
- return serverTrustIsValid
- }
-
- // MARK: - Private - Trust Validation
-
- private func trustIsValid(trust: SecTrust) -> Bool {
- var isValid = false
-
- var result = SecTrustResultType(kSecTrustResultInvalid)
- let status = SecTrustEvaluate(trust, &result)
-
- if status == errSecSuccess {
- let unspecified = SecTrustResultType(kSecTrustResultUnspecified)
- let proceed = SecTrustResultType(kSecTrustResultProceed)
-
- isValid = result == unspecified || result == proceed
- }
-
- return isValid
- }
-
- // MARK: - Private - Certificate Data
-
- private func certificateDataForTrust(trust: SecTrust) -> [NSData] {
- var certificates: [SecCertificate] = []
-
- for index in 0.. [NSData] {
- return certificates.map { SecCertificateCopyData($0) as NSData }
- }
-
- // MARK: - Private - Public Key Extraction
-
- private static func publicKeysForTrust(trust: SecTrust) -> [SecKey] {
- var publicKeys: [SecKey] = []
-
- for index in 0.. SecKey? {
- var publicKey: SecKey?
-
- let policy = SecPolicyCreateBasicX509()
- var trust: SecTrust?
- let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust)
-
- if let trust = trust where trustCreationStatus == errSecSuccess {
- publicKey = SecTrustCopyPublicKey(trust)
- }
-
- return publicKey
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift
deleted file mode 100644
index 07ebe3374ff5..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// Stream.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-#if !os(watchOS)
-
-@available(iOS 9.0, OSX 10.11, tvOS 9.0, *)
-extension Manager {
- private enum Streamable {
- case Stream(String, Int)
- case NetService(NSNetService)
- }
-
- private func stream(streamable: Streamable) -> Request {
- var streamTask: NSURLSessionStreamTask!
-
- switch streamable {
- case .Stream(let hostName, let port):
- dispatch_sync(queue) {
- streamTask = self.session.streamTaskWithHostName(hostName, port: port)
- }
- case .NetService(let netService):
- dispatch_sync(queue) {
- streamTask = self.session.streamTaskWithNetService(netService)
- }
- }
-
- let request = Request(session: session, task: streamTask)
-
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- /**
- Creates a request for bidirectional streaming with the given hostname and port.
-
- - parameter hostName: The hostname of the server to connect to.
- - parameter port: The port of the server to connect to.
-
- :returns: The created stream request.
- */
- public func stream(hostName hostName: String, port: Int) -> Request {
- return stream(.Stream(hostName, port))
- }
-
- /**
- Creates a request for bidirectional streaming with the given `NSNetService`.
-
- - parameter netService: The net service used to identify the endpoint.
-
- - returns: The created stream request.
- */
- public func stream(netService netService: NSNetService) -> Request {
- return stream(.NetService(netService))
- }
-}
-
-// MARK: -
-
-@available(iOS 9.0, OSX 10.11, tvOS 9.0, *)
-extension Manager.SessionDelegate: NSURLSessionStreamDelegate {
-
- // MARK: Override Closures
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:readClosedForStreamTask:`.
- public var streamTaskReadClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? {
- get {
- return _streamTaskReadClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void
- }
- set {
- _streamTaskReadClosed = newValue
- }
- }
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:writeClosedForStreamTask:`.
- public var streamTaskWriteClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? {
- get {
- return _streamTaskWriteClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void
- }
- set {
- _streamTaskWriteClosed = newValue
- }
- }
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:betterRouteDiscoveredForStreamTask:`.
- public var streamTaskBetterRouteDiscovered: ((NSURLSession, NSURLSessionStreamTask) -> Void)? {
- get {
- return _streamTaskBetterRouteDiscovered as? (NSURLSession, NSURLSessionStreamTask) -> Void
- }
- set {
- _streamTaskBetterRouteDiscovered = newValue
- }
- }
-
- /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:streamTask:didBecomeInputStream:outputStream:`.
- public var streamTaskDidBecomeInputStream: ((NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void)? {
- get {
- return _streamTaskDidBecomeInputStream as? (NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void
- }
- set {
- _streamTaskDidBecomeInputStream = newValue
- }
- }
-
- // MARK: Delegate Methods
-
- /**
- Tells the delegate that the read side of the connection has been closed.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- */
- public func URLSession(session: NSURLSession, readClosedForStreamTask streamTask: NSURLSessionStreamTask) {
- streamTaskReadClosed?(session, streamTask)
- }
-
- /**
- Tells the delegate that the write side of the connection has been closed.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- */
- public func URLSession(session: NSURLSession, writeClosedForStreamTask streamTask: NSURLSessionStreamTask) {
- streamTaskWriteClosed?(session, streamTask)
- }
-
- /**
- Tells the delegate that the system has determined that a better route to the host is available.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- */
- public func URLSession(session: NSURLSession, betterRouteDiscoveredForStreamTask streamTask: NSURLSessionStreamTask) {
- streamTaskBetterRouteDiscovered?(session, streamTask)
- }
-
- /**
- Tells the delegate that the stream task has been completed and provides the unopened stream objects.
-
- - parameter session: The session.
- - parameter streamTask: The stream task.
- - parameter inputStream: The new input stream.
- - parameter outputStream: The new output stream.
- */
- public func URLSession(
- session: NSURLSession,
- streamTask: NSURLSessionStreamTask,
- didBecomeInputStream inputStream: NSInputStream,
- outputStream: NSOutputStream)
- {
- streamTaskDidBecomeInputStream?(session, streamTask, inputStream, outputStream)
- }
-}
-
-#endif
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift
deleted file mode 100644
index 959368272855..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// Timeline.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`.
-public struct Timeline {
- /// The time the request was initialized.
- public let requestStartTime: CFAbsoluteTime
-
- /// The time the first bytes were received from or sent to the server.
- public let initialResponseTime: CFAbsoluteTime
-
- /// The time when the request was completed.
- public let requestCompletedTime: CFAbsoluteTime
-
- /// The time when the response serialization was completed.
- public let serializationCompletedTime: CFAbsoluteTime
-
- /// The time interval in seconds from the time the request started to the initial response from the server.
- public let latency: NSTimeInterval
-
- /// The time interval in seconds from the time the request started to the time the request completed.
- public let requestDuration: NSTimeInterval
-
- /// The time interval in seconds from the time the request completed to the time response serialization completed.
- public let serializationDuration: NSTimeInterval
-
- /// The time interval in seconds from the time the request started to the time response serialization completed.
- public let totalDuration: NSTimeInterval
-
- /**
- Creates a new `Timeline` instance with the specified request times.
-
- - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`.
- - parameter initialResponseTime: The time the first bytes were received from or sent to the server.
- Defaults to `0.0`.
- - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`.
- - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults
- to `0.0`.
-
- - returns: The new `Timeline` instance.
- */
- public init(
- requestStartTime: CFAbsoluteTime = 0.0,
- initialResponseTime: CFAbsoluteTime = 0.0,
- requestCompletedTime: CFAbsoluteTime = 0.0,
- serializationCompletedTime: CFAbsoluteTime = 0.0)
- {
- self.requestStartTime = requestStartTime
- self.initialResponseTime = initialResponseTime
- self.requestCompletedTime = requestCompletedTime
- self.serializationCompletedTime = serializationCompletedTime
-
- self.latency = initialResponseTime - requestStartTime
- self.requestDuration = requestCompletedTime - requestStartTime
- self.serializationDuration = serializationCompletedTime - requestCompletedTime
- self.totalDuration = serializationCompletedTime - requestStartTime
- }
-}
-
-// MARK: - CustomStringConvertible
-
-extension Timeline: CustomStringConvertible {
- /// The textual representation used when written to an output stream, which includes the latency, the request
- /// duration and the total duration.
- public var description: String {
- let latency = String(format: "%.3f", self.latency)
- let requestDuration = String(format: "%.3f", self.requestDuration)
- let serializationDuration = String(format: "%.3f", self.serializationDuration)
- let totalDuration = String(format: "%.3f", self.totalDuration)
-
- // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is
- // fixed, we should move back to string interpolation by reverting commit 7d4a43b1.
- let timings = [
- "\"Latency\": " + latency + " secs",
- "\"Request Duration\": " + requestDuration + " secs",
- "\"Serialization Duration\": " + serializationDuration + " secs",
- "\"Total Duration\": " + totalDuration + " secs"
- ]
-
- return "Timeline: { " + timings.joinWithSeparator(", ") + " }"
- }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Timeline: CustomDebugStringConvertible {
- /// The textual representation used when written to an output stream, which includes the request start time, the
- /// initial response time, the request completed time, the serialization completed time, the latency, the request
- /// duration and the total duration.
- public var debugDescription: String {
- let requestStartTime = String(format: "%.3f", self.requestStartTime)
- let initialResponseTime = String(format: "%.3f", self.initialResponseTime)
- let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime)
- let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime)
- let latency = String(format: "%.3f", self.latency)
- let requestDuration = String(format: "%.3f", self.requestDuration)
- let serializationDuration = String(format: "%.3f", self.serializationDuration)
- let totalDuration = String(format: "%.3f", self.totalDuration)
-
- // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is
- // fixed, we should move back to string interpolation by reverting commit 7d4a43b1.
- let timings = [
- "\"Request Start Time\": " + requestStartTime,
- "\"Initial Response Time\": " + initialResponseTime,
- "\"Request Completed Time\": " + requestCompletedTime,
- "\"Serialization Completed Time\": " + serializationCompletedTime,
- "\"Latency\": " + latency + " secs",
- "\"Request Duration\": " + requestDuration + " secs",
- "\"Serialization Duration\": " + serializationDuration + " secs",
- "\"Total Duration\": " + totalDuration + " secs"
- ]
-
- return "Timeline: { " + timings.joinWithSeparator(", ") + " }"
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift
deleted file mode 100644
index 7b31ba530734..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift
+++ /dev/null
@@ -1,376 +0,0 @@
-//
-// Upload.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-extension Manager {
- private enum Uploadable {
- case Data(NSURLRequest, NSData)
- case File(NSURLRequest, NSURL)
- case Stream(NSURLRequest, NSInputStream)
- }
-
- private func upload(uploadable: Uploadable) -> Request {
- var uploadTask: NSURLSessionUploadTask!
- var HTTPBodyStream: NSInputStream?
-
- switch uploadable {
- case .Data(let request, let data):
- dispatch_sync(queue) {
- uploadTask = self.session.uploadTaskWithRequest(request, fromData: data)
- }
- case .File(let request, let fileURL):
- dispatch_sync(queue) {
- uploadTask = self.session.uploadTaskWithRequest(request, fromFile: fileURL)
- }
- case .Stream(let request, let stream):
- dispatch_sync(queue) {
- uploadTask = self.session.uploadTaskWithStreamedRequest(request)
- }
-
- HTTPBodyStream = stream
- }
-
- let request = Request(session: session, task: uploadTask)
-
- if HTTPBodyStream != nil {
- request.delegate.taskNeedNewBodyStream = { _, _ in
- return HTTPBodyStream
- }
- }
-
- delegate[request.delegate.task] = request.delegate
-
- if startRequestsImmediately {
- request.resume()
- }
-
- return request
- }
-
- // MARK: File
-
- /**
- Creates a request for uploading a file to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request
- - parameter file: The file to upload
-
- - returns: The created upload request.
- */
- public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request {
- return upload(.File(URLRequest.URLRequest, file))
- }
-
- /**
- Creates a request for uploading a file to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter file: The file to upload
-
- - returns: The created upload request.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- file: NSURL)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
- return upload(mutableURLRequest, file: file)
- }
-
- // MARK: Data
-
- /**
- Creates a request for uploading data to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request.
- - parameter data: The data to upload.
-
- - returns: The created upload request.
- */
- public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request {
- return upload(.Data(URLRequest.URLRequest, data))
- }
-
- /**
- Creates a request for uploading data to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter data: The data to upload
-
- - returns: The created upload request.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- data: NSData)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
-
- return upload(mutableURLRequest, data: data)
- }
-
- // MARK: Stream
-
- /**
- Creates a request for uploading a stream to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
- */
- public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request {
- return upload(.Stream(URLRequest.URLRequest, stream))
- }
-
- /**
- Creates a request for uploading a stream to the specified URL request.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter stream: The stream to upload.
-
- - returns: The created upload request.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- stream: NSInputStream)
- -> Request
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
-
- return upload(mutableURLRequest, stream: stream)
- }
-
- // MARK: MultipartFormData
-
- /// Default memory threshold used when encoding `MultipartFormData`.
- public static let MultipartFormDataEncodingMemoryThreshold: UInt64 = 10 * 1024 * 1024
-
- /**
- Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as
- associated values.
-
- - Success: Represents a successful `MultipartFormData` encoding and contains the new `Request` along with
- streaming information.
- - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding
- error.
- */
- public enum MultipartFormDataEncodingResult {
- case Success(request: Request, streamingFromDisk: Bool, streamFileURL: NSURL?)
- case Failure(ErrorType)
- }
-
- /**
- Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request.
-
- It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative
- payload is small, encoding the data in-memory and directly uploading to a server is the by far the most
- efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to
- be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory
- footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be
- used for larger payloads such as video content.
-
- The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory
- or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`,
- encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk
- during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding
- technique was used.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter method: The HTTP method.
- - parameter URLString: The URL string.
- - parameter headers: The HTTP headers. `nil` by default.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
- */
- public func upload(
- method: Method,
- _ URLString: URLStringConvertible,
- headers: [String: String]? = nil,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (MultipartFormDataEncodingResult -> Void)?)
- {
- let mutableURLRequest = URLRequest(method, URLString, headers: headers)
-
- return upload(
- mutableURLRequest,
- multipartFormData: multipartFormData,
- encodingMemoryThreshold: encodingMemoryThreshold,
- encodingCompletion: encodingCompletion
- )
- }
-
- /**
- Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request.
-
- It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative
- payload is small, encoding the data in-memory and directly uploading to a server is the by far the most
- efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to
- be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory
- footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be
- used for larger payloads such as video content.
-
- The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory
- or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`,
- encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk
- during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding
- technique was used.
-
- If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
-
- - parameter URLRequest: The URL request.
- - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`.
- - parameter encodingMemoryThreshold: The encoding memory threshold in bytes.
- `MultipartFormDataEncodingMemoryThreshold` by default.
- - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete.
- */
- public func upload(
- URLRequest: URLRequestConvertible,
- multipartFormData: MultipartFormData -> Void,
- encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold,
- encodingCompletion: (MultipartFormDataEncodingResult -> Void)?)
- {
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
- let formData = MultipartFormData()
- multipartFormData(formData)
-
- let URLRequestWithContentType = URLRequest.URLRequest
- URLRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type")
-
- let isBackgroundSession = self.session.configuration.identifier != nil
-
- if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession {
- do {
- let data = try formData.encode()
- let encodingResult = MultipartFormDataEncodingResult.Success(
- request: self.upload(URLRequestWithContentType, data: data),
- streamingFromDisk: false,
- streamFileURL: nil
- )
-
- dispatch_async(dispatch_get_main_queue()) {
- encodingCompletion?(encodingResult)
- }
- } catch {
- dispatch_async(dispatch_get_main_queue()) {
- encodingCompletion?(.Failure(error as NSError))
- }
- }
- } else {
- let fileManager = NSFileManager.defaultManager()
- let tempDirectoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory())
- let directoryURL = tempDirectoryURL.URLByAppendingPathComponent("com.alamofire.manager/multipart.form.data")
- let fileName = NSUUID().UUIDString
- let fileURL = directoryURL.URLByAppendingPathComponent(fileName)
-
- do {
- try fileManager.createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil)
- try formData.writeEncodedDataToDisk(fileURL)
-
- dispatch_async(dispatch_get_main_queue()) {
- let encodingResult = MultipartFormDataEncodingResult.Success(
- request: self.upload(URLRequestWithContentType, file: fileURL),
- streamingFromDisk: true,
- streamFileURL: fileURL
- )
- encodingCompletion?(encodingResult)
- }
- } catch {
- dispatch_async(dispatch_get_main_queue()) {
- encodingCompletion?(.Failure(error as NSError))
- }
- }
- }
- }
- }
-}
-
-// MARK: -
-
-extension Request {
-
- // MARK: - UploadTaskDelegate
-
- class UploadTaskDelegate: DataTaskDelegate {
- var uploadTask: NSURLSessionUploadTask? { return task as? NSURLSessionUploadTask }
- var uploadProgress: ((Int64, Int64, Int64) -> Void)!
-
- // MARK: - NSURLSessionTaskDelegate
-
- // MARK: Override Closures
-
- var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)?
-
- // MARK: Delegate Methods
-
- func URLSession(
- session: NSURLSession,
- task: NSURLSessionTask,
- didSendBodyData bytesSent: Int64,
- totalBytesSent: Int64,
- totalBytesExpectedToSend: Int64)
- {
- if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() }
-
- if let taskDidSendBodyData = taskDidSendBodyData {
- taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend)
- } else {
- progress.totalUnitCount = totalBytesExpectedToSend
- progress.completedUnitCount = totalBytesSent
-
- uploadProgress?(bytesSent, totalBytesSent, totalBytesExpectedToSend)
- }
- }
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift
deleted file mode 100644
index e90db2d4a100..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-// Validation.swift
-//
-// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-import Foundation
-
-extension Request {
-
- /**
- Used to represent whether validation was successful or encountered an error resulting in a failure.
-
- - Success: The validation was successful.
- - Failure: The validation failed encountering the provided error.
- */
- public enum ValidationResult {
- case Success
- case Failure(NSError)
- }
-
- /**
- A closure used to validate a request that takes a URL request and URL response, and returns whether the
- request was valid.
- */
- public typealias Validation = (NSURLRequest?, NSHTTPURLResponse) -> ValidationResult
-
- /**
- Validates the request, using the specified closure.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - parameter validation: A closure to validate the request.
-
- - returns: The request.
- */
- public func validate(validation: Validation) -> Self {
- delegate.queue.addOperationWithBlock {
- if let
- response = self.response where self.delegate.error == nil,
- case let .Failure(error) = validation(self.request, response)
- {
- self.delegate.error = error
- }
- }
-
- return self
- }
-
- // MARK: - Status Code
-
- /**
- Validates that the response has a status code in the specified range.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - parameter range: The range of acceptable status codes.
-
- - returns: The request.
- */
- public func validate(statusCode acceptableStatusCode: S) -> Self {
- return validate { _, response in
- if acceptableStatusCode.contains(response.statusCode) {
- return .Success
- } else {
- let failureReason = "Response status code was unacceptable: \(response.statusCode)"
-
- let error = NSError(
- domain: Error.Domain,
- code: Error.Code.StatusCodeValidationFailed.rawValue,
- userInfo: [
- NSLocalizedFailureReasonErrorKey: failureReason,
- Error.UserInfoKeys.StatusCode: response.statusCode
- ]
- )
-
- return .Failure(error)
- }
- }
- }
-
- // MARK: - Content-Type
-
- private struct MIMEType {
- let type: String
- let subtype: String
-
- init?(_ string: String) {
- let components: [String] = {
- let stripped = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
- let split = stripped.substringToIndex(stripped.rangeOfString(";")?.startIndex ?? stripped.endIndex)
- return split.componentsSeparatedByString("/")
- }()
-
- if let
- type = components.first,
- subtype = components.last
- {
- self.type = type
- self.subtype = subtype
- } else {
- return nil
- }
- }
-
- func matches(MIME: MIMEType) -> Bool {
- switch (type, subtype) {
- case (MIME.type, MIME.subtype), (MIME.type, "*"), ("*", MIME.subtype), ("*", "*"):
- return true
- default:
- return false
- }
- }
- }
-
- /**
- Validates that the response has a content type in the specified array.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes.
-
- - returns: The request.
- */
- public func validate(contentType acceptableContentTypes: S) -> Self {
- return validate { _, response in
- guard let validData = self.delegate.data where validData.length > 0 else { return .Success }
-
- if let
- responseContentType = response.MIMEType,
- responseMIMEType = MIMEType(responseContentType)
- {
- for contentType in acceptableContentTypes {
- if let acceptableMIMEType = MIMEType(contentType) where acceptableMIMEType.matches(responseMIMEType) {
- return .Success
- }
- }
- } else {
- for contentType in acceptableContentTypes {
- if let MIMEType = MIMEType(contentType) where MIMEType.type == "*" && MIMEType.subtype == "*" {
- return .Success
- }
- }
- }
-
- let contentType: String
- let failureReason: String
-
- if let responseContentType = response.MIMEType {
- contentType = responseContentType
-
- failureReason = (
- "Response content type \"\(responseContentType)\" does not match any acceptable " +
- "content types: \(acceptableContentTypes)"
- )
- } else {
- contentType = ""
- failureReason = "Response content type was missing and acceptable content type does not match \"*/*\""
- }
-
- let error = NSError(
- domain: Error.Domain,
- code: Error.Code.ContentTypeValidationFailed.rawValue,
- userInfo: [
- NSLocalizedFailureReasonErrorKey: failureReason,
- Error.UserInfoKeys.ContentType: contentType
- ]
- )
-
- return .Failure(error)
- }
- }
-
- // MARK: - Automatic
-
- /**
- Validates that the response has a status code in the default acceptable range of 200...299, and that the content
- type matches any specified in the Accept HTTP header field.
-
- If validation fails, subsequent calls to response handlers will have an associated error.
-
- - returns: The request.
- */
- public func validate() -> Self {
- let acceptableStatusCodes: Range = 200..<300
- let acceptableContentTypes: [String] = {
- if let accept = request?.valueForHTTPHeaderField("Accept") {
- return accept.componentsSeparatedByString(",")
- }
-
- return ["*/*"]
- }()
-
- return validate(statusCode: acceptableStatusCodes).validate(contentType: acceptableContentTypes)
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json
deleted file mode 100644
index 0920f1985e9a..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "PetstoreClient",
- "platforms": {
- "ios": "8.0",
- "osx": "10.9"
- },
- "version": "0.0.1",
- "source": {
- "git": "git@github.com:swagger-api/swagger-mustache.git",
- "tag": "v1.0.0"
- },
- "authors": "",
- "license": "Apache License, Version 2.0",
- "homepage": "https://github.com/swagger-api/swagger-codegen",
- "summary": "PetstoreClient",
- "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift",
- "dependencies": {
- "PromiseKit": [
- "~> 3.1.1"
- ],
- "Alamofire": [
- "~> 3.4.1"
- ]
- }
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock
deleted file mode 100644
index 0686012e4a05..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock
+++ /dev/null
@@ -1,41 +0,0 @@
-PODS:
- - Alamofire (3.4.1)
- - OMGHTTPURLRQ (3.1.3):
- - OMGHTTPURLRQ/RQ (= 3.1.3)
- - OMGHTTPURLRQ/FormURLEncode (3.1.3)
- - OMGHTTPURLRQ/RQ (3.1.3):
- - OMGHTTPURLRQ/FormURLEncode
- - OMGHTTPURLRQ/UserAgent
- - OMGHTTPURLRQ/UserAgent (3.1.3)
- - PetstoreClient (0.0.1):
- - Alamofire (~> 3.4.1)
- - PromiseKit (~> 3.1.1)
- - PromiseKit (3.1.1):
- - PromiseKit/Foundation (= 3.1.1)
- - PromiseKit/QuartzCore (= 3.1.1)
- - PromiseKit/UIKit (= 3.1.1)
- - PromiseKit/CorePromise (3.1.1)
- - PromiseKit/Foundation (3.1.1):
- - OMGHTTPURLRQ (~> 3.1.0)
- - PromiseKit/CorePromise
- - PromiseKit/QuartzCore (3.1.1):
- - PromiseKit/CorePromise
- - PromiseKit/UIKit (3.1.1):
- - PromiseKit/CorePromise
-
-DEPENDENCIES:
- - PetstoreClient (from `../`)
-
-EXTERNAL SOURCES:
- PetstoreClient:
- :path: "../"
-
-SPEC CHECKSUMS:
- Alamofire: 01a82e2f6c0f860ade35534c8dd88be61bdef40c
- OMGHTTPURLRQ: a547be1b9721ddfbf9d08aab56ab72dc4c1cc417
- PetstoreClient: 24135348a992f2cbd76bc324719173b52e864cdc
- PromiseKit: 4e8127c22a9b29d1b44958ab2ec762ea6115cbfb
-
-PODFILE CHECKSUM: 84472aca2a88b7f7ed9fcd63e9f5fdb5ad4aab94
-
-COCOAPODS: 1.0.1
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown
deleted file mode 100644
index 1cd71258ad38..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/README.markdown
+++ /dev/null
@@ -1,145 +0,0 @@
-# OMGHTTPURLRQ
-
-Vital extensions to `NSURLRequest` that Apple left out for some reason.
-
-```objc
-NSMutableURLRequest *rq = [OMGHTTPURLRQ GET:@"http://api.com":@{@"key": @"value"}];
-
-// application/x-www-form-urlencoded
-NSMutableURLRequest *rq = [OMGHTTPURLRQ POST:@"http://api.com":@{@"key": @"value"}];
-
-// application/json
-NSMutableURLRequest *rq = [OMGHTTPURLRQ POST:@"http://api.com" JSON:@{@"key": @"value"}];
-
-// PUT
-NSMutableURLRequest *rq = [OMGHTTPURLRQ PUT:@"http://api.com":@{@"key": @"value"}];
-
-// DELETE
-NSMutableURLRequest *rq = [OMGHTTPURLRQ DELETE:@"http://api.com":@{@"key": @"value"}];
-```
-
-You can then pass these to an `NSURLConnection` or `NSURLSession`.
-
-
-## `multipart/form-data`
-
-OMG! Constructing multipart/form-data for POST requests is complicated, let us do it for you:
-
-```objc
-
-OMGMultipartFormData *multipartFormData = [OMGMultipartFormData new];
-
-NSData *data1 = [NSData dataWithContentsOfFile:@"myimage1.png"];
-[multipartFormData addFile:data1 parameterName:@"file1" filename:@"myimage1.png" contentType:@"image/png"];
-
-// Ideally you would not want to re-encode the PNG, but often it is
-// tricky to avoid it.
-UIImage *image2 = [UIImage imageNamed:@"image2"];
-NSData *data2 = UIImagePNGRepresentation(image2);
-[multipartFormData addFile:data2 parameterName:@"file2" filename:@"myimage2.png" contentType:@"image/png"];
-
-// SUPER Ideally you would not want to re-encode the JPEG as the process
-// is lossy. If your image comes from the AssetLibrary you *CAN* get the
-// original `NSData`. See stackoverflow.com.
-UIImage *image3 = [UIImage imageNamed:@"image3"];
-NSData *data3 = UIImageJPEGRepresentation(image3);
-[multipartFormData addFile:data3 parameterName:@"file2" filename:@"myimage3.jpeg" contentType:@"image/jpeg"];
-
-NSMutableURLRequest *rq = [OMGHTTPURLRQ POST:url:multipartFormData];
-```
-
-Now feed `rq` to `[NSURLConnection sendSynchronousRequest:returningResponse:error:`.
-
-
-## Configuring an `NSURLSessionUploadTask`
-
-If you need to use `NSURLSession`’s `uploadTask:` but you have become frustrated because your endpoint expects a multipart/form-data POST request and `NSURLSession` sends the data *raw*, use this:
-
-```objc
-id config = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:someID];
-id session = [NSURLSession sessionWithConfiguration:config delegate:someObject delegateQueue:[NSOperationQueue new]];
-
-OMGMultipartFormData *multipartFormData = [OMGMultipartFormData new];
-[multipartFormData addFile:data parameterName:@"file" filename:nil contentType:nil];
-
-NSURLRequest *rq = [OMGHTTPURLRQ POST:urlString:multipartFormData];
-
-id path = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"upload.NSData"];
-[rq.HTTPBody writeToFile:path atomically:YES];
-
-[[session uploadTaskWithRequest:rq fromFile:[NSURL fileURLWithPath:path]] resume];
-```
-
-
-## OMGUserAgent
-
-If you just need a sensible UserAgent string for your application you can `pod OMGHTTPURLRQ/UserAgent` and then:
-
-```objc
-#import
-
-NSString *userAgent = OMGUserAgent();
-```
-
-OMGHTTPURLRQ adds this User-Agent to all requests it generates automatically.
-
-So for URLRequests generated **other** than by OMGHTTPURLRQ you would do:
-
-```objc
-[someURLRequest addValue:OMGUserAgent() forHTTPHeaderField:@"User-Agent"];
-```
-
-
-# Twitter Reverse Auth
-
-You need an OAuth library, here we use the [TDOAuth](https://github.com/tweetdeck/TDOAuth) pod. You also need
-your API keys that registering at https://dev.twitter.com will provide
-you.
-
-```objc
-NSMutableURLRequest *rq = [TDOAuth URLRequestForPath:@"/oauth/request_token" POSTParameters:@{@"x_auth_mode" : @"reverse_auth"} host:@"api.twitter.com" consumerKey:APIKey consumerSecret:APISecret accessToken:nil tokenSecret:nil];
-[rq addValue:OMGUserAgent() forHTTPHeaderField:@"User-Agent"];
-
-[NSURLConnection sendAsynchronousRequest:rq queue:nil completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
- id oauth = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- SLRequest *reverseAuth = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:[NSURL URLWithString:@"https://api.twitter.com/oauth/access_token"] parameters:@{
- @"x_reverse_auth_target": APIKey,
- @"x_reverse_auth_parameters": oauth
- }];
- reverseAuth.account = account;
- [reverseAuth performRequestWithHandler:^(NSData *data, NSHTTPURLResponse *urlResponse, NSError *error) {
- id creds = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- id credsDict = [NSMutableDictionary new];
- for (__strong id pair in [creds componentsSeparatedByString:@"&"]) {
- pair = [pair componentsSeparatedByString:@"="];
- credsDict[pair[0]] = pair[1];
- }
- NSLog(@"%@", credsDict);
- }];
-}];
-```
-
-
-# License
-
-```
-Copyright 2014 Max Howell
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-```
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.h
deleted file mode 100644
index 994c56494eb9..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#import
-#import
-#import
-
-#if __has_feature(nullability) && defined(NS_ASSUME_NONNULL_BEGIN)
-NS_ASSUME_NONNULL_BEGIN
-#endif
-
-/**
- Express this dictionary as a `application/x-www-form-urlencoded` string.
-
- Most users would recognize the result of this transformation as the query
- string in a browser bar. For our purposes it is the query string in a GET
- request and the HTTP body for POST, PUT and DELETE requests.
-
- If the parameters dictionary is nil or empty, returns nil.
-*/
-NSString *OMGFormURLEncode(NSDictionary *parameters);
-
-#if __has_feature(nullability) && defined(NS_ASSUME_NONNULL_END)
-NS_ASSUME_NONNULL_END
-#endif
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.m
deleted file mode 100644
index 1014543c1a0b..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGFormURLEncode.m
+++ /dev/null
@@ -1,56 +0,0 @@
-#import
-#import "OMGFormURLEncode.h"
-
-static inline NSString *enc(id in, NSString *ignore) {
- NSMutableCharacterSet *allowedSet = [NSMutableCharacterSet characterSetWithCharactersInString:ignore];
- [allowedSet formUnionWithCharacterSet:[NSCharacterSet URLQueryAllowedCharacterSet]];
- [allowedSet removeCharactersInString:@":/?&=;+!@#$()',*"];
-
- return [[in description] stringByAddingPercentEncodingWithAllowedCharacters:allowedSet];
-}
-
-#define enckey(in) enc(in, @"[]")
-#define encval(in) enc(in, @"")
-
-static NSArray *DoQueryMagic(NSString *key, id value) {
- NSMutableArray *parts = [NSMutableArray new];
-
- // Sort dictionary keys to ensure consistent ordering in query string,
- // which is important when deserializing potentially ambiguous sequences,
- // such as an array of dictionaries
- #define sortDescriptor [NSSortDescriptor sortDescriptorWithKey:@"description" ascending:YES selector:@selector(compare:)]
-
- if ([value isKindOfClass:[NSDictionary class]]) {
- NSDictionary *dictionary = value;
- for (id nestedKey in [dictionary.allKeys sortedArrayUsingDescriptors:@[sortDescriptor]]) {
- id recursiveKey = key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey;
- [parts addObjectsFromArray:DoQueryMagic(recursiveKey, dictionary[nestedKey])];
- }
- } else if ([value isKindOfClass:[NSArray class]]) {
- for (id nestedValue in value)
- [parts addObjectsFromArray:DoQueryMagic([NSString stringWithFormat:@"%@[]", key], nestedValue)];
- } else if ([value isKindOfClass:[NSSet class]]) {
- for (id obj in [value sortedArrayUsingDescriptors:@[sortDescriptor]])
- [parts addObjectsFromArray:DoQueryMagic(key, obj)];
- } else {
- [parts addObjectsFromArray:[NSArray arrayWithObjects:key, value, nil]];
- }
-
- return parts;
-
- #undef sortDescriptor
-}
-
-NSString *OMGFormURLEncode(NSDictionary *parameters) {
- if (parameters.count == 0)
- return @"";
- NSMutableString *queryString = [NSMutableString new];
- NSEnumerator *e = DoQueryMagic(nil, parameters).objectEnumerator;
- for (;;) {
- id const obj = e.nextObject;
- if (!obj) break;
- [queryString appendFormat:@"%@=%@&", enckey(obj), encval(e.nextObject)];
- }
- [queryString deleteCharactersInRange:NSMakeRange(queryString.length - 1, 1)];
- return queryString;
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.h
deleted file mode 100644
index 1eb04b1ab43f..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#import
-
-FOUNDATION_EXPORT double OMGHTTPURLRQVersionNumber;
-FOUNDATION_EXPORT const unsigned char OMGHTTPURLRQVersionString[];
-
-#import
-#import
-#import
-#import
-#import "OMGFormURLEncode.h"
-#import "OMGUserAgent.h"
-
-
-#if __has_feature(nullability) && defined(NS_ASSUME_NONNULL_BEGIN)
-NS_ASSUME_NONNULL_BEGIN
-#else
-#define nullable
-#endif
-
-/**
- The error will either be a JSON error (NSCocoaDomain :/) or in the NSURLErrorDomain
- with code: NSURLErrorUnsupportedURL.
-*/
-@interface OMGHTTPURLRQ : NSObject
-
-+ (nullable NSMutableURLRequest *)GET:(NSString *)url :(nullable NSDictionary *)parameters error:(NSError **)error;
-+ (nullable NSMutableURLRequest *)POST:(NSString *)url :(nullable id)parametersOrMultipartFormData error:(NSError **)error;
-+ (nullable NSMutableURLRequest *)POST:(NSString *)url JSON:(nullable id)JSONObject error:(NSError **)error;
-+ (nullable NSMutableURLRequest *)PUT:(NSString *)url :(nullable NSDictionary *)parameters error:(NSError **)error;
-+ (nullable NSMutableURLRequest *)PUT:(NSString *)url JSON:(nullable id)JSONObject error:(NSError **)error;
-+ (nullable NSMutableURLRequest *)DELETE:(NSString *)url :(nullable NSDictionary *)parameters error:(NSError **)error;
-
-@end
-
-
-/**
- POST this with `OMGHTTPURLRQ`’s `-POST::` class method.
-*/
-@interface OMGMultipartFormData : NSObject
-
-/**
- The `filename` parameter is optional. The content-type is optional, and
- if left `nil` will default to *octet-stream*.
-*/
-- (void)addFile:(NSData *)data parameterName:(NSString *)parameterName filename:(nullable NSString *)filename contentType:(nullable NSString *)contentType;
-
-- (void)addText:(NSString *)text parameterName:(NSString *)parameterName;
-
-/**
- Technically adding parameters to a multipart/form-data request is abusing
- the specification. What we do is add each parameter as a text-item. Any
- API that expects parameters in a multipart/form-data request will expect
- the parameters to be encoded in this way.
-*/
-- (void)addParameters:(NSDictionary *)parameters;
-
-@end
-
-
-#if __has_feature(nullability) && defined(NS_ASSUME_NONNULL_END)
-NS_ASSUME_NONNULL_END
-#else
-#undef nullable
-#endif
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m
deleted file mode 100644
index 321ee61eb2e8..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGHTTPURLRQ.m
+++ /dev/null
@@ -1,171 +0,0 @@
-#import
-#import
-#import
-#import
-#import
-#import "OMGHTTPURLRQ.h"
-#import "OMGUserAgent.h"
-#import "OMGFormURLEncode.h"
-#import
-
-static inline NSMutableURLRequest *OMGMutableURLRequest() {
- NSMutableURLRequest *rq = [NSMutableURLRequest new];
- [rq setValue:OMGUserAgent() forHTTPHeaderField:@"User-Agent"];
- return rq;
-}
-
-#define OMGInvalidURLErrorMake() \
- [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorUnsupportedURL userInfo:@{NSLocalizedDescriptionKey: @"The provided URL was invalid."}]
-
-
-@implementation OMGMultipartFormData {
-@public
- NSString *boundary;
- NSMutableData *body;
-}
-
-- (instancetype)init {
- body = [NSMutableData data];
- boundary = [NSString stringWithFormat:@"------------------------%08X%08X", arc4random(), arc4random()];
- return self;
-}
-
-- (void)add:(NSData *)payload :(NSString *)name :(NSString *)filename :(NSString *)contentType {
- id ln1 = [NSString stringWithFormat:@"--%@\r\n", boundary];
- id ln2 = ({
- id s = [NSMutableString stringWithString:@"Content-Disposition: form-data; "];
- [s appendFormat:@"name=\"%@\"", name];
- if (filename.length)
- [s appendFormat:@"; filename=\"%@\"", filename];
- [s appendString:@"\r\n"];
- if (contentType.length)
- [s appendFormat:@"Content-Type: %@\r\n", contentType];
- [s appendString:@"\r\n"];
- s;
- });
-
- [body appendData:[ln1 dataUsingEncoding:NSUTF8StringEncoding]];
- [body appendData:[ln2 dataUsingEncoding:NSUTF8StringEncoding]];
- [body appendData:payload];
-}
-
-- (void)addFile:(NSData *)payload parameterName:(NSString *)name filename:(NSString *)filename contentType:(NSString *)contentType
-{
- [self add:payload:name:filename:(contentType ?: @"application/octet-stream")];
-}
-
-- (void)addText:(NSString *)text parameterName:(NSString *)parameterName {
- [self add:[text dataUsingEncoding:NSUTF8StringEncoding]:parameterName:nil:nil];
-}
-
-- (void)addParameters:(NSDictionary *)parameters {
- for (id key in parameters)
- [self addText:[parameters[key] description] parameterName:key];
-}
-
-@end
-
-
-
-@implementation OMGHTTPURLRQ
-
-+ (NSMutableURLRequest *)GET:(NSString *)urlString :(NSDictionary *)params error:(NSError **)error {
- NSString *queryString = OMGFormURLEncode(params);
- if (queryString.length) urlString = [urlString stringByAppendingFormat:@"?%@", queryString];
-
- id url = [NSURL URLWithString:urlString];
- if (!url) {
- if (error) *error = OMGInvalidURLErrorMake();
- return nil;
- }
-
- NSMutableURLRequest *rq = OMGMutableURLRequest();
- rq.HTTPMethod = @"GET";
- rq.URL = url;
- return rq;
-}
-
-static NSMutableURLRequest *OMGFormURLEncodedRequest(NSString *urlString, NSString *method, NSDictionary *parameters, NSError **error) {
- id url = [NSURL URLWithString:urlString];
- if (!url) {
- if (error) *error = OMGInvalidURLErrorMake();
- return nil;
- }
-
- NSMutableURLRequest *rq = OMGMutableURLRequest();
- rq.URL = url;
- rq.HTTPMethod = method;
-
- id queryString = OMGFormURLEncode(parameters);
- NSData *data = [queryString dataUsingEncoding:NSUTF8StringEncoding];
- [rq addValue:@"8bit" forHTTPHeaderField:@"Content-Transfer-Encoding"];
- [rq addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
- [rq addValue:@(data.length).description forHTTPHeaderField:@"Content-Length"];
- [rq setHTTPBody:data];
-
- return rq;
-}
-
-+ (NSMutableURLRequest *)POST:(NSString *)urlString :(id)body error:(NSError **)error {
- if (![body isKindOfClass:[OMGMultipartFormData class]]) {
- return OMGFormURLEncodedRequest(urlString, @"POST", body, error);
- } else {
- id url = [NSURL URLWithString:urlString];
- if (!url) {
- if (error) *error = OMGInvalidURLErrorMake();
- return nil;
- }
-
- OMGMultipartFormData *multipartFormData = (id)body;
- id const charset = (NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
- id const contentType = [NSString stringWithFormat:@"multipart/form-data; charset=%@; boundary=%@", charset, multipartFormData->boundary];
-
- NSMutableData *data = [multipartFormData->body mutableCopy];
- id lastLine = [NSString stringWithFormat:@"\r\n--%@--\r\n", multipartFormData->boundary];
- [data appendData:[lastLine dataUsingEncoding:NSUTF8StringEncoding]];
-
- NSMutableURLRequest *rq = OMGMutableURLRequest();
- [rq setURL:url];
- [rq setHTTPMethod:@"POST"];
- [rq addValue:contentType forHTTPHeaderField:@"Content-Type"];
- [rq setHTTPBody:data];
- return rq;
- }
-}
-
-+ (NSMutableURLRequest *)POST:(NSString *)urlString JSON:(id)params error:(NSError **)error {
- if (error) *error = nil;
-
- id url = [NSURL URLWithString:urlString];
- if (!url) {
- if (error) *error = OMGInvalidURLErrorMake();
- return nil;
- }
-
- id JSONData = [NSJSONSerialization dataWithJSONObject:params options:(NSJSONWritingOptions)0 error:error];
- if (error && *error) return nil;
-
- NSMutableURLRequest *rq = OMGMutableURLRequest();
- [rq setURL:url];
- [rq setHTTPMethod:@"POST"];
- [rq setHTTPBody:JSONData];
- [rq setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
- [rq setValue:@"json" forHTTPHeaderField:@"Data-Type"];
- return rq;
-}
-
-+ (NSMutableURLRequest *)PUT:(NSString *)url :(NSDictionary *)parameters error:(NSError **)error {
- return OMGFormURLEncodedRequest(url, @"PUT", parameters, error);
-}
-
-+ (NSMutableURLRequest *)PUT:(NSString *)url JSON:(id)params error:(NSError **)error {
- NSMutableURLRequest *rq = [OMGHTTPURLRQ POST:url JSON:params error:error];
- rq.HTTPMethod = @"PUT";
- return rq;
-}
-
-+ (NSMutableURLRequest *)DELETE:(NSString *)url :(NSDictionary *)parameters error:(NSError **)error {
- return OMGFormURLEncodedRequest(url, @"DELETE", parameters, error);
-}
-
-@end
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.h
deleted file mode 100644
index 75dacf4e4f5f..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#import
-@class NSString;
-
-#if __has_feature(nullability) && defined(NS_ASSUME_NONNULL_BEGIN)
-NS_ASSUME_NONNULL_BEGIN
-#endif
-
-NSString *OMGUserAgent();
-
-#if __has_feature(nullability) && defined(NS_ASSUME_NONNULL_END)
-NS_ASSUME_NONNULL_END
-#endif
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.m b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.m
deleted file mode 100644
index 1d083117b310..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/OMGHTTPURLRQ/Sources/OMGUserAgent.m
+++ /dev/null
@@ -1,19 +0,0 @@
-#import
-#import "OMGUserAgent.h"
-
-NSString *OMGUserAgent() {
- static NSString *ua;
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- id info = [NSBundle mainBundle].infoDictionary;
- id name = info[@"CFBundleDisplayName"] ?: info[(__bridge NSString *)kCFBundleIdentifierKey];
- id vers = (__bridge id)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleVersionKey) ?: info[(__bridge NSString *)kCFBundleVersionKey];
- #ifdef UIKIT_EXTERN
- float scale = ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [UIScreen mainScreen].scale : 1.0f);
- ua = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", name, vers, [UIDevice currentDevice].model, [UIDevice currentDevice].systemVersion, scale];
- #else
- ua = [NSString stringWithFormat:@"%@/%@", name, vers];
- #endif
- });
- return ua;
-}
diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj
deleted file mode 100644
index 1b6f460f95dd..000000000000
--- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,1626 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 01BD61BBC475EB3369237B84FE24D3EE /* UIViewController+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B892AF5EA37A5C7962FEA3E294B2526 /* UIViewController+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 0268F9278E32ACC1F996F4E2E45622B5 /* UIActionSheet+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 590BCD68D24A72708312E57A91360AC7 /* UIActionSheet+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 066335E8B1AEEB4CF633B2ED738D6223 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E01B70640812E104A60E8F985F7E9D /* Foundation.framework */; };
- 06F7C0C55DF4C09C015159F6B0802EB1 /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED547C24FF8AE5F91ED94E3BC8052C8 /* join.swift */; };
- 095406039B4D371E48D08B38A2975AC8 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7390892336E4D605CF390FFA4B55EF0A /* Error.swift */; };
- 0B34EB4425C08BB021C2D09F75C9C146 /* OMGHTTPURLRQ.h in Headers */ = {isa = PBXBuildFile; fileRef = 859DDC0FFB13DB9C838BA38D0641A1BA /* OMGHTTPURLRQ.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 0BDA43D8F48C8B0D504C440046FAF681 /* Umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B0B08C036B6283A3D528F1FBBEEF40EC /* Umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 0D240D796AAD10F0119A1D7AC2570AAA /* NSObject+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6650152803DA41F52DA6A26B5DF713D7 /* NSObject+Promise.swift */; };
- 11C221075C5B20BDEEB3DDF8EAC99E63 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = DCBC249F9443D7D79A42B5C4BAC874C8 /* NSNotificationCenter+AnyPromise.m */; };
- 11EA8D6B0352FD31F520F983CFB9D993 /* UIAlertView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FB7C011EC5C968D7A91E71A028913B7 /* UIAlertView+AnyPromise.m */; };
- 12348513CB81BD05B497C210905CDF65 /* UIAlertView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E19A7D44620C4AED963248648938767 /* UIAlertView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 124EFF5E3C46EC88F47C52479FA6ACAF /* CALayer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = DD83C2B5FF3BF5AB85E18B1BB6293857 /* CALayer+AnyPromise.m */; };
- 15ECEBA1EFBD023AEA47F36524270D2C /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0266C5AE0B23A436291F6647902086 /* Models.swift */; };
- 16102E4E35FAA0FC4161282FECE56469 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B728204DA3D60FAB04A757D3B09D2E /* Timeline.swift */; };
- 18FAC6B4FD3B44CB353C7A6027286100 /* NSURLConnection+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = E0B0C8D6D1D56B95983D680363E6F785 /* NSURLConnection+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 1AC7E88F0EC64D1D4E83CE7767BFD2B7 /* afterlife.swift in Sources */ = {isa = PBXBuildFile; fileRef = 178262A3EEE3B9A6F7B9B2B4ED5AA150 /* afterlife.swift */; };
- 1CB5E10963E95432A9674D1FF2B48FA1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E01B70640812E104A60E8F985F7E9D /* Foundation.framework */; };
- 1CDA074C6DC95876D85E13ECF882B93A /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */; };
- 1E1010EA437F154A554D04F7F3A894EC /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = B225BF6ADAA247F1300081D25732B5B4 /* Promise+Properties.swift */; };
- 25FBB92AFB8F5A777CE8E40EC3B9DACA /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; };
- 2B38BB4603B4286FF8D7A780372E947F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */; };
- 2D3405986FC586FA6C0A5E0B6BA7E64E /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435721889B71489503A007D233559DF /* Validation.swift */; };
- 2D9379807BA243E1CE457D1BE963DA09 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */; };
- 34CCDCA848A701466256BC2927DA8856 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFB0686D05BA9C4D5A69D6058C029FF2 /* NetworkReachabilityManager.swift */; };
- 3860D960E37C1257BDA54626CA592E86 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = D475FE9899956F5D2196D1C19DFC1F28 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 387C7387FDC662D23D743879B6143D59 /* UIActionSheet+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDBF73F440D96AB666A6418AEEF2946 /* UIActionSheet+Promise.swift */; };
- 3A8D316D4266A3309D0A98ED74F8A13A /* OMGUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FF818D195F8814F5F8878A2FD02AF1D /* OMGUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 3EA8F215C9C1432D74E5CCA4834AA8C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA62734652B80C3897AA655226B3BCF3 /* ResponseSerialization.swift */; };
- 4081EA628AF0B73AC51FFB9D7AB3B89E /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AA002805CE140B0968FC965A53F0A4C /* Manager.swift */; };
- 443361437B359830308B93A7B98BE039 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */; };
- 46F838880F41F56ABD91796FC956B4BF /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */; };
- 48CB8E7E16443CA771E4DCFB3E0709A2 /* OMGHTTPURLRQ.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EEC1FB4B45C5C247D2D0FB33D4F5A1D /* OMGHTTPURLRQ.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
- 4C22563311AC2B52651A6525A979E076 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = EA13BF2FADA101A1AB34BF5EC8C7BA85 /* UIView+AnyPromise.m */; };
- 516D41E4D035A817CC5116C11302E408 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */; };
- 5192A7466019F9B3D7F1E987124E96BC /* OMGHTTPURLRQ-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3029ADF04ADC2B8F3A7264A416D70B56 /* OMGHTTPURLRQ-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 5480169E42C456C49BE59E273D7E0115 /* OMGFormURLEncode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B1578E353CE37C4C4201EC9101DE67F /* OMGFormURLEncode.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 5BC19E6E0F199276003F0AF96838BCE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9E0C3DC76C639C91EF9B920C8E3D60F /* Upload.swift */; };
- 5CB05FBCB32D21E194B5ECF680CB6AE0 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 770621722C3B98D9380F76F3310EAA7F /* Download.swift */; };
- 5D7EAE5725A7E750B51FD27AECB5F0FD /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = E3B8EDBFFE2A701981A073412ECCF6AD /* join.m */; };
- 5EE5E1CA27F3CB04A5DCF5BB90B76000 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */; };
- 5FFED823C0BDD412FA41B01EA47394D1 /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = 955F5499BB7496155FBF443B524F1D50 /* hang.m */; };
- 60EBBACB76CD5879FB7B9B3E0AA5E2C1 /* UIViewController+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F1201EF49979297542207D6EB6EC55 /* UIViewController+AnyPromise.m */; };
- 62E8346F03C03E7F4D631361F325689E /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74E1D5C24530737CDD54FA854E37B371 /* Response.swift */; };
- 656BED6137A9FFA3B2DF03861F525022 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 6A128FE350973D8A693E3F063C5E4A49 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = 7356B0365E4182E6E6D55124C678B591 /* dispatch_promise.m */; };
- 6B0A17CD24331793D2504E0FBBAF5EB2 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */; };
- 6CB84A616D7B4D189A4E94BD37621575 /* OMGUserAgent.m in Sources */ = {isa = PBXBuildFile; fileRef = 937CB6976C5F585A76A9383107F5AF73 /* OMGUserAgent.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
- 6F63943B0E954F701F32BC7A1F4C2FEC /* OMGFormURLEncode.m in Sources */ = {isa = PBXBuildFile; fileRef = 56CDA7C9327CF6F3DFC66FC128D7365B /* OMGFormURLEncode.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
- 73FA79FDB37E5C458B996012BFB0CF04 /* PMKAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0608A7843513940A299A88D778388F9D /* PMKAlertController.swift */; };
- 7B48852C4D848FA2DA416A98F6425869 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D1D96AB285E285A3CC15FAD1CD875B2 /* ServerTrustPolicy.swift */; };
- 7D7A40DBAC93241786E8C553921E8C86 /* OMGHTTPURLRQ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */; };
- 81A2DB65C0742D785DE7C2609CC14140 /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A5AEB5CADDFFFC419A0D8D6FD914800 /* NSURLSession+Promise.swift */; };
- 825D1C93689636D09044C5077E5D905F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 355303D423040E9AB8E2164D8C903B23 /* UIKit.framework */; };
- 857E5961D9F6E23BD86DEB613A1499C7 /* NSError+Cancellation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E9E05F82273A09FD6E5CA99FD3A74D9 /* NSError+Cancellation.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 88B3F911629C08DEEB226F3B294AAB36 /* NSNotificationCenter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 786AAA1F62613C489FD473D4CE16127A /* NSNotificationCenter+Promise.swift */; };
- 897283A0B7F5299913327CC8FD6CC997 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 8C4A96A3E69C772990E3E922D0FD1BC4 /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 13DB7D7990FD3354E34510894CC30CD1 /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 8D3A68D3CBD8A1D89099F704A04A04FC /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B09DEE52CBDEC1EA108DD327EF036F4A /* PromiseKit-dummy.m */; };
- 8E3861989641484EE3095722EC08B5A9 /* NSURLConnection+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = D9A940E08D42AC7D07C6B74D3310C69A /* NSURLConnection+AnyPromise.m */; };
- 8EB11202167FCDDF1257AAAB1D1FB244 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA7C65B58A0E739E615FA7A750AA0AD /* Alamofire.swift */; };
- 909B0A29022956D90C32C4AA319F75D1 /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = EC8150042B23FCA7DF9979098694EC0B /* AnyPromise.m */; };
- 91C09AC2A52ED69A27C8D923139A006F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E01B70640812E104A60E8F985F7E9D /* Foundation.framework */; };
- 9469DF81ECB494E84675969B5E13374C /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 791F2A99A7894F88F8BBAE2F6C627522 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 97D71F12142A541BEEF425805D51379E /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC07412ABFB8D5A06E7B38380FFD9C4 /* race.swift */; };
- 9876AE0817723FB5E93A94B1E1906901 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; };
- 9CFBA896DF45B68C788F80013AC3FDBB /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1D1571AB15108DF6F9C4FE2064E3C43 /* Alamofire.framework */; };
- A4BA36ADDDFBCF208CC58E552C0AC85C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E01B70640812E104A60E8F985F7E9D /* Foundation.framework */; };
- AA314156AC500125F4078EE968DB14C6 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F60254382C7024DDFD16533FB81750A /* Result.swift */; };
- ADEEE5F368B5D707D03E78FD75C59048 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB573F3C977C55072704AA24EC06164 /* Promise.swift */; };
- ADF19C953CE2A7D0B72EC93A81FCCC26 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F0962CCF21BDD2EB5751C14F9322AFC9 /* Alamofire-dummy.m */; };
- AE4CF87C02C042DF13ED5B21C4FDC1E0 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCC88BB5150F5865EE3017D1B9AB4CF5 /* Stream.swift */; };
- BE41196F6A3903E59C3306FE3F8B43FE /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9519BB8B059D8A17CE43587EB6EFA61D /* Notifications.swift */; };
- C0DB70AB368765DC64BFB5FEA75E0696 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B2CF9B72BC56E74E6B0037BDE92031 /* ParameterEncoding.swift */; };
- C141DD535C090B58DD95D53988AAA42B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E01B70640812E104A60E8F985F7E9D /* Foundation.framework */; };
- C546890220177F840E8AFC829D0E3FEB /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; };
- C7B6DD7C0456C50289A2C381DFE9FA3F /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA79CBD1DDA33C45473F8807605719BC /* MultipartFormData.swift */; };
- C86881D2285095255829A578F0A85300 /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 4765491FCD8E096D84D4E57E005B8B49 /* after.m */; };
- C86CE0A47FAD4C9B2929A335D62A179E /* UIViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7C40ADE30634419CED97EC829EE5D2C /* UIViewController+Promise.swift */; };
- CAF12A3EDA2376FFEAD4A12E413C1AAD /* UIActionSheet+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = CABB6C822D84DC5F0596B6D7B60CC5AA /* UIActionSheet+AnyPromise.m */; };
- CB2A58CBAB5A2E63D0CB70F2697CAE87 /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C307C0A58A490D3080DB4C1E745C973 /* when.m */; };
- CD97970D21D3CB8C459FAFEF11EE60F3 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */; };
- CE225CF07E6E385F014883D607AFA44D /* URLDataPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E339112CF5C9275CFBEB94C29AD250B /* URLDataPromise.swift */; };
- CE89E5C528D52BBCBCD23309603BA6D1 /* CALayer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = E48946E76C93EE81F20C76C0EE272B8E /* CALayer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- D1735D6C4D574339EB49024228448459 /* UIView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E69FDAAF09817F0BA67D7C575BAFF48 /* UIView+Promise.swift */; };
- D358A828E68E152D06FC8E35533BF00B /* OMGHTTPURLRQ-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F88352C39FB2D4A0D36696674E7C05D /* OMGHTTPURLRQ-dummy.m */; };
- D546A4DBA3F7750F45A6F63B994C081C /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */; };
- D93596046CD3B301F4EC99A7A118C82C /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFFF6310B8F8C445362FF33E936F85CA /* Error.swift */; };
- D97B0097ACB39F4E308E996F4F2AC836 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
- DBD1F4247E1C591AE4EE5531599AB170 /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = EFC77A5BCF407679FAB606F03E631A11 /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
- E2B0094FAAEA55C55AD141136F650E35 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */; };
- EA35E77B4F31DC3E1D224458E0BC959D /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8072E1108951F272C003553FC8926C7 /* APIs.swift */; };
- EA67B414E392EFD2B14742F55A595596 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E49ED544745AD479AFA0B6766F441CE /* after.swift */; };
- EB3C88CDAF122BA763FEF85758370C7C /* UIAlertView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E29EB54AEC61300AD412C40991FFED5 /* UIAlertView+Promise.swift */; };
- EB9A1F33DB49ADA09F6E7F19A2C30357 /* NSURLConnection+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9066E09FAD7A3236DAD81317C1E48214 /* NSURLConnection+Promise.swift */; };
- ED30A8B82BA1D53CBC370B1DC18DA1EB /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEFA2BBF978F33CA2112DC5D6209A3EF /* when.swift */; };
- EFE92E8D3813DD26E78E93EEAF6D7E7E /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D3192434754120C2AAF44818AEE054B /* Request.swift */; };
- F206C370F63155D3468E0C188498C5DC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E01B70640812E104A60E8F985F7E9D /* Foundation.framework */; };
- F4582E8DC1C9F362ADA4BAE9CEF8B681 /* dispatch_promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85FD17541BFB4152FD5F2CA46F9E3ACC /* dispatch_promise.swift */; };
- F700EAA9F9F6C1F99C83B45D05C5AD14 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAED38B682D186542DC2B8D273486F4 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
- F7161E50F083B2267363F243C4E4B78F /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB5ABB73E12675999DE989CC2478A7A /* AnyPromise.swift */; };
- F898D4270885EF1114608E76B0C09E21 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BEE20F7C5242E616D2D97B5FBE31323 /* State.swift */; };
- FB0B33F03AC2BC8A7FC7FD912C12CC22 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A112EF8BB3933C1C1E42F11B3DD3B02A /* PromiseKit.framework */; };
- FFA95B8BEE43D793FF453E49099AC52E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B92202857E3535647B0785253083518 /* QuartzCore.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 4BED27A854EA6600536518D29BBB3670 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 79C040AFDDCE1BCBF6D8B5EB0B85887F;
- remoteInfo = Alamofire;
- };
- 6795BDA8BF074DFC4E5D1758C8F88C2A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 2FD913B4E24277823983BABFDB071664;
- remoteInfo = PetstoreClient;
- };
- 7DE91DDF2036FF7431AF3F0DAD4A9C87 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 25EDA9CFC641C69402B3857A2C4A39F0;
- remoteInfo = PromiseKit;
- };
- 8059767A82D94C9F7F7C16D030819C4E /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 190ACD3A51BC90B85EADB13E9CDD207B;
- remoteInfo = OMGHTTPURLRQ;
- };
- 8E08EC4F5A85093B738D80C4F04BA3F1 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 79C040AFDDCE1BCBF6D8B5EB0B85887F;
- remoteInfo = Alamofire;
- };
- ABF692D458113B268763EDC4670EAF7A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 190ACD3A51BC90B85EADB13E9CDD207B;
- remoteInfo = OMGHTTPURLRQ;
- };
- ECAC5E4454026C822004659466983ADD /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 25EDA9CFC641C69402B3857A2C4A39F0;
- remoteInfo = PromiseKit;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
- 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; };
- 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; };
- 0435721889B71489503A007D233559DF /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; };
- 0608A7843513940A299A88D778388F9D /* PMKAlertController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PMKAlertController.swift; path = Categories/UIKit/PMKAlertController.swift; sourceTree = ""; };
- 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; };
- 0B92202857E3535647B0785253083518 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
- 0C552CDBDD89D489D23D5D4E28356F84 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 0E339112CF5C9275CFBEB94C29AD250B /* URLDataPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URLDataPromise.swift; path = Sources/URLDataPromise.swift; sourceTree = ""; };
- 10A634092EE6D018EB00C75E9864A6A2 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; };
- 11683764D40FE241FCEEB379EE92E817 /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; };
- 13DB7D7990FD3354E34510894CC30CD1 /* UIView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+AnyPromise.h"; path = "Categories/UIKit/UIView+AnyPromise.h"; sourceTree = ""; };
- 178262A3EEE3B9A6F7B9B2B4ED5AA150 /* afterlife.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = afterlife.swift; path = Categories/Foundation/afterlife.swift; sourceTree = ""; };
- 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; };
- 1AA002805CE140B0968FC965A53F0A4C /* Manager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Manager.swift; path = Source/Manager.swift; sourceTree = ""; };
- 1AAED38B682D186542DC2B8D273486F4 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; };
- 1F60254382C7024DDFD16533FB81750A /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; };
- 1FB5ABB73E12675999DE989CC2478A7A /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; };
- 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; };
- 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; };
- 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; };
- 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; };
- 2E750A27FAB06DE866BC27CC8FA07806 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; };
- 2E9E05F82273A09FD6E5CA99FD3A74D9 /* NSError+Cancellation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSError+Cancellation.h"; path = "Sources/NSError+Cancellation.h"; sourceTree = ""; };
- 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; };
- 3029ADF04ADC2B8F3A7264A416D70B56 /* OMGHTTPURLRQ-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OMGHTTPURLRQ-umbrella.h"; sourceTree = ""; };
- 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OMGHTTPURLRQ.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 355303D423040E9AB8E2164D8C903B23 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
- 3B1578E353CE37C4C4201EC9101DE67F /* OMGFormURLEncode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OMGFormURLEncode.h; path = Sources/OMGFormURLEncode.h; sourceTree = ""; };
- 3BEE20F7C5242E616D2D97B5FBE31323 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; };
- 3E49ED544745AD479AFA0B6766F441CE /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; };
- 3EC07412ABFB8D5A06E7B38380FFD9C4 /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; };
- 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; };
- 3EEC1FB4B45C5C247D2D0FB33D4F5A1D /* OMGHTTPURLRQ.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGHTTPURLRQ.m; path = Sources/OMGHTTPURLRQ.m; sourceTree = ""; };
- 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; };
- 467F288FF1A023115720F192FD4D9297 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = ""; };
- 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; };
- 4765491FCD8E096D84D4E57E005B8B49 /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; };
- 47B728204DA3D60FAB04A757D3B09D2E /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; };
- 4E19A7D44620C4AED963248648938767 /* UIAlertView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIAlertView+AnyPromise.h"; path = "Categories/UIKit/UIAlertView+AnyPromise.h"; sourceTree = ""; };
- 4FF818D195F8814F5F8878A2FD02AF1D /* OMGUserAgent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OMGUserAgent.h; path = Sources/OMGUserAgent.h; sourceTree = ""; };
- 53F1201EF49979297542207D6EB6EC55 /* UIViewController+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+AnyPromise.m"; path = "Categories/UIKit/UIViewController+AnyPromise.m"; sourceTree = ""; };
- 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; };
- 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; };
- 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; };
- 56CDA7C9327CF6F3DFC66FC128D7365B /* OMGFormURLEncode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGFormURLEncode.m; path = Sources/OMGFormURLEncode.m; sourceTree = ""; };
- 590BCD68D24A72708312E57A91360AC7 /* UIActionSheet+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActionSheet+AnyPromise.h"; path = "Categories/UIKit/UIActionSheet+AnyPromise.h"; sourceTree = ""; };
- 5A5AEB5CADDFFFC419A0D8D6FD914800 /* NSURLSession+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSURLSession+Promise.swift"; path = "Categories/Foundation/NSURLSession+Promise.swift"; sourceTree = ""; };
- 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; };
- 5E69FDAAF09817F0BA67D7C575BAFF48 /* UIView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Promise.swift"; path = "Categories/UIKit/UIView+Promise.swift"; sourceTree = ""; };
- 6650152803DA41F52DA6A26B5DF713D7 /* NSObject+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Promise.swift"; path = "Categories/Foundation/NSObject+Promise.swift"; sourceTree = ""; };
- 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; };
- 705D1370384B46A3E5A39B39E7B4D181 /* OMGHTTPURLRQ-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OMGHTTPURLRQ-prefix.pch"; sourceTree = ""; };
- 7356B0365E4182E6E6D55124C678B591 /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; };
- 7390892336E4D605CF390FFA4B55EF0A /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Source/Error.swift; sourceTree = ""; };
- 74E1D5C24530737CDD54FA854E37B371 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; };
- 770621722C3B98D9380F76F3310EAA7F /* Download.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Download.swift; path = Source/Download.swift; sourceTree = ""; };
- 786AAA1F62613C489FD473D4CE16127A /* NSNotificationCenter+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Promise.swift"; path = "Categories/Foundation/NSNotificationCenter+Promise.swift"; sourceTree = ""; };
- 791F2A99A7894F88F8BBAE2F6C627522 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; };
- 79E01B70640812E104A60E8F985F7E9D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
- 7B892AF5EA37A5C7962FEA3E294B2526 /* UIViewController+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+AnyPromise.h"; path = "Categories/UIKit/UIViewController+AnyPromise.h"; sourceTree = ""; };
- 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 7D3192434754120C2AAF44818AEE054B /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; };
- 835E52C658674D7A44ED95B966432726 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; };
- 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; };
- 859DDC0FFB13DB9C838BA38D0641A1BA /* OMGHTTPURLRQ.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OMGHTTPURLRQ.h; path = Sources/OMGHTTPURLRQ.h; sourceTree = ""; };
- 85FD17541BFB4152FD5F2CA46F9E3ACC /* dispatch_promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = dispatch_promise.swift; path = Sources/dispatch_promise.swift; sourceTree = ""; };
- 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; };
- 8D1D96AB285E285A3CC15FAD1CD875B2 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; };
- 8E29EB54AEC61300AD412C40991FFED5 /* UIAlertView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIAlertView+Promise.swift"; path = "Categories/UIKit/UIAlertView+Promise.swift"; sourceTree = ""; };
- 8F0266C5AE0B23A436291F6647902086 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; };
- 8F8078A9DEC41CD886A8676D889912A4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 8F88352C39FB2D4A0D36696674E7C05D /* OMGHTTPURLRQ-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OMGHTTPURLRQ-dummy.m"; sourceTree = ""; };
- 9066E09FAD7A3236DAD81317C1E48214 /* NSURLConnection+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSURLConnection+Promise.swift"; path = "Categories/Foundation/NSURLConnection+Promise.swift"; sourceTree = ""; };
- 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = "