diff --git a/Package.swift b/Package.swift index 22eb7a0..49f187e 100644 --- a/Package.swift +++ b/Package.swift @@ -23,16 +23,16 @@ let package = Package( "PostieUtils", "XMLCoder", ]), - .testTarget(name: "PostieTests", dependencies: [ - "Postie", - "PostieMock" - ]), + // dev .testTarget(name: "PostieTests", dependencies: [ + // dev "Postie", + // dev "PostieMock" + // dev ]), .target(name: "PostieMock", dependencies: ["Postie"]), .target(name: "URLEncodedFormCoding", dependencies: ["PostieUtils"]), .target(name: "PostieUtils"), - .testTarget(name: "PostieUtilsTests", dependencies: ["PostieUtils"]) + // dev .testTarget(name: "PostieUtilsTests", dependencies: ["PostieUtils"]) ] ) diff --git a/Sources/Postie/Headers/RequestHeaderValue.swift b/Sources/Postie/Headers/RequestHeaderValue.swift index 4d49e33..9d38379 100644 --- a/Sources/Postie/Headers/RequestHeaderValue.swift +++ b/Sources/Postie/Headers/RequestHeaderValue.swift @@ -1,3 +1,7 @@ +/// A type that can be used as a value for an HTTP header. +/// +/// The `RequestHeaderValue` protocol defines a type that can be used as a value for an HTTP header. +/// It requires conforming types to provide a `serializedHeaderValue` property that returns a string representation of the header value. public protocol RequestHeaderValue { /// The serialized value of the header. /// diff --git a/Sources/Postie/Path/RequestPathParameterValue.swift b/Sources/Postie/Path/RequestPathParameterValue.swift index 29590f5..bf0edd5 100644 --- a/Sources/Postie/Path/RequestPathParameterValue.swift +++ b/Sources/Postie/Path/RequestPathParameterValue.swift @@ -1,3 +1,7 @@ +/// A type that can be used as a value for a request path parameter. +/// +/// The `RequestPathParameterValue` protocol defines a type that can be used as a value for a request path parameter. +/// It requires conforming types to provide a `serialized` property that returns a string representation of the path parameter value. public protocol RequestPathParameterValue { /// The serialized value of the path parameter. /// diff --git a/Sources/Postie/Query/QueryItem.swift b/Sources/Postie/Query/QueryItem.swift index ce00990..38463ae 100644 --- a/Sources/Postie/Query/QueryItem.swift +++ b/Sources/Postie/Query/QueryItem.swift @@ -1,3 +1,7 @@ +/// A type that can be used as a value for a query item. +/// +/// The `QueryItemValue` protocol defines a type that can be used as a value for a query item. +/// It requires conforming types to provide a `serialized` property that returns a string representation of the query item value. internal protocol QueryItemProtocol { /// Custom name of the query item, can be nil var name: String? { get } @@ -171,8 +175,21 @@ extension QueryItem where T == String? { // MARK: - OptionalType +/// A type that can be used as a value for a query item. +/// +/// The `OptionalType` protocol defines a type that can be used as a value for a query item. +/// It requires conforming types to provide a `none` property that returns a nil value. public protocol OptionalType { + /// The type of the wrapped value. + /// + /// This property represents the type of the wrapped value. + /// It is used to represent the type of the wrapped value for the optional type. associatedtype Wrapped + + /// The nil value of the optional type. + /// + /// This property represents the nil value of the optional type. + /// It is used to represent a nil value for the optional type. static var none: Self { get } } diff --git a/Sources/Postie/Query/QueryItemValue.swift b/Sources/Postie/Query/QueryItemValue.swift index e20547b..03936c8 100644 --- a/Sources/Postie/Query/QueryItemValue.swift +++ b/Sources/Postie/Query/QueryItemValue.swift @@ -1,3 +1,7 @@ +/// A type that can be used as a value for a query item. +/// +/// The `QueryItemValue` protocol defines a type that can be used as a value for a query item. +/// It requires conforming types to provide a `serializedQueryItem` property that returns a string representation of the query item value. public protocol QueryItemValue { /// The serialized value of the query item. /// diff --git a/Sources/Postie/Responses/NestedResponse.swift b/Sources/Postie/Responses/NestedResponse.swift index 4a4c90b..11efcc5 100644 --- a/Sources/Postie/Responses/NestedResponse.swift +++ b/Sources/Postie/Responses/NestedResponse.swift @@ -1,3 +1,29 @@ +/// A property wrapper that wraps a nested response. +/// +/// To support inheritance, which can be especially useful for pagination, use the property wrapper `@NestedResponse` to add nested responses. +/// +/// While decoding the flat HTTP response will be applied recursively to all nested responses, therefore it is possible, that different nested responses access different values of the original HTTP response. +/// +/// **Example:** +/// +/// ```swift +/// struct PaginatedResponse: Decodable { +/// +/// /// Header which indicates how many more elements are available +/// @ResponseHeader var totalElements +/// +/// @NestedResponse var nested: NestedRequest +/// } +/// +/// struct ListRequest: Request { +/// +/// typealias Response = PaginatedResponse +/// +/// struct ListResponse: Decodable { +/// // see other examples +/// } +/// } +/// ``` @propertyWrapper public struct NestedResponse { /// The wrapped value representing the nested response. diff --git a/Sources/Postie/Responses/ResponseBody/ResponseBodyWrapper.swift b/Sources/Postie/Responses/ResponseBody/ResponseBodyWrapper.swift index e7b35af..e60bac7 100644 --- a/Sources/Postie/Responses/ResponseBody/ResponseBodyWrapper.swift +++ b/Sources/Postie/Responses/ResponseBody/ResponseBodyWrapper.swift @@ -1,3 +1,12 @@ +/// A property wrapper that wraps a response body. +/// +/// The `ResponseBodyWrapper` property wrapper is used to wrap a response body value. +/// It provides a `wrappedValue` property that holds the response body value. +/// +/// Example usage: +/// ``` +/// @ResponseBodyWrapper var responseBody: MyResponseType? +/// ``` @propertyWrapper public struct ResponseBodyWrapper { /// The wrapped value representing the decoded response body. @@ -31,6 +40,14 @@ public struct ResponseBodyWrapper { /// The wrapped value representing the decoded error response body. @@ -30,7 +39,16 @@ public struct ResponseErrorBodyWrapper, value: Int) -> Bool { guard let status = HTTPStatusCode(rawValue: UInt16(value)) else { return false diff --git a/docs/Classes.html b/docs/Classes.html new file mode 100644 index 0000000..fe5eaac --- /dev/null +++ b/docs/Classes.html @@ -0,0 +1,387 @@ + + + + Classes Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Classes/HTTPAPIClient.html b/docs/Classes/HTTPAPIClient.html new file mode 100644 index 0000000..e358c9e --- /dev/null +++ b/docs/Classes/HTTPAPIClient.html @@ -0,0 +1,1479 @@ + + + + HTTPAPIClient Class Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

HTTPAPIClient

+
+
+ +
open class HTTPAPIClient
+ +
+
+

A class responsible for sending HTTP API requests and handling responses.

+ +

The HTTPAPIClient class provides methods to send HTTP API requests using different encoding formats +and handle the responses. It supports callbacks, async-await, and Combine for handling responses.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + session + +
    +
    +
    +
    +
    +
    +

    The URL session provider used for sending requests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var session: URLSessionProvider { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + url + +
    +
    +
    +
    +
    +
    +

    The base URL for the API requests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var url: URL
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + pathPrefix + +
    +
    +
    +
    +
    +
    +

    An optional path prefix to be appended to the base URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var pathPrefix: String?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of HTTPAPIClient with the specified URL, path prefix, and session provider.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(url: URL, pathPrefix: String? = nil, session: URLSessionProvider = URLSession.shared)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + url + + +
    +

    The base URL for the API requests.

    +
    +
    + + pathPrefix + + +
    +

    An optional path prefix to be appended to the base URL.

    +
    +
    + + session + + +
    +

    The URL session provider used for sending requests. Defaults to URLSession.shared.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Callbacks +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<R>(_ request: R, receiveOn queue: DispatchQueue? = nil, callback: @escaping (Result<R.Response, Error>) -> Void) where R : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a JSON body using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myJsonRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request: JSONRequest>(
    +    _ request: Request,
    +    receiveOn queue: DispatchQueue? = nil,
    +    callback: @escaping (
    +        Result<Request.Response, Error>
    +    ) -> Void
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a Form URL Encoded body using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myFormURLEncodedRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request: FormURLEncodedRequest>(
    +    _ request: Request,
    +    receiveOn queue: DispatchQueue? = nil,
    +    callback: @escaping (
    +        Result<Request.Response, Error>
    +    ) -> Void
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a plain text body using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myPlainRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request: PlainRequest>(
    +    _ request: Request,
    +    receiveOn queue: DispatchQueue? = nil,
    +    callback: @escaping (
    +        Result<Request.Response, Error>
    +    ) -> Void
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Async-Await +

+
+
+
    +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<R>(_ request: R) async throws -> R.Response where R : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a JSON body using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myJsonRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) async throws -> Request.Response where Request : JSONBodyProvider, Request : JSONFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a Form URL Encoded body using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myFormURLEncodedRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) async throws -> Request.Response where Request : FormURLEncodedBodyProvider, Request : FormURLEncodedFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a plain text body using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myPlainRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) async throws -> Request.Response where Request : PlainBodyProvider, Request : PlainFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Combine +

+
+
+
    +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<R>(_ request: R) -> AnyPublisher<R.Response, Error> where R : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a JSON body using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myJsonRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) -> AnyPublisher<Request.Response, Error> where Request : JSONBodyProvider, Request : JSONFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a Form URL Encoded body using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myFormURLEncodedRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) -> AnyPublisher<Request.Response, Error> where Request : FormURLEncodedBodyProvider, Request : FormURLEncodedFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a plain text body using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myPlainRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) -> AnyPublisher<Request.Response, Error> where Request : PlainBodyProvider, Request : PlainFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Classes/RequestEncoder.html b/docs/Classes/RequestEncoder.html new file mode 100644 index 0000000..6da7b63 --- /dev/null +++ b/docs/Classes/RequestEncoder.html @@ -0,0 +1,793 @@ + + + + RequestEncoder Class Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestEncoder

+
+
+ +
public class RequestEncoder
+
extension RequestEncoder: TopLevelEncoder
+ +
+
+

A class responsible for encoding HTTP requests into various formats.

+ +

The RequestEncoder class provides functionality to encode HTTP requests into different formats, +including JSON, Form URL Encoded, Plain, and XML. It uses the RequestEncoding encoder to perform +the encoding process.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(baseURL:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestEncoder with the specified base URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(baseURL: URL)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + baseURL + + +
    +

    The base URL for the requests.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + encode(_:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encode(myRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encode<Request>(_ request: Request) throws -> URLRequest where Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

JSON +

+
+
+
    +
  • +
    + + + + encodeJson(request:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request with a JSON body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodeJson(request: myJsonRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodeJson<Request>(request: Request) throws -> URLRequest where Request : JSONBodyProvider, Request : JSONFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Form URL Encoded +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Encodes an HTTP request with a Form URL Encoded body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodeFormURLEncoded(request: myFormURLEncodedRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodeFormURLEncoded<Request>(request: Request) throws -> URLRequest where Request : FormURLEncodedBodyProvider, Request : FormURLEncodedFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Plain +

+
+
+
    +
  • +
    + + + + encodePlain(request:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request with a plain text body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodePlain(request: myPlainRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodePlain<Request>(request: Request) throws -> URLRequest where Request : PlainBodyProvider, Request : PlainFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

XML +

+
+
+
    +
  • +
    + + + + encodeXML(request:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request with an XML body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodeXML(request: myXmlRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodeXML<Request>(request: Request) throws -> URLRequest where Request : XMLBodyProvider, Request : XMLFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Classes/ResponseDecoder.html b/docs/Classes/ResponseDecoder.html new file mode 100644 index 0000000..950fbde --- /dev/null +++ b/docs/Classes/ResponseDecoder.html @@ -0,0 +1,451 @@ + + + + ResponseDecoder Class Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseDecoder

+
+
+ +
public class ResponseDecoder
+
extension ResponseDecoder: TopLevelDecoder
+ +
+
+

A class responsible for decoding HTTP responses into specified types.

+ +

The ResponseDecoder class provides functionality to decode HTTP responses into specified types. +It uses the ResponseDecoding decoder to perform the decoding process.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decode(_:from:) + +
    +
    +
    +
    +
    +
    +

    Decodes an HTTP response into the specified type.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +

    Example usage:

    +
    let decoder = ResponseDecoder()
    +let decodedValue = try decoder.decode(MyType.self, from: (data: responseData, response: httpResponse))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func decode<T>(_ type: T.Type, from: (data: Data, response: HTTPURLResponse)) throws -> T where T : Decodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + type + + +
    +

    The type to decode the response into.

    +
    +
    + + from + + +
    +

    A tuple containing the response data and the HTTP URL response.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded value of the specified type.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Enums.html b/docs/Enums.html new file mode 100644 index 0000000..2d25a44 --- /dev/null +++ b/docs/Enums.html @@ -0,0 +1,396 @@ + + + + Enumerations Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Enums/APIDataFormat.html b/docs/Enums/APIDataFormat.html new file mode 100644 index 0000000..440fe15 --- /dev/null +++ b/docs/Enums/APIDataFormat.html @@ -0,0 +1,507 @@ + + + + APIDataFormat Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

APIDataFormat

+
+
+ +
public enum APIDataFormat
+ +
+
+

Represents the format of API data.

+ +

The APIDataFormat enum defines the format of data used in API requests and responses. +It provides different cases for various data formats, such as plain text, JSON, form URL encoded, and XML.

+ +

Example usage:

+
let format: APIDataFormat = .json
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + plain + +
    +
    +
    +
    +
    +
    +

    Plain text format.

    + +

    This case represents the plain text format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case plain
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + json + +
    +
    +
    +
    +
    +
    +

    JSON format.

    + +

    This case represents the JSON format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case json
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formURLEncoded + +
    +
    +
    +
    +
    +
    +

    Form URL encoded format.

    + +

    This case represents the form URL encoded format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case formURLEncoded
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + xml + +
    +
    +
    +
    +
    +
    +

    XML format.

    + +

    This case represents the XML format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case xml
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Enums/APIError.html b/docs/Enums/APIError.html new file mode 100644 index 0000000..7671cfe --- /dev/null +++ b/docs/Enums/APIError.html @@ -0,0 +1,724 @@ + + + + APIError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

APIError

+
+
+ +
public enum APIError : LocalizedError
+ +
+
+

Represents various errors that can occur when interacting with the API.

+ +

The APIError enum provides a comprehensive list of errors that can occur when interacting with the API. +Each case represents a specific type of error, and the associated values provide additional context or information +about the error.

+
+

See also

+ LocalizedError for more information on localized error descriptions. + +
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates a response error with a specific status code and data.

    + +

    This error occurs when the API returns a response with a non-success status code. +The associated values provide the status code and the response data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case responseError(statusCode: Int, data: Data)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    + + data + + +
    +

    The response data.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + invalidResponse + +
    +
    +
    +
    +
    +
    +

    Indicates an invalid response.

    + +

    This error occurs when the API returns an invalid response, such as a response with missing or malformed data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case invalidResponse
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + urlError(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates a URL error.

    + +

    This error occurs when there is an issue with the URL, such as a network connectivity problem or an invalid URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case urlError(URLError)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    The underlying URLError that caused the failure.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + decodingError(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates a decoding error.

    + +

    This error occurs when there is an issue decoding the response data into the expected type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case decodingError(DecodingError)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    The underlying DecodingError that caused the failure.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Indicates a failure to encode plain text with a specific encoding.

    + +

    This error occurs when there is an issue encoding plain text data using the specified encoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failedToEncodePlainText(encoding: String.Encoding)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + encoding + + +
    +

    The String.Encoding used for encoding.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + unknown(error:) + +
    +
    +
    +
    +
    +
    +

    Indicates an unknown error.

    + +

    This error occurs when an unknown error is encountered.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknown(error: Error)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    The underlying Error that caused the failure.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + errorDescription + +
    +
    +
    +
    +
    +
    +

    A localized message describing what error occurred.

    + +

    This property provides a human-readable description of the error, which can be used for displaying error messages +to the user.

    + +

    Example usage:

    +
    let error: APIError = .invalidResponse
    +print(error.errorDescription ?? "Unknown error")
    +// Output: "Received invalid URL response"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var errorDescription: String? { get }
    + +
    +
    +
    +

    Return Value

    +

    A localized string describing the error.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Enums/HTTPMethod.html b/docs/Enums/HTTPMethod.html new file mode 100644 index 0000000..3319823 --- /dev/null +++ b/docs/Enums/HTTPMethod.html @@ -0,0 +1,644 @@ + + + + HTTPMethod Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

HTTPMethod

+
+
+ +
public enum HTTPMethod : String, Encodable
+ +
+
+

Common HTTP Methods

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + get + +
    +
    +
    +
    +
    +
    +

    The GET method requests a representation of the specified resource.

    + +

    Requests using GET should only retrieve data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case get = "GET"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + head + +
    +
    +
    +
    +
    +
    +

    The HEAD method asks for a response identical to that of a GETrequest, but without the response body.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case head = "HEAD"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + post + +
    +
    +
    +
    +
    +
    +

    The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case post = "POST"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + put + +
    +
    +
    +
    +
    +
    +

    The PUT method replaces all current representations of the target resource with the request payload.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case put = "PUT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete + +
    +
    +
    +
    +
    +
    +

    The DELETE method deletes the specified resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case delete = "DELETE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + connect + +
    +
    +
    +
    +
    +
    +

    The CONNECT method establishes a tunnel to the server identified by the target resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case connect = "CONNECT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + options + +
    +
    +
    +
    +
    +
    +

    The OPTIONS method is used to describe the communication options for the target resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case options = "OPTIONS"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + trace + +
    +
    +
    +
    +
    +
    +

    The TRACE method performs a message loop-back test along the path to the target resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case trace = "TRACE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + patch + +
    +
    +
    +
    +
    +
    +

    The PATCH method is used to apply partial modifications to a resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case patch = "PATCH"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Enums/HTTPStatusCode.html b/docs/Enums/HTTPStatusCode.html new file mode 100644 index 0000000..d49bab1 --- /dev/null +++ b/docs/Enums/HTTPStatusCode.html @@ -0,0 +1,2557 @@ + + + + HTTPStatusCode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

HTTPStatusCode

+
+
+ +
public enum HTTPStatusCode : UInt16
+
extension HTTPStatusCode: Comparable, Equatable
+ +
+
+

Common HTTP Status Codes

+ +

Reference: Wikipedia

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + continue + +
    +
    +
    +
    +
    +
    +

    The server has received the request headers and the client should proceed to send the request body (in the +case of a request for which a body needs to be sent; for example, a POST request).

    + +

    Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient. +To have a server check the request’s headers, a client must send Expect: 100-continue as a header in its initial request +and receive a 100 Continue status code in response before sending the body. +If the client receives an error code such as 403 (Forbidden) or 405 (Method Not Allowed) then it should not send the request’s body. +The response 417 Expectation Failed indicates that the request should be repeated without the Expect header as it indicates +that the server does not support expectations (this is the case, for example, of HTTP/1.0 servers).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `continue` = 100
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + switchingProtocols + +
    +
    +
    +
    +
    +
    +

    The requester has asked the server to switch protocols and the server has agreed to do so.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case switchingProtocols = 101
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + processing + +
    +
    +
    +
    +
    +
    +

    A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.

    + +

    This code indicates that the server has received and is processing the request, but no response is available yet. +This prevents the client from timing out and assuming the request was lost.

    + +

    (WebDAV; RFC 2518)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case processing = 102
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + earlyHints + +
    +
    +
    +
    +
    +
    +

    Used to return some response headers before final HTTP message.

    + +

    (RFC 8297)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case earlyHints = 103
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ok + +
    +
    +
    +
    +
    +
    +

    Standard response for successful HTTP requests. +The actual response will depend on the request method used. +In a GET request, the response will contain an entity corresponding to the requested resource. +In a POST request, the response will contain an entity describing or containing the result of the action.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ok = 200
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + created + +
    +
    +
    +
    +
    +
    +

    The request has been fulfilled, resulting in the creation of a new resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case created = 201
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accepted + +
    +
    +
    +
    +
    +
    +

    The request has been accepted for processing, but the processing has not been completed. +The request might or might not be eventually acted upon, and may be disallowed when processing occurs.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case accepted = 202
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The server is a transforming proxy (e.g.a Web accelerator) that received a 200 OK from its origin, but is returning a +modified version of the origin’s response.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nonAuthoritativeInformation = 203
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + noContent + +
    +
    +
    +
    +
    +
    +

    The server successfully processed the request, and is not returning any content.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case noContent = 204
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + resetContent + +
    +
    +
    +
    +
    +
    +

    The server successfully processed the request, asks that the requester reset its document view, and is not returning any content.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case resetContent = 205
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + partialContent + +
    +
    +
    +
    +
    +
    +

    The server is delivering only part of the resource (byte serving) due to a range header sent by the client. +The range header is used by HTTP clients to enable resuming of interrupted downloads, or split a download into multiple simultaneous streams.

    + +

    (RFC 7233)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case partialContent = 206
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + multiStatus + +
    +
    +
    +
    +
    +
    +

    The message body that follows is by default an XML message and can contain a number of separate response codes, +depending on how many sub-requests were made.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiStatus = 207
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + alreadyReported + +
    +
    +
    +
    +
    +
    +

    The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again.

    + +

    (WebDAV; RFC 5842)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case alreadyReported = 208
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + IMused + +
    +
    +
    +
    +
    +
    +

    The server has fulfilled a request for the resource, and the response is a representation of the result of one or more +instance-manipulations applied to the current instance.

    + +

    (RFC 3229)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case IMused = 226
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + multipleChoices + +
    +
    +
    +
    +
    +
    +

    Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).

    + +

    For example, this code could be used to present multiple video format options, to list files with different filename extensions, +or to suggest word-sense disambiguation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multipleChoices = 300
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + movedPermanently + +
    +
    +
    +
    +
    +
    +

    This and all future requests should be directed to the given URI.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case movedPermanently = 301
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + found + +
    +
    +
    +
    +
    +
    +

    Tells the client to look at (browse to) another URL (Previously “Moved temporarily”)

    + +

    302 has been superseded by 303 and 307. +This is an example of industry practice contradicting the standard.

    + +

    The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase +was “Moved Temporarily”), but popular browsers implemented 302 with the functionality of a 303 See Other. +Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.

    + +

    However, some Web applications and frameworks use the 302 status code as if it were the 303.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case found = 302
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + seeOther + +
    +
    +
    +
    +
    +
    +

    The response to the request can be found under another URI using the GET method.

    + +

    When received in response to a POST (or PUT/DELETE), the client should presume that the server has received the data +and should issue a new GET request to the given URI.

    + +

    (since HTTP/1.1)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case seeOther = 303
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notModified + +
    +
    +
    +
    +
    +
    +

    Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.

    + +

    In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.

    + +

    (RFC 7232)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notModified = 304
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + useProxy + +
    +
    +
    +
    +
    +
    +

    The requested resource is available only through a proxy, the address for which is provided in the response.

    + +

    For security reasons, many HTTP clients (such as Mozilla Firefox and Internet Explorer) do not obey this status code.

    + +

    (since HTTP/1.1)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case useProxy = 305
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + switchProxy + +
    +
    +
    +
    +
    +
    +

    No longer used. +Originally meant “Subsequent requests should use the specified proxy.”

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case switchProxy = 306
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + temporaryRedirect + +
    +
    +
    +
    +
    +
    +

    In this case, the request should be repeated with another URI; however, future requests should still use the original URI.

    + +

    In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request. +For example, a POST request should be repeated using another POST request.

    + +

    (since HTTP/1.1)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case temporaryRedirect = 307
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permanentRedirect + +
    +
    +
    +
    +
    +
    +

    The request and all future requests should be repeated using another URI.

    + +

    307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change. +So, for example, submitting a form to a permanently redirected resource may continue smoothly.

    + +

    (RFC 7538)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case permanentRedirect = 308
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + badRequest + +
    +
    +
    +
    +
    +
    +

    The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, +invalid request message framing, or deceptive request routing).

    + +

    (RFC 7235)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case badRequest = 400
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unauthorized + +
    +
    +
    +
    +
    +
    +

    Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.

    + +

    The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. +See Basic access authentication and Digest access authentication.

    + +

    401 semantically means “unauthorised”, the user does not have valid authentication credentials for the target resource.

    + +

    Note: Some sites incorrectly issue HTTP 401 when an IP address is banned from the website (usually the website domain) +and that specific address is refused permission to access a website. +[citation needed]

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unauthorized = 401
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + paymentRequired + +
    +
    +
    +
    +
    +
    +

    Reserved for future use. +The original intention was that this code might be used as part of some form of digital cash or micropayment +scheme, as proposed, for example, by GNU Taler, but that has not yet happened, and this code is not widely used.

    + +
      +
    • Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
    • +
    • Sipgate uses this code if an account does not have sufficient funds to start a call.
    • +
    • Shopify uses this code when the store has not paid their fees and is temporarily disabled.
    • +
    • Stripe uses this code for failed payments where parameters were correct, for example blocked fraudulent payments.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case paymentRequired = 402
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forbidden + +
    +
    +
    +
    +
    +
    +

    The request contained valid data and was understood by the server, but the server is refusing action.

    + +

    This may be due to the user not having the necessary permissions for a resource or needing an account of some sort, +or attempting a prohibited action (e.g. creating a duplicate record where only one is allowed). +This code is also typically used if the request provided authentication by answering the +WWW-Authenticate header field challenge, but the server did not accept that authentication. +The request should not be repeated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case forbidden = 403
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notFound + +
    +
    +
    +
    +
    +
    +

    The requested resource could not be found but may be available in the future. +Subsequent requests by the client are permissible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notFound = 404
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + methodNotAllowed + +
    +
    +
    +
    +
    +
    +

    A request method is not supported for the requested resource

    + +

    For example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case methodNotAllowed = 405
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notAcceptable + +
    +
    +
    +
    +
    +
    +

    The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.

    + +

    See Content negotiation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notAcceptable = 406
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The client must first authenticate itself with the proxy.

    + +

    (RFC 7235)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case proxyAuthenticationRequired = 407
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + requestTimeout + +
    +
    +
    +
    +
    +
    +

    The server timed out waiting for the request.

    + +

    According to HTTP specifications:

    +
    The client did not produce a request within the time that the server was prepared to wait.
    +The client MAY repeat the request without modifications at any later time.
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case requestTimeout = 408
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + conflict + +
    +
    +
    +
    +
    +
    +

    Indicates that the request could not be processed because of conflict in the current state of the resource, +such as an edit conflict between multiple simultaneous updates.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case conflict = 409
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + gone + +
    +
    +
    +
    +
    +
    +

    Indicates that the resource requested is no longer available and will not be available again.

    + +

    This should be used when a resource has been intentionally removed and the resource should be purged. +Upon receiving a 410 status code, the client should not request the resource in the future. +Clients such as search engines should remove the resource from their indices. +Most use cases do not require clients and search engines to purge the resource, and a “404 Not Found” may be used instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case gone = 410
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lengthRequired + +
    +
    +
    +
    +
    +
    +

    The request did not specify the length of its content, which is required by the requested resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lengthRequired = 411
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + preconditionFailed + +
    +
    +
    +
    +
    +
    +

    The server does not meet one of the preconditions that the requester put on the request header fields.

    + +

    (RFC 7232)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case preconditionFailed = 412
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + payloadTooLarge + +
    +
    +
    +
    +
    +
    +

    The request is larger than the server is willing or able to process. +Previously called “Request Entity Too Large”.

    + +

    (RFC 7231)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case payloadTooLarge = 413
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + uriTooLong + +
    +
    +
    +
    +
    +
    +

    The URI provided was too long for the server to process.

    + +

    Often the result of too much data being encoded as a query-string of a GET request, in which case it should be converted to a POST request. +Called “Request-URI Too Long” previously.

    + +

    (RFC 7231)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case uriTooLong = 414
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsupportedMediaType + +
    +
    +
    +
    +
    +
    +

    The request entity has a media type which the server or resource does not support. +For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.

    + +

    (RFC 7231)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unsupportedMediaType = 415
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rangeNotSatisfiable + +
    +
    +
    +
    +
    +
    +

    The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.

    + +

    For example, if the client asked for a part of the file that lies beyond the end of the file. +Called “Requested Range Not Satisfiable” previously.

    + +

    (RFC 7233)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rangeNotSatisfiable = 416
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + expectationFailed + +
    +
    +
    +
    +
    +
    +

    The server cannot meet the requirements of the Expect request-header field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case expectationFailed = 417
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + imATeapot + +
    +
    +
    +
    +
    +
    +

    This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, +and is not expected to be implemented by actual HTTP servers.

    + +

    The RFC specifies this code should be returned by teapots requested to brew coffee. +This HTTP status is used as an Easter egg in some websites, such as Google.com’s I’m a teapot easter egg.

    + +

    (RFC 2324, RFC 7168)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case imATeapot = 418
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + misdirectedRequest + +
    +
    +
    +
    +
    +
    +

    The request was directed at a server that is not able to produce a response (for example because of connection reuse).

    + +

    (RFC 7540)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case misdirectedRequest = 421
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unprocessableEntity + +
    +
    +
    +
    +
    +
    +

    The request was well-formed but was unable to be followed due to semantic errors.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unprocessableEntity = 422
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + locked + +
    +
    +
    +
    +
    +
    +

    The resource that is being accessed is locked.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case locked = 423
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + failedDependency + +
    +
    +
    +
    +
    +
    +

    The request failed because it depended on another request and that request failed (e.g., a PROPPATCH).

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failedDependency = 424
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tooEarly + +
    +
    +
    +
    +
    +
    +

    Indicates that the server is unwilling to risk processing a request that might be replayed.

    + +

    (RFC 8470)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tooEarly = 425
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + upgradeRequired + +
    +
    +
    +
    +
    +
    +

    The client should switch to a different protocol such as TLS/1.3, given in the Upgrade header field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case upgradeRequired = 426
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + preconditionRequired + +
    +
    +
    +
    +
    +
    +

    The origin server requires the request to be conditional.

    + +

    Intended to prevent the ‘lost update’ problem, where a client GETs a resource’s state, modifies it, and PUTs it back to the server, +when meanwhile a third party has modified the state on the server, leading to a conflict.

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case preconditionRequired = 428
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tooManyRequests + +
    +
    +
    +
    +
    +
    +

    The user has sent too many requests in a given amount of time.

    + +

    Intended for use with rate-limiting schemes.

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tooManyRequests = 429
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The server is unwilling to process the request because either an individual header field, or all the header fields collectively, +are too large.

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case requestHeaderFieldsTooLarge = 431
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.

    + +

    The code 451 was chosen as a reference to the novel Fahrenheit 451 (see the Acknowledgements in the RFC).

    + +

    Notes: (RFC 7725)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unavailableForLegalReasons = 451
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + internalServerError + +
    +
    +
    +
    +
    +
    +

    A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalServerError = 500
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notImplemented + +
    +
    +
    +
    +
    +
    +

    The server either does not recognize the request method, or it lacks the ability to fulfil the request.

    + +

    Usually this implies future availability (e.g., a new feature of a web-service API).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notImplemented = 501
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + badGateway + +
    +
    +
    +
    +
    +
    +

    The server was acting as a gateway or proxy and received an invalid response from the upstream server.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case badGateway = 502
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + serviceUnavailable + +
    +
    +
    +
    +
    +
    +

    The server cannot handle the request (because it is overloaded or down for maintenance).

    + +

    Generally, this is a temporary state.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case serviceUnavailable = 503
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + gatewayTimeout + +
    +
    +
    +
    +
    +
    +

    The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case gatewayTimeout = 504
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The server does not support the HTTP protocol version used in the request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case httpVersionNotSupported = 505
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + variantAlsoNegotiates + +
    +
    +
    +
    +
    +
    +

    Transparent content negotiation for the request results in a circular reference.

    + +

    (RFC 2295)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case variantAlsoNegotiates = 506
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + insufficientStorage + +
    +
    +
    +
    +
    +
    +

    The server is unable to store the representation needed to complete the request.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insufficientStorage = 507
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + loopDetected + +
    +
    +
    +
    +
    +
    +

    The server detected an infinite loop while processing the request (sent instead of 208 Already Reported).

    + +

    (WebDAV; RFC 5842)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case loopDetected = 508
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notExtended + +
    +
    +
    +
    +
    +
    +

    Further extensions to the request are required for the server to fulfil it.

    + +

    (RFC 2774)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notExtended = 510
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The client needs to authenticate to gain network

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case networkAuthenticationRequired = 511
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func > (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func >= (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions.html b/docs/Extensions.html new file mode 100644 index 0000000..7c6831f --- /dev/null +++ b/docs/Extensions.html @@ -0,0 +1,547 @@ + + + + Extensions Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

Array + QueryItemValue +

+
+
+
    +
  • +
    + + + + Array + +
    +
  • +
+
+
+
+ + +
+ +

Set + QueryItemValue +

+
+
+
    +
  • +
    + + + + Set + +
    +
  • +
  • +
    + + + + String + +
    +
  • +
+
+
+
+ + +
+ +

Optional + OptionalType +

+
+
+ +
+
+
+ + +
+ +

Double + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/Array.html b/docs/Extensions/Array.html new file mode 100644 index 0000000..2d69f58 --- /dev/null +++ b/docs/Extensions/Array.html @@ -0,0 +1,464 @@ + + + + Array Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Array

+
+
+ +
extension Array: QueryItemValue where Element: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Element: QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/Bool.html b/docs/Extensions/Bool.html new file mode 100644 index 0000000..ad02183 --- /dev/null +++ b/docs/Extensions/Bool.html @@ -0,0 +1,498 @@ + + + + Bool Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Bool

+
+
+ +
extension Bool: RequestHeaderValue
+
extension Bool: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

Bool + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/Double.html b/docs/Extensions/Double.html new file mode 100644 index 0000000..b8f20f4 --- /dev/null +++ b/docs/Extensions/Double.html @@ -0,0 +1,455 @@ + + + + Double Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Double

+
+
+ +
extension Double: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/Int.html b/docs/Extensions/Int.html new file mode 100644 index 0000000..be4e48a --- /dev/null +++ b/docs/Extensions/Int.html @@ -0,0 +1,528 @@ + + + + Int Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int

+
+
+ +
extension Int: RequestHeaderValue
+
extension Int: RequestPathParameterValue
+
extension Int: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + serializedHeaderValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var serializedHeaderValue: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + serialized + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var serialized: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Int + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/Int16.html b/docs/Extensions/Int16.html new file mode 100644 index 0000000..fcadfd4 --- /dev/null +++ b/docs/Extensions/Int16.html @@ -0,0 +1,397 @@ + + + + Int16 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Extensions/Int32.html b/docs/Extensions/Int32.html new file mode 100644 index 0000000..9ac7b2f --- /dev/null +++ b/docs/Extensions/Int32.html @@ -0,0 +1,397 @@ + + + + Int32 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Extensions/Int64.html b/docs/Extensions/Int64.html new file mode 100644 index 0000000..8f3ce68 --- /dev/null +++ b/docs/Extensions/Int64.html @@ -0,0 +1,397 @@ + + + + Int64 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Extensions/Optional.html b/docs/Extensions/Optional.html new file mode 100644 index 0000000..8d7bd2c --- /dev/null +++ b/docs/Extensions/Optional.html @@ -0,0 +1,551 @@ + + + + Optional Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Optional

+
+
+ +
extension Optional: OptionalType
+
extension Optional: RequestHeaderValue where Wrapped: RequestHeaderValue
+
extension Optional: RequestPathParameterValue where Wrapped: RequestPathParameterValue
+
extension Optional: QueryItemValue where Wrapped: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Wrapped: RequestHeaderValue +

+
+
+ +
+
+
+ + +
+ +

Available where Wrapped: RequestPathParameterValue +

+
+
+
    +
  • +
    + + + + serialized + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var serialized: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Wrapped: QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/PlainDecodable.html b/docs/Extensions/PlainDecodable.html new file mode 100644 index 0000000..3b4bd51 --- /dev/null +++ b/docs/Extensions/PlainDecodable.html @@ -0,0 +1,400 @@ + + + + PlainDecodable Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Extensions/Range.html b/docs/Extensions/Range.html new file mode 100644 index 0000000..32a862f --- /dev/null +++ b/docs/Extensions/Range.html @@ -0,0 +1,442 @@ + + + + Range Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Range

+
+
+ +
extension Range where Bound == HTTPStatusCode
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound == HTTPStatusCode +

+
+
+
    +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Checks if a value is within a range of HTTP status codes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= (range: Range<HTTPStatusCode>, value: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + range + + +
    +

    The range of HTTP status codes to check against.

    +
    +
    + + value + + +
    +

    The value to check against the range.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the value is within the range, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseBody.html b/docs/Extensions/ResponseBody.html new file mode 100644 index 0000000..92bfaf1 --- /dev/null +++ b/docs/Extensions/ResponseBody.html @@ -0,0 +1,407 @@ + + + + ResponseBody Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Extensions/ResponseBody/OptionalContent.html b/docs/Extensions/ResponseBody/OptionalContent.html new file mode 100644 index 0000000..ca97d91 --- /dev/null +++ b/docs/Extensions/ResponseBody/OptionalContent.html @@ -0,0 +1,377 @@ + + + + OptionalContent Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OptionalContent

+
+
+ +
public typealias OptionalContent = ResponseBodyWrapper<Body, OptionalContentStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with an optional content strategy.

+ +

The OptionalContent type alias provides a convenient way to use ResponseBodyWrapper with the OptionalContentStrategy. +It represents the response body of a request where the content is optional.

+ +

Example usage:

+
@ResponseBody<Body>.OptionalContent var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseBody/Status200.html b/docs/Extensions/ResponseBody/Status200.html new file mode 100644 index 0000000..94e0843 --- /dev/null +++ b/docs/Extensions/ResponseBody/Status200.html @@ -0,0 +1,377 @@ + + + + Status200 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status200

+
+
+ +
public typealias Status200 = ResponseBodyWrapper<Body, ValidateStatus200BodyStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 200.

+ +

The Status200 type alias provides a convenient way to use ResponseBodyWrapper with the ValidateStatus200BodyStrategy. +It represents the response body of a request where the status code is expected to be 200.

+ +

Example usage:

+
@ResponseBody<Body>.Status200 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseBody/Status201.html b/docs/Extensions/ResponseBody/Status201.html new file mode 100644 index 0000000..c8e7e89 --- /dev/null +++ b/docs/Extensions/ResponseBody/Status201.html @@ -0,0 +1,377 @@ + + + + Status201 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status201

+
+
+ +
public typealias Status201 = ResponseBodyWrapper<Body, ValidateStatus201BodyStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 201.

+ +

The Status201 type alias provides a convenient way to use ResponseBodyWrapper with the ValidateStatus201BodyStrategy. +It represents the response body of a request where the status code is expected to be 201.

+ +

Example usage:

+
@ResponseBody<Body>.Status201 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseBody/Status303.html b/docs/Extensions/ResponseBody/Status303.html new file mode 100644 index 0000000..8de1201 --- /dev/null +++ b/docs/Extensions/ResponseBody/Status303.html @@ -0,0 +1,377 @@ + + + + Status303 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status303

+
+
+ +
public typealias Status303 = ResponseBodyWrapper<Body, ValidateStatus303BodyStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 303.

+ +

The Status303 type alias provides a convenient way to use ResponseBodyWrapper with the ValidateStatus303BodyStrategy. +It represents the response body of a request where the status code is expected to be 303.

+ +

Example usage:

+
@ResponseBody<Body>.Status303 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseErrorBody.html b/docs/Extensions/ResponseErrorBody.html new file mode 100644 index 0000000..4661d0e --- /dev/null +++ b/docs/Extensions/ResponseErrorBody.html @@ -0,0 +1,425 @@ + + + + ResponseErrorBody Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Extensions/ResponseErrorBody/Status400.html b/docs/Extensions/ResponseErrorBody/Status400.html new file mode 100644 index 0000000..39020c7 --- /dev/null +++ b/docs/Extensions/ResponseErrorBody/Status400.html @@ -0,0 +1,377 @@ + + + + Status400 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status400

+
+
+ +
public typealias Status400 = ResponseErrorBodyWrapper<Body, ValidateStatus400ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 400.

+ +

The Status400 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus400ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 400.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status400 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseErrorBody/Status401.html b/docs/Extensions/ResponseErrorBody/Status401.html new file mode 100644 index 0000000..40746e8 --- /dev/null +++ b/docs/Extensions/ResponseErrorBody/Status401.html @@ -0,0 +1,377 @@ + + + + Status401 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status401

+
+
+ +
public typealias Status401 = ResponseErrorBodyWrapper<Body, ValidateStatus401ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 401.

+ +

The Status401 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus401ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 401.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status401 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseErrorBody/Status403.html b/docs/Extensions/ResponseErrorBody/Status403.html new file mode 100644 index 0000000..e8f237c --- /dev/null +++ b/docs/Extensions/ResponseErrorBody/Status403.html @@ -0,0 +1,377 @@ + + + + Status403 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status403

+
+
+ +
public typealias Status403 = ResponseErrorBodyWrapper<Body, ValidateStatus403ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 403.

+ +

The Status403 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus403ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 403.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status403 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseErrorBody/Status404.html b/docs/Extensions/ResponseErrorBody/Status404.html new file mode 100644 index 0000000..c2fc5fe --- /dev/null +++ b/docs/Extensions/ResponseErrorBody/Status404.html @@ -0,0 +1,377 @@ + + + + Status404 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status404

+
+
+ +
public typealias Status404 = ResponseErrorBodyWrapper<Body, ValidateStatus404ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 404.

+ +

The Status404 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus404ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 404.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status404 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseErrorBody/Status410.html b/docs/Extensions/ResponseErrorBody/Status410.html new file mode 100644 index 0000000..26210d2 --- /dev/null +++ b/docs/Extensions/ResponseErrorBody/Status410.html @@ -0,0 +1,377 @@ + + + + Status410 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status410

+
+
+ +
public typealias Status410 = ResponseErrorBodyWrapper<Body, ValidateStatus410ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 410.

+ +

The Status410 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus410ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 410.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status410 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/ResponseErrorBody/Status422.html b/docs/Extensions/ResponseErrorBody/Status422.html new file mode 100644 index 0000000..ef64acf --- /dev/null +++ b/docs/Extensions/ResponseErrorBody/Status422.html @@ -0,0 +1,377 @@ + + + + Status422 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status422

+
+
+ +
public typealias Status422 = ResponseErrorBodyWrapper<Body, ValidateStatus422ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 422.

+ +

The Status422 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus422ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 422.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status422 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/Set.html b/docs/Extensions/Set.html new file mode 100644 index 0000000..b991257 --- /dev/null +++ b/docs/Extensions/Set.html @@ -0,0 +1,464 @@ + + + + Set Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Set

+
+
+ +
extension Set: QueryItemValue where Element: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Element: QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/String.html b/docs/Extensions/String.html new file mode 100644 index 0000000..878f8d3 --- /dev/null +++ b/docs/Extensions/String.html @@ -0,0 +1,537 @@ + + + + String Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

String

+
+
+ +
extension String: RequestHeaderValue
+
extension String: RequestPathParameterValue
+
extension String: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

String + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Extensions/String/Encoding.html b/docs/Extensions/String/Encoding.html new file mode 100644 index 0000000..ad98fa7 --- /dev/null +++ b/docs/Extensions/String/Encoding.html @@ -0,0 +1,367 @@ + + + + Encoding Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Encoding

+
+
+ +
extension String.Encoding: @retroactive Encodable
+ +
+
+

Extension to make String.Encoding conform to Encodable

+ +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Extensions/URLSession.html b/docs/Extensions/URLSession.html new file mode 100644 index 0000000..532d78f --- /dev/null +++ b/docs/Extensions/URLSession.html @@ -0,0 +1,458 @@ + + + + URLSession Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

URLSession

+
+
+ +
extension URLSession: URLSessionProvider
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + send(urlRequest:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func send(urlRequest request: URLRequest) -> AnyPublisher<URLSession.DataTaskPublisher.Output, URLSession.DataTaskPublisher.Failure>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func send(urlRequest request: URLRequest, completion: @escaping (Data?, URLResponse?, Error?) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + send(urlRequest:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func send(urlRequest request: URLRequest) async throws -> (Data, URLResponse)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols.html b/docs/Protocols.html new file mode 100644 index 0000000..006f1b8 --- /dev/null +++ b/docs/Protocols.html @@ -0,0 +1,526 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

OptionalType +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Protocols/FormURLEncodedBodyProvider.html b/docs/Protocols/FormURLEncodedBodyProvider.html new file mode 100644 index 0000000..19631f5 --- /dev/null +++ b/docs/Protocols/FormURLEncodedBodyProvider.html @@ -0,0 +1,451 @@ + + + + FormURLEncodedBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedBodyProvider

+
+
+ +
public protocol FormURLEncodedBodyProvider
+ +
+
+

A provider for form URL encoded body data.

+ +

The FormURLEncodedBodyProvider protocol defines a type that provides a body for form URL encoded data. +It requires conforming types to specify an associated type Body that conforms to the Encodable protocol +and to provide a body property of that type.

+ +

Example usage:

+
struct MyFormURLEncodedRequest: FormURLEncodedBodyProvider {
+    struct Body: Encodable {
+        let name: String
+        let age: Int
+    }
+
+    var body: Body
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Body + +
    +
    +
    +
    +
    +
    +

    The associated type representing the body of the form URL encoded data.

    + +

    This associated type must conform to the Encodable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Body : Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body of the form URL encoded data.

    + +

    This property holds the body of the form URL encoded data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: Body { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/FormURLEncodedFormatProvider.html b/docs/Protocols/FormURLEncodedFormatProvider.html new file mode 100644 index 0000000..0f44804 --- /dev/null +++ b/docs/Protocols/FormURLEncodedFormatProvider.html @@ -0,0 +1,409 @@ + + + + FormURLEncodedFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedFormatProvider

+
+
+ +
public protocol FormURLEncodedFormatProvider
+ +
+
+

A type that has a default format of form-url-encoding

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .formURLEncoded

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/JSONBodyProvider.html b/docs/Protocols/JSONBodyProvider.html new file mode 100644 index 0000000..184094d --- /dev/null +++ b/docs/Protocols/JSONBodyProvider.html @@ -0,0 +1,472 @@ + + + + JSONBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONBodyProvider

+
+
+ +
public protocol JSONBodyProvider
+ +
+
+

A protocol that provides the body and key encoding strategy for JSON encoding.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Body + +
    +
    +
    +
    +
    +
    +

    The type of the body to be encoded.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Body : Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + keyEncodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The key encoding strategy to use for JSON encoding.

    + +
    +

    Default Implementation

    +
    +

    The default key encoding strategy for JSON encoding.

    + +

    By default, this is set to .convertToSnakeCase.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var keyEncodingStrategy: JSONEncoder.KeyEncodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body to be encoded.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: Body { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/JSONFormatProvider.html b/docs/Protocols/JSONFormatProvider.html new file mode 100644 index 0000000..9ad06b7 --- /dev/null +++ b/docs/Protocols/JSONFormatProvider.html @@ -0,0 +1,409 @@ + + + + JSONFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONFormatProvider

+
+
+ +
public protocol JSONFormatProvider
+ +
+
+

A type that has a default format of form-url-encoding

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .json

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/OptionalType.html b/docs/Protocols/OptionalType.html new file mode 100644 index 0000000..93cbc7b --- /dev/null +++ b/docs/Protocols/OptionalType.html @@ -0,0 +1,441 @@ + + + + OptionalType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OptionalType

+
+
+ +
public protocol OptionalType
+ +
+
+

A type that can be used as a value for a query item.

+ +

The OptionalType protocol defines a type that can be used as a value for a query item. +It requires conforming types to provide a none property that returns a nil value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Wrapped + +
    +
    +
    +
    +
    +
    +

    The type of the wrapped value.

    + +

    This property represents the type of the wrapped value. +It is used to represent the type of the wrapped value for the optional type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Wrapped
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    The nil value of the optional type.

    + +

    This property represents the nil value of the optional type. +It is used to represent a nil value for the optional type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var none: Self { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/PlainBodyProvider.html b/docs/Protocols/PlainBodyProvider.html new file mode 100644 index 0000000..182b047 --- /dev/null +++ b/docs/Protocols/PlainBodyProvider.html @@ -0,0 +1,467 @@ + + + + PlainBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainBodyProvider

+
+
+ +
public protocol PlainBodyProvider
+ +
+
+

A provider for plain text body data.

+ +

The PlainBodyProvider protocol defines a type that provides a body for plain text data. +It requires conforming types to specify an associated type Body that conforms to the Encodable protocol +and to provide a body property of that type.

+ +

Example usage:

+
struct MyPlainRequest: PlainBodyProvider {
+    struct Body: Encodable {
+        let content: String
+    }
+
+    var body: Body
+    var encoding: String.Encoding
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body of the plain text data.

    + +

    This property holds the body of the plain text data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + encoding + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The encoding used for the plain text data.

    + +

    This property holds the encoding used for the plain text data.

    + +
    +

    Default Implementation

    +
    +

    The encoding used for the plain text data.

    + +

    This property holds the encoding used for the plain text data. +Default implementation is .utf8

    +
    +

    Note

    + This property is required by the PlainBodyProvider protocol. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var encoding: String.Encoding { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/PlainFormatProvider.html b/docs/Protocols/PlainFormatProvider.html new file mode 100644 index 0000000..eebe5cb --- /dev/null +++ b/docs/Protocols/PlainFormatProvider.html @@ -0,0 +1,410 @@ + + + + PlainFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainFormatProvider

+
+
+ +
public protocol PlainFormatProvider
+ +
+
+

A type that has a default format of plain text

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .plain

    + +
    +

    Default Implementation

    +
    +

    Default implementation is .plain

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/QueryItemValue.html b/docs/Protocols/QueryItemValue.html new file mode 100644 index 0000000..3a35cb6 --- /dev/null +++ b/docs/Protocols/QueryItemValue.html @@ -0,0 +1,492 @@ + + + + QueryItemValue Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryItemValue

+
+
+ +
public protocol QueryItemValue
+ +
+
+

A type that can be used as a value for a query item.

+ +

The QueryItemValue protocol defines a type that can be used as a value for a query item. +It requires conforming types to provide a serializedQueryItem property that returns a string representation of the query item value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + serializedQueryItem + +
    +
    +
    +
    +
    +
    +

    The serialized value of the query item.

    + +

    This property represents the serialized value of the query item. +It is used to convert the query item value into a string format suitable for URL query parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var serializedQueryItem: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isCollection + +
    +
    +
    +
    +
    +
    +

    Indicates whether the query item is a collection.

    + +

    This property is used to determine if the query item is a collection.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var isCollection: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + iterateCollection(_:) + +
    +
    +
    +
    +
    +
    +

    Iterates over the elements of the collection.

    + +

    This method is used to iterate over the elements of the collection. +If the query item is not a collection, this method should not be called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iterateCollection(_ iterator: (QueryItemValue) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + iterator + + +
    +

    A closure that is called for each element in the collection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/Request.html b/docs/Protocols/Request.html new file mode 100644 index 0000000..0307fcf --- /dev/null +++ b/docs/Protocols/Request.html @@ -0,0 +1,415 @@ + + + + Request Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Request

+
+
+ +
public protocol Request : Encodable
+ +
+
+

Protocol used to define a response type to a given request type.

+ +

The Request protocol is used to define a response type for a given request type. +It requires conforming types to be encodable and to specify an associated type Response +that conforms to the Decodable protocol.

+ +

Example usage:

+
struct MyRequest: Request {
+    typealias Response = MyResponse
+    // Implement the required properties and methods for the request
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Response + +
    +
    +
    +
    +
    +
    +

    The associated type representing the response type for the request.

    + +

    This associated type must conform to the Decodable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Response : Decodable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/RequestHeaderValue.html b/docs/Protocols/RequestHeaderValue.html new file mode 100644 index 0000000..33484e6 --- /dev/null +++ b/docs/Protocols/RequestHeaderValue.html @@ -0,0 +1,408 @@ + + + + RequestHeaderValue Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestHeaderValue

+
+
+ +
public protocol RequestHeaderValue
+ +
+
+

A type that can be used as a value for an HTTP header.

+ +

The RequestHeaderValue protocol defines a type that can be used as a value for an HTTP header. +It requires conforming types to provide a serializedHeaderValue property that returns a string representation of the header value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + serializedHeaderValue + +
    +
    +
    +
    +
    +
    +

    The serialized value of the header.

    + +

    This property represents the serialized value of the header. +It is used to convert the header value into a string format suitable for HTTP headers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var serializedHeaderValue: String? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/RequestPathParameterValue.html b/docs/Protocols/RequestPathParameterValue.html new file mode 100644 index 0000000..b3a85a1 --- /dev/null +++ b/docs/Protocols/RequestPathParameterValue.html @@ -0,0 +1,408 @@ + + + + RequestPathParameterValue Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestPathParameterValue

+
+
+ +
public protocol RequestPathParameterValue
+ +
+
+

A type that can be used as a value for a request path parameter.

+ +

The RequestPathParameterValue protocol defines a type that can be used as a value for a request path parameter. +It requires conforming types to provide a serialized property that returns a string representation of the path parameter value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + serialized + +
    +
    +
    +
    +
    +
    +

    The serialized value of the path parameter.

    + +

    This property represents the serialized value of the path parameter. +It is used to convert the path parameter value into a string format suitable for URL paths.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var serialized: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/ResponseBodyDecodingStrategy.html b/docs/Protocols/ResponseBodyDecodingStrategy.html new file mode 100644 index 0000000..502df5d --- /dev/null +++ b/docs/Protocols/ResponseBodyDecodingStrategy.html @@ -0,0 +1,492 @@ + + + + ResponseBodyDecodingStrategy Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseBodyDecodingStrategy

+
+
+ +
public protocol ResponseBodyDecodingStrategy
+ +
+
+

A protocol for defining strategies for handling response bodies.

+ +

Implement this protocol to create custom strategies for handling response bodies.

+ +

Example usage:

+
public class SpecificStatusCodeDecodingStrategy: ResponseBodyDecodingStrategy {
+
+    public static func allowsEmptyContent(for statusCode: Int) -> Bool {
+        return statusCode == 204 // your own statusCode value
+    }
+}
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether the decoding should fail when no content is returned or not.

    + +

    Use this property in a custom strategy implementation (example below) to check against the response’s +statusCode and determine whether or not it should fail when receiving empty data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func allowsEmptyContent(for statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is within the acceptable range.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is valid.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/ResponseErrorBodyDecodingStrategy.html b/docs/Protocols/ResponseErrorBodyDecodingStrategy.html new file mode 100644 index 0000000..5087662 --- /dev/null +++ b/docs/Protocols/ResponseErrorBodyDecodingStrategy.html @@ -0,0 +1,418 @@ + + + + ResponseErrorBodyDecodingStrategy Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseErrorBodyDecodingStrategy

+
+
+ +
public protocol ResponseErrorBodyDecodingStrategy
+ +
+
+

A protocol for defining strategies for handling error response bodies.

+ +

Implement this protocol to create custom strategies for handling error response bodies.

+ +

Example usage:

+
public class SpecificStatusCodeDecodingStrategy: ResponseErrorBodyDecodingStrategy {
+
+    public static func isError(statusCode: Int) -> Bool {
+        return statusCode >= 400 // Handle every status code greater than 400 as an error
+    }
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Using the validate(statusCode:) method, you can define HTTP code(s) that should handled as an error.

    + +

    Use this property in a custom strategy implementation (example below) to check against the response’s +statusCode and determine wether or not it should fail when receiving empty data.

    + +

    Indicates wether the decoding should fail when no content is returned or not.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func isError(statusCode: Int) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/ResponseHeaderDecodingStrategy.html b/docs/Protocols/ResponseHeaderDecodingStrategy.html new file mode 100644 index 0000000..71eef85 --- /dev/null +++ b/docs/Protocols/ResponseHeaderDecodingStrategy.html @@ -0,0 +1,473 @@ + + + + ResponseHeaderDecodingStrategy Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseHeaderDecodingStrategy

+
+
+ +
public protocol ResponseHeaderDecodingStrategy
+ +
+
+

A protocol for defining strategies for decoding response headers.

+ +

Implement this protocol to create custom strategies for decoding response headers.

+ +

Example usage:

+
public class SpecificHeaderDecodingStrategy: ResponseHeaderDecodingStrategy {
+    // Implement the required methods and properties here
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + RawValue + +
    +
    +
    +
    +
    +
    +

    The type of the raw value that will be decoded from the response header.

    + +

    This associated type represents the type of the raw value that will be decoded from the response header. +It must conform to the Codable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype RawValue : Decodable, Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + decode(decoder:) + +
    +
    +
    +
    +
    +
    +

    Decodes the raw value from the given decoder.

    + +

    This method is responsible for decoding the raw value from the given decoder.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func decode(decoder: Decoder) throws -> RawValue
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded raw value.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/URLSessionProvider.html b/docs/Protocols/URLSessionProvider.html new file mode 100644 index 0000000..bd42305 --- /dev/null +++ b/docs/Protocols/URLSessionProvider.html @@ -0,0 +1,586 @@ + + + + URLSessionProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

URLSessionProvider

+
+
+ +
public protocol URLSessionProvider
+ +
+
+

A protocol that provides methods for sending URL requests using different mechanisms.

+ +

The URLSessionProvider protocol defines methods for sending URL requests using Combine, callbacks, and async-await. +It allows for flexibility in handling URL requests and responses.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + send(urlRequest:) + +
    +
    +
    +
    +
    +
    +

    Sends a URL request using Combine and returns a publisher that emits the response.

    + +

    Example usage:

    +
    let provider: URLSessionProvider = URLSession.shared
    +let publisher = provider.send(urlRequest: myRequest)
    +publisher.sink(receiveCompletion: { completion in
    +    switch completion {
    +    case .finished:
    +        print("Request completed successfully")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}, receiveValue: { output in
    +    print("Received response: \(output.response)")
    +    print("Received data: \(output.data)")
    +})
    +.store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func send(urlRequest request: URLRequest) -> AnyPublisher<URLSession.DataTaskPublisher.Output, URLSession.DataTaskPublisher.Failure>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The URL request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the response data and URL response, or an error.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends a URL request using a callback to handle the response.

    + +

    Example usage:

    +
    let provider: URLSessionProvider = URLSession.shared
    +provider.send(urlRequest: myRequest) { data, response, error in
    +    if let error = error {
    +        print("Request failed with error: \(error)")
    +    } else if let response = response, let data = data {
    +        print("Received response: \(response)")
    +        print("Received data: \(data)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func send(urlRequest request: URLRequest, completion: @escaping (Data?, URLResponse?, Error?) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + request + + +
    +

    The URL request to send.

    +
    +
    + + completion + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + send(urlRequest:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends a URL request using async-await and returns the response.

    +
    +

    Throws

    + An error if the request fails. + +
    + +

    Example usage:

    +
    let provider: URLSessionProvider = URLSession.shared
    +let (data, response) = try await provider.send(urlRequest: myRequest)
    +print("Received response: \(response)")
    +print("Received data: \(data)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func send(urlRequest request: URLRequest) async throws -> (Data, URLResponse)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The URL request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A tuple containing the response data and URL response.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/XMLBodyProvider.html b/docs/Protocols/XMLBodyProvider.html new file mode 100644 index 0000000..5bc6470 --- /dev/null +++ b/docs/Protocols/XMLBodyProvider.html @@ -0,0 +1,451 @@ + + + + XMLBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLBodyProvider

+
+
+ +
public protocol XMLBodyProvider
+ +
+
+

A provider for XML body data.

+ +

The XMLBodyProvider protocol defines a type that provides a body for XML data. +It requires conforming types to specify an associated type Body that conforms to the Encodable protocol +and to provide a body property of that type.

+ +

Example usage:

+
struct MyXMLRequest: XMLBodyProvider {
+    struct Body: Encodable {
+        let name: String
+        let age: Int
+    }
+
+    var body: Body
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Body + +
    +
    +
    +
    +
    +
    +

    The associated type representing the body of the XML data.

    + +

    This associated type must conform to the Encodable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Body : Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body of the XML data.

    + +

    This property holds the body of the XML data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: Body { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Protocols/XMLFormatProvider.html b/docs/Protocols/XMLFormatProvider.html new file mode 100644 index 0000000..8e7e506 --- /dev/null +++ b/docs/Protocols/XMLFormatProvider.html @@ -0,0 +1,409 @@ + + + + XMLFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLFormatProvider

+
+
+ +
public protocol XMLFormatProvider
+ +
+
+

A type that has a default format of xml

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .xml

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs.html b/docs/Structs.html new file mode 100644 index 0000000..9dac406 --- /dev/null +++ b/docs/Structs.html @@ -0,0 +1,621 @@ + + + + Structures Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Structures

+

The following structures are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Structs/DefaultBodyStrategy.html b/docs/Structs/DefaultBodyStrategy.html new file mode 100644 index 0000000..29c1d7a --- /dev/null +++ b/docs/Structs/DefaultBodyStrategy.html @@ -0,0 +1,478 @@ + + + + DefaultBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultBodyStrategy

+
+
+ +
public struct DefaultBodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A default strategy for validating response bodies.

+ +

The DefaultBodyStrategy struct provides a default strategy for validating response bodies +by checking if the status code is between 200 (OK) and 300 (Multiple Choices). +It conforms to the ResponseBodyDecodingStrategy protocol and defines the +allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, DefaultBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Determines whether the decoding should fail when no content is returned.

    + +

    Example usage:

    +
    let allowsEmpty = DefaultBodyStrategy.allowsEmptyContent(for: 204)
    +print(allowsEmpty) // Output: false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for _: Int) -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is within the acceptable range.

    + +

    Example usage:

    +
    let isValid = DefaultBodyStrategy.validate(statusCode: 200)
    +print(isValid) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is valid.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/DefaultErrorBodyStrategy.html b/docs/Structs/DefaultErrorBodyStrategy.html new file mode 100644 index 0000000..e96d0ab --- /dev/null +++ b/docs/Structs/DefaultErrorBodyStrategy.html @@ -0,0 +1,439 @@ + + + + DefaultErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultErrorBodyStrategy

+
+
+ +
public struct DefaultErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A default strategy for validating error response bodies.

+ +

The DefaultErrorBodyStrategy struct provides a default strategy for validating error response bodies +by checking if the status code is greater than or equal to 400 (Bad Request).

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, DefaultErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is greater than or equal to the HTTP status code for a bad request (400).

    + +

    Example usage:

    +
    let isError = DefaultErrorBodyStrategy.isError(statusCode: 404)
    +print(isError) // Prints: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code represents an error, false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/DefaultHeaderStrategy.html b/docs/Structs/DefaultHeaderStrategy.html new file mode 100644 index 0000000..a564518 --- /dev/null +++ b/docs/Structs/DefaultHeaderStrategy.html @@ -0,0 +1,437 @@ + + + + DefaultHeaderStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultHeaderStrategy

+
+
+ +
public struct DefaultHeaderStrategy<RawValue> : ResponseHeaderDecodingStrategy where RawValue : Decodable, RawValue : Encodable
+ +
+
+

A default strategy for decoding response headers.

+ +

The DefaultHeaderStrategy struct provides a default strategy for decoding response headers +by checking if the header key is present in the response decoder.

+ +

Example usage:

+
@ResponseHeaderWrapper<Header, DefaultHeaderStrategy> var header: Header
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decode(decoder:) + +
    +
    +
    +
    +
    +
    +

    Decodes the response header value from the given decoder.

    +
    +

    Throws

    + An error if the header key is missing or the decoder is not a response decoder. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decode(decoder: Decoder) throws -> RawValue
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to decode the header value from.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded header value.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/DefaultHeaderStrategyOptional.html b/docs/Structs/DefaultHeaderStrategyOptional.html new file mode 100644 index 0000000..958be65 --- /dev/null +++ b/docs/Structs/DefaultHeaderStrategyOptional.html @@ -0,0 +1,437 @@ + + + + DefaultHeaderStrategyOptional Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultHeaderStrategyOptional

+
+
+ +
public struct DefaultHeaderStrategyOptional<RawValue> : ResponseHeaderDecodingStrategy where RawValue : Decodable, RawValue : Encodable
+ +
+
+

A default strategy for decoding optional response headers.

+ +

The DefaultHeaderStrategyOptional struct provides a default strategy for decoding optional response headers +by checking if the header key is present in the response decoder.

+ +

Example usage:

+
@ResponseHeaderWrapper<Header, DefaultHeaderStrategyOptional> var header: Header?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decode(decoder:) + +
    +
    +
    +
    +
    +
    +

    Decodes the response header value from the given decoder.

    +
    +

    Throws

    + An error if the header key is missing or the decoder is not a response decoder. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decode(decoder: Decoder) throws -> RawValue?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to decode the header value from.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded header value, or nil if the header key is missing or the decoder is not a response decoder.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/EmptyResponse.html b/docs/Structs/EmptyResponse.html new file mode 100644 index 0000000..7bff624 --- /dev/null +++ b/docs/Structs/EmptyResponse.html @@ -0,0 +1,375 @@ + + + + EmptyResponse Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

EmptyResponse

+
+
+ +
public struct EmptyResponse : Decodable
+ +
+
+

A struct representing an empty response.

+ +

The EmptyResponse struct is used to represent an empty response from an API. +It conforms to the Decodable protocol, allowing it to be decoded from an empty response body.

+ +

Example usage:

+
let emptyResponse = try JSONDecoder().decode(EmptyResponse.self, from: Data())
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/NestedResponse.html b/docs/Structs/NestedResponse.html new file mode 100644 index 0000000..5d39c26 --- /dev/null +++ b/docs/Structs/NestedResponse.html @@ -0,0 +1,536 @@ + + + + NestedResponse Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NestedResponse

+
+
+ +
@propertyWrapper
+public struct NestedResponse<Response> where Response : Decodable
+
extension NestedResponse: Decodable
+ +
+
+

A property wrapper that wraps a nested response.

+ +

To support inheritance, which can be especially useful for pagination, use the property wrapper @NestedResponse to add nested responses.

+ +

While decoding the flat HTTP response will be applied recursively to all nested responses, therefore it is possible, that different nested responses access different values of the original HTTP response.

+ +

Example:

+
struct PaginatedResponse<NestedRequest: Request>: Decodable {
+
+    /// Header which indicates how many more elements are available
+    @ResponseHeader<DefaultHeaderStrategy> var totalElements
+
+    @NestedResponse var nested: NestedRequest
+}
+
+struct ListRequest: Request {
+
+    typealias Response = PaginatedResponse<ListResponse>
+
+    struct ListResponse: Decodable {
+        // see other examples
+    }
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the nested response.

    + +

    This property holds the nested response value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: Response
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of NestedResponse with the specified wrapped value.

    + +

    Example usage:

    +
    @NestedResponse var nestedResponse: MyResponseType
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: Response)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the nested response.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of NestedResponse by decoding from the given decoder.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/OptionalContentStrategy.html b/docs/Structs/OptionalContentStrategy.html new file mode 100644 index 0000000..6bd7e89 --- /dev/null +++ b/docs/Structs/OptionalContentStrategy.html @@ -0,0 +1,496 @@ + + + + OptionalContentStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OptionalContentStrategy

+
+
+ +
public struct OptionalContentStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 204.

+ +

The OptionalContentStrategy struct provides a strategy for validating response bodies +with a status code of 204 (No Content). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, OptionalContentStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Determines whether the decoding should fail when no content is returned.

    + +

    Example usage:

    +
    let allowsEmpty = OptionalContentStrategy.allowsEmptyContent(for: 204)
    +print(allowsEmpty) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is within the acceptable range.

    + +

    Example usage:

    +
    let isValid = OptionalContentStrategy.validate(statusCode: 200)
    +print(isValid) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is valid.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/QueryItem.html b/docs/Structs/QueryItem.html new file mode 100644 index 0000000..87fcc20 --- /dev/null +++ b/docs/Structs/QueryItem.html @@ -0,0 +1,1090 @@ + + + + QueryItem Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryItem

+
+
+ +
@propertyWrapper
+public struct QueryItem<T> where T : QueryItemValue
+
extension QueryItem: Encodable where T: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle query items in a request.

+ +

Example usage:

+
@QueryItem(name: "search") var searchQuery: String
+
+ +

This property wrapper can be used to manage query items in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The custom name of the query item, can be nil.

    + +

    This property holds the custom name of the query item, which can be nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the query item value.

    + +

    This property holds the wrapped value representing the query item value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified wrapped value.

    + +

    Example usage:

    +
    @QueryItem var searchQuery: String = "example"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the query item value.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and default value.

    + +

    Example usage:

    +
    @QueryItem(name: "search") var searchQuery: String = "example"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String? = nil, defaultValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    + + defaultValue + + +
    +

    The default value representing the query item value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Bool +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a default value of false.

    + +

    Example usage:

    +
    @QueryItem(name: "isActive") var isActive: Bool
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Bool? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "isActive") var isActive: Bool?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Double +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a default value of 0.0.

    + +

    Example usage:

    +
    @QueryItem(name: "price") var price: Double
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Double? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "price") var price: Double?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "count") var count: Int?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and an empty string as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "search") var searchQuery: String
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "search") var searchQuery: String?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T: OptionalType, T.Wrapped: RawRepresentable +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "status") var status: MyEnum?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestCachePolicy.html b/docs/Structs/RequestCachePolicy.html new file mode 100644 index 0000000..cddfe77 --- /dev/null +++ b/docs/Structs/RequestCachePolicy.html @@ -0,0 +1,536 @@ + + + + RequestCachePolicy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestCachePolicy

+
+
+ +
@propertyWrapper
+public struct RequestCachePolicy
+
extension RequestCachePolicy: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle request cache policies.

+ +

The RequestCachePolicy struct is a property wrapper that allows you to specify the cache policy for a request. +It wraps the URLRequest.CachePolicy type and provides a default value of .useProtocolCachePolicy.

+ +

Example usage:

+
@RequestCachePolicy var cachePolicy: URLRequest.CachePolicy
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the cache policy.

    + +

    This property holds the URLRequest.CachePolicy value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: URLRequest.CachePolicy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestCachePolicy with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestCachePolicy var cachePolicy: URLRequest.CachePolicy = .reloadIgnoringLocalCacheData
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: URLRequest.CachePolicy = .useProtocolCachePolicy)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the cache policy. Defaults to .useProtocolCachePolicy.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encodable +

+
+
+
    +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Encodes this value into the given encoder.

    + +

    This method should never be called because URLRequest.CachePolicy does not conform to Encodable. +If called, it will cause a runtime failure.

    +
    +

    Throws

    + A runtime error indicating that this method should not be called. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encode(to encoder: any Encoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + encoder + + +
    +

    The encoder to write data to.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestCookies.html b/docs/Structs/RequestCookies.html new file mode 100644 index 0000000..8bd8349 --- /dev/null +++ b/docs/Structs/RequestCookies.html @@ -0,0 +1,535 @@ + + + + RequestCookies Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestCookies

+
+
+ +
@propertyWrapper
+public struct RequestCookies
+
extension RequestCookies: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP cookies in a request.

+ +

Example usage:

+
@RequestCookies var cookies: [HTTPCookie]
+
+ +

This property wrapper can be used to manage HTTP cookies in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing an array of HTTPCookie objects.

    + +

    This property holds the array of HTTPCookie objects that are managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: [HTTPCookie]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestCookies with an optional array of HTTPCookie objects.

    + +

    Example usage:

    +
    @RequestCookies var cookies: [HTTPCookie] = [cookie1, cookie2]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: [HTTPCookie] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    An array of HTTPCookie objects. Defaults to an empty array.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encodable +

+
+
+
    +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Encodes this value into the given encoder.

    + +

    This method should never be called because HTTPCookie does not conform to Encodable. +If called, it will cause a runtime failure.

    +
    +

    Throws

    + A runtime error indicating that this method should not be called. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encode(to encoder: Encoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + encoder + + +
    +

    The encoder to write data to.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestHTTPMethod.html b/docs/Structs/RequestHTTPMethod.html new file mode 100644 index 0000000..c634e52 --- /dev/null +++ b/docs/Structs/RequestHTTPMethod.html @@ -0,0 +1,465 @@ + + + + RequestHTTPMethod Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestHTTPMethod

+
+
+ +
@propertyWrapper
+public struct RequestHTTPMethod : Encodable
+ +
+
+

A property wrapper for the HTTP method of a request.

+ +

The RequestHTTPMethod property wrapper provides a convenient way to manage the HTTP method of a request. +It allows you to specify the HTTP method for a request using a property wrapper syntax.

+ +

Example usage:

+
@RequestHTTPMethod var httpMethod: HTTPMethod = .post
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the HTTP method.

    + +

    This property holds the HTTPMethod value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: HTTPMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHTTPMethod with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestHTTPMethod var httpMethod: HTTPMethod = .post
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: HTTPMethod = .get)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the HTTP method. Defaults to .get.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestHeader.html b/docs/Structs/RequestHeader.html new file mode 100644 index 0000000..3183c3f --- /dev/null +++ b/docs/Structs/RequestHeader.html @@ -0,0 +1,694 @@ + + + + RequestHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestHeader

+
+
+ +
@propertyWrapper
+public struct RequestHeader<T> where T : RequestHeaderValue
+
extension RequestHeader: Encodable where T: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP headers in a request.

+ +

Example usage:

+
@RequestHeader var header: String
+
+ +

This property wrapper can be used to manage HTTP headers in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The custom name of the header item, can be nil.

    + +

    This property holds the custom name of the header item, which can be nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the header value.

    + +

    This property holds the wrapped value representing the header value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestHeader var header: String = "value"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the header value.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified name and default value.

    + +

    Example usage:

    +
    @RequestHeader(name: "Custom-Header") var header: String = "value"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String? = nil, defaultValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The custom name of the header item, can be nil.

    +
    +
    + + defaultValue + + +
    +

    The default value representing the header value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified name and an empty string as the default value.

    + +

    Example usage:

    +
    @RequestHeader(name: "Custom-Header") var header: String
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the header item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @RequestHeader(name: "Custom-Header") var header: String?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the header item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPath.html b/docs/Structs/RequestPath.html new file mode 100644 index 0000000..8bd5ec1 --- /dev/null +++ b/docs/Structs/RequestPath.html @@ -0,0 +1,546 @@ + + + + RequestPath Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestPath

+
+
+ +
@propertyWrapper
+public struct RequestPath : Encodable
+
extension RequestPath: ExpressibleByStringLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByUnicodeScalarLiteral
+ +
+
+

A property wrapper that provides a convenient way to handle request paths.

+ +

The RequestPath struct is a property wrapper that allows you to specify the path for a request. +It wraps a String value and provides a default value of an empty string.

+ +

Example usage:

+
@RequestPath var path: String
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the request path.

    + +

    This property holds the String value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPath with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestPath var path: String = "/api/v1/resource"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: String = "")
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the request path. Defaults to an empty string.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
  • +
  • + +
  • +
  • +
    + + + + StringLiteralType + +
    +
  • +
  • +
    + + + + init(stringLiteral:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPath with the specified string literal.

    + +

    Example usage:

    +
    @RequestPath var path: String = "/api/v1/resource"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(stringLiteral value: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The string literal to initialize the RequestPath with.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html b/docs/Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html new file mode 100644 index 0000000..76e6a5a --- /dev/null +++ b/docs/Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html @@ -0,0 +1,370 @@ + + + + ExtendedGraphemeClusterLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ExtendedGraphemeClusterLiteralType

+
+
+ +
public typealias ExtendedGraphemeClusterLiteralType = String.ExtendedGraphemeClusterLiteralType
+ +
+
+

Initializes a new instance of RequestPath with the specified string literal.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPath/StringLiteralType.html b/docs/Structs/RequestPath/StringLiteralType.html new file mode 100644 index 0000000..a919b2d --- /dev/null +++ b/docs/Structs/RequestPath/StringLiteralType.html @@ -0,0 +1,370 @@ + + + + StringLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

StringLiteralType

+
+
+ +
public typealias StringLiteralType = String.StringLiteralType
+ +
+
+

Initializes a new instance of RequestPath with the specified string literal.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPath/UnicodeScalarLiteralType.html b/docs/Structs/RequestPath/UnicodeScalarLiteralType.html new file mode 100644 index 0000000..aa082eb --- /dev/null +++ b/docs/Structs/RequestPath/UnicodeScalarLiteralType.html @@ -0,0 +1,370 @@ + + + + UnicodeScalarLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnicodeScalarLiteralType

+
+
+ +
public typealias UnicodeScalarLiteralType = String.UnicodeScalarLiteralType
+ +
+
+

Initializes a new instance of RequestPath with the specified string literal.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPathParameter.html b/docs/Structs/RequestPathParameter.html new file mode 100644 index 0000000..bb88f18 --- /dev/null +++ b/docs/Structs/RequestPathParameter.html @@ -0,0 +1,1085 @@ + + + + RequestPathParameter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestPathParameter

+
+
+ +
@propertyWrapper
+public struct RequestPathParameter<T> where T : RequestPathParameterValue
+
extension RequestPathParameter: Encodable where T: Encodable
+
extension RequestPathParameter: ExpressibleByNilLiteral where T: ExpressibleByNilLiteral
+
extension RequestPathParameter: ExpressibleByStringLiteral,
+    ExpressibleByExtendedGraphemeClusterLiteral,
+    ExpressibleByUnicodeScalarLiteral
+where T == String
+
extension RequestPathParameter: ExpressibleByIntegerLiteral where T == IntegerLiteralType
+ +
+
+

A property wrapper that provides a convenient way to handle path parameters in a request.

+ +

Example usage:

+
@RequestPathParameter var userId: String
+
+ +

This property wrapper can be used to manage path parameters in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The custom name of the path parameter, can be nil.

    + +

    This property holds the custom name of the path parameter, which can be nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the path parameter value.

    + +

    This property holds the wrapped value representing the path parameter value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestPathParameter var userId: String = "123"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the path parameter value.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and default value.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: String = "123"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?, defaultValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    + + defaultValue + + +
    +

    The default value representing the path parameter value.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + getParameterType() + +
    +
    +
    +
    +
    +
    +

    Returns the type of the path parameter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getParameterType() -> Any.Type
    + +
    +
    +
    +

    Return Value

    +

    The type of the path parameter.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and an empty string as the default value.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: String
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int16 +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int16
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int32 +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int32
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int64 +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int64
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T: ExpressibleByNilLiteral +

+
+
+ +
+
+
+ + +
+ +

Available where T == String +

+
+
+ +
+
+
+ + +
+ +

Available where T == IntegerLiteralType +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html b/docs/Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html new file mode 100644 index 0000000..0db5299 --- /dev/null +++ b/docs/Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html @@ -0,0 +1,369 @@ + + + + ExtendedGraphemeClusterLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ExtendedGraphemeClusterLiteralType

+
+
+ +
public typealias ExtendedGraphemeClusterLiteralType = String.ExtendedGraphemeClusterLiteralType
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPathParameter/StringLiteralType.html b/docs/Structs/RequestPathParameter/StringLiteralType.html new file mode 100644 index 0000000..b8c624a --- /dev/null +++ b/docs/Structs/RequestPathParameter/StringLiteralType.html @@ -0,0 +1,369 @@ + + + + StringLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

StringLiteralType

+
+
+ +
public typealias StringLiteralType = String.StringLiteralType
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestPathParameter/UnicodeScalarLiteralType.html b/docs/Structs/RequestPathParameter/UnicodeScalarLiteralType.html new file mode 100644 index 0000000..ca83f2d --- /dev/null +++ b/docs/Structs/RequestPathParameter/UnicodeScalarLiteralType.html @@ -0,0 +1,369 @@ + + + + UnicodeScalarLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnicodeScalarLiteralType

+
+
+ +
public typealias UnicodeScalarLiteralType = String.UnicodeScalarLiteralType
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/RequestURL.html b/docs/Structs/RequestURL.html new file mode 100644 index 0000000..52dd39b --- /dev/null +++ b/docs/Structs/RequestURL.html @@ -0,0 +1,465 @@ + + + + RequestURL Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestURL

+
+
+ +
@propertyWrapper
+public struct RequestURL : Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle request URLs.

+ +

The RequestURL struct is a property wrapper that allows you to specify the URL for a request. +It wraps a URL? value and provides a default value of nil.

+ +

Example usage:

+
@RequestURL var url: URL?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the request URL.

    + +

    This property holds the URL? value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: URL?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestURL with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestURL var url: URL? = URL(string: "https://api.example.com/resource")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: URL? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the request URL. Defaults to nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ResponseBodyWrapper.html b/docs/Structs/ResponseBodyWrapper.html new file mode 100644 index 0000000..38c8262 --- /dev/null +++ b/docs/Structs/ResponseBodyWrapper.html @@ -0,0 +1,566 @@ + + + + ResponseBodyWrapper Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseBodyWrapper

+
+
+ +
@propertyWrapper
+public struct ResponseBodyWrapper<Body, BodyStrategy> where Body : Decodable, BodyStrategy : ResponseBodyDecodingStrategy
+
extension ResponseBodyWrapper: Decodable
+ +
+
+

A property wrapper that wraps a response body.

+ +

The ResponseBodyWrapper property wrapper is used to wrap a response body value. +It provides a wrappedValue property that holds the response body value.

+ +

Example usage:

+
@ResponseBodyWrapper var responseBody: MyResponseType?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the decoded response body.

    + +

    This property holds the decoded response body that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: Body?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseBodyWrapper with a nil value.

    + +

    Example usage:

    +
    @ResponseBodyWrapper var responseBody: MyResponseType?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseBodyWrapper with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseBodyWrapper var responseBody: MyResponseType? = MyResponseType()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: Body?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the decoded response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Decodable +

+
+
+
    +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseBodyWrapper from a decoder.

    + +

    Example usage:

    +
    let responseBody: MyResponseType? = try ResponseBodyWrapper(from: decoder)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to use for decoding the response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ResponseCookies.html b/docs/Structs/ResponseCookies.html new file mode 100644 index 0000000..76b556a --- /dev/null +++ b/docs/Structs/ResponseCookies.html @@ -0,0 +1,522 @@ + + + + ResponseCookies Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseCookies

+
+
+ +
@propertyWrapper
+public struct ResponseCookies
+
extension ResponseCookies: Decodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP cookies in a response.

+ +

Example usage:

+
@ResponseCookies var cookies: [HTTPCookie]
+
+ +

This property wrapper can be used to manage HTTP cookies in a response.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing an array of HTTPCookie objects.

    + +

    This property holds the array of HTTPCookie objects that are managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: [HTTPCookie]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseCookies with an optional array of HTTPCookie objects.

    + +

    Example usage:

    +
    @ResponseCookies var cookies: [HTTPCookie] = [cookie1, cookie2]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: [HTTPCookie] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    An array of HTTPCookie objects. Defaults to an empty array.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseCookies by decoding from the given decoder.

    + +

    This initializer should only be used with a ResponseDecoding decoder. +If the decoder is not a ResponseDecoding instance, a runtime failure will occur.

    +
    +

    Throws

    + APIError.invalidResponse if the response is invalid. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ResponseErrorBodyWrapper.html b/docs/Structs/ResponseErrorBodyWrapper.html new file mode 100644 index 0000000..a4e7730 --- /dev/null +++ b/docs/Structs/ResponseErrorBodyWrapper.html @@ -0,0 +1,566 @@ + + + + ResponseErrorBodyWrapper Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseErrorBodyWrapper

+
+
+ +
@propertyWrapper
+public struct ResponseErrorBodyWrapper<Body, BodyStrategy> where Body : Decodable, BodyStrategy : ResponseErrorBodyDecodingStrategy
+
extension ResponseErrorBodyWrapper: Decodable
+ +
+
+

A property wrapper that wraps an error response body.

+ +

The ResponseErrorBodyWrapper property wrapper is used to wrap an error response body value. +It provides a wrappedValue property that holds the error response body value.

+ +

Example usage:

+
@ResponseErrorBodyWrapper var errorResponseBody: MyErrorResponseType?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the decoded error response body.

    + +

    This property holds the decoded error response body that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: Body?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseErrorBodyWrapper with a nil value.

    + +

    Example usage:

    +
    @ResponseErrorBodyWrapper var errorResponseBody: MyErrorResponseType?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseErrorBodyWrapper with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseErrorBodyWrapper var errorResponseBody: MyErrorResponseType? = MyErrorResponseType()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: Body?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the decoded error response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Decodable +

+
+
+
    +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseErrorBodyWrapper from a decoder.

    + +

    Example usage:

    +
    let errorResponseBody: MyErrorResponseType? = try ResponseErrorBodyWrapper(from: decoder)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to use for decoding the error response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ResponseHeader.html b/docs/Structs/ResponseHeader.html new file mode 100644 index 0000000..6477683 --- /dev/null +++ b/docs/Structs/ResponseHeader.html @@ -0,0 +1,540 @@ + + + + ResponseHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseHeader

+
+
+ +
@propertyWrapper
+public struct ResponseHeader<DecodingStrategy> where DecodingStrategy : ResponseHeaderDecodingStrategy
+
extension ResponseHeader: Decodable where DecodingStrategy.RawValue: Decodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP headers in a response.

+ +

The ResponseHeader struct is a property wrapper that allows you to decode HTTP headers from a response +using a specified decoding strategy. It wraps the DecodingStrategy.RawValue type and provides a default value.

+ +

Example usage:

+
@ResponseHeader<CustomDecodingStrategy> var header: String
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the decoded header value.

    + +

    This property holds the DecodingStrategy.RawValue value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: DecodingStrategy.RawValue
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseHeader with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseHeader<CustomDecodingStrategy> var header: String = "value"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: DecodingStrategy.RawValue)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the decoded header value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where DecodingStrategy.RawValue: Decodable +

+
+
+
    +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseHeader by decoding from the given decoder.

    + +

    This initializer uses the specified decoding strategy to decode the header value from the given decoder.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +

    Example usage:

    +
    let decoder = JSONDecoder()
    +let header = try ResponseHeader<CustomDecodingStrategy>(from: decoder)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ResponseStatusCode.html b/docs/Structs/ResponseStatusCode.html new file mode 100644 index 0000000..119d16d --- /dev/null +++ b/docs/Structs/ResponseStatusCode.html @@ -0,0 +1,531 @@ + + + + ResponseStatusCode Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseStatusCode

+
+
+ +
@propertyWrapper
+public struct ResponseStatusCode : Decodable
+ +
+
+

A property wrapper that provides a convenient way to handle response status codes.

+ +

The ResponseStatusCode struct is a property wrapper that allows you to specify the status code for a response. +It wraps the UInt16 type and provides a default value of 0.

+ +

Example usage:

+
@ResponseStatusCode var statusCode: UInt16
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the status code.

    + +

    This property holds the UInt16 value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: UInt16
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + projectedValue + +
    +
    +
    +
    +
    +
    +

    The projected value representing the HTTP status code.

    + +

    This property provides a convenient way to access the HTTPStatusCode value corresponding to the wrapped value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var projectedValue: HTTPStatusCode? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseStatusCode with the default value of 0.

    + +

    Example usage:

    +
    @ResponseStatusCode var statusCode: UInt16 = 0
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseStatusCode with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseStatusCode var statusCode: UInt16 = 200
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: UInt16)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the status code.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus200BodyStrategy.html b/docs/Structs/ValidateStatus200BodyStrategy.html new file mode 100644 index 0000000..a65430f --- /dev/null +++ b/docs/Structs/ValidateStatus200BodyStrategy.html @@ -0,0 +1,490 @@ + + + + ValidateStatus200BodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus200BodyStrategy

+
+
+ +
public struct ValidateStatus200BodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 200.

+ +

The ValidateStatus200BodyStrategy struct provides a strategy for validating response bodies +with a status code of 200 (OK). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, ValidateStatus200BodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether empty content is allowed for the given status code.

    + +

    This method always returns false for status code 200, indicating that empty content is not allowed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for _: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is 200 (OK).

    + +

    This method checks if the given status code is equal to 200 (OK).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is 200 (OK).

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus201BodyStrategy.html b/docs/Structs/ValidateStatus201BodyStrategy.html new file mode 100644 index 0000000..53e035e --- /dev/null +++ b/docs/Structs/ValidateStatus201BodyStrategy.html @@ -0,0 +1,493 @@ + + + + ValidateStatus201BodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus201BodyStrategy

+
+
+ +
public struct ValidateStatus201BodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 201.

+ +

The ValidateStatus201BodyStrategy struct provides a strategy for validating response bodies +with a status code of 201 (Created). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, ValidateStatus201BodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether empty content is allowed for the given status code.

    + +

    This method always returns false for status code 201, indicating that empty content is not allowed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is 201 (Created).

    + +

    Example usage:

    +
    let isValid = ValidateStatus201BodyStrategy.validate(statusCode: 201)
    +print(isValid) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is 201 (Created).

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus303BodyStrategy.html b/docs/Structs/ValidateStatus303BodyStrategy.html new file mode 100644 index 0000000..49c6b53 --- /dev/null +++ b/docs/Structs/ValidateStatus303BodyStrategy.html @@ -0,0 +1,490 @@ + + + + ValidateStatus303BodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus303BodyStrategy

+
+
+ +
public struct ValidateStatus303BodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 303.

+ +

The ValidateStatus303BodyStrategy struct provides a strategy for validating response bodies +with a status code of 303 (See Other). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, ValidateStatus303BodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether empty content is allowed for the given status code.

    + +

    This method always returns true for status code 303, indicating that empty content is allowed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for _: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is 303 (See Other).

    + +

    This method checks if the given status code is equal to the raw value of HTTPStatusCode.seeOther.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is 303.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus400ErrorBodyStrategy.html b/docs/Structs/ValidateStatus400ErrorBodyStrategy.html new file mode 100644 index 0000000..bea927d --- /dev/null +++ b/docs/Structs/ValidateStatus400ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus400ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus400ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus400ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 400.

+ +

The ValidateStatus400ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 400 (Bad Request). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 400.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus400ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Checks if the given status code represents an error.

    + +

    This method checks if the given status code is equal to 400 (Bad Request).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 400, false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus401ErrorBodyStrategy.html b/docs/Structs/ValidateStatus401ErrorBodyStrategy.html new file mode 100644 index 0000000..4eb075f --- /dev/null +++ b/docs/Structs/ValidateStatus401ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus401ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus401ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus401ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 401.

+ +

The ValidateStatus401ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 401 (Unauthorized). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 401.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus401ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Checks if the given status code represents an error.

    + +

    This method checks if the given status code is equal to 401 (Unauthorized).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 401, false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus403ErrorBodyStrategy.html b/docs/Structs/ValidateStatus403ErrorBodyStrategy.html new file mode 100644 index 0000000..6287ff9 --- /dev/null +++ b/docs/Structs/ValidateStatus403ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus403ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus403ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus403ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 403.

+ +

The ValidateStatus403ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 403 (Forbidden). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 403.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus403ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Forbidden” (403).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 403 (Forbidden), false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus404ErrorBodyStrategy.html b/docs/Structs/ValidateStatus404ErrorBodyStrategy.html new file mode 100644 index 0000000..2e24f17 --- /dev/null +++ b/docs/Structs/ValidateStatus404ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus404ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus404ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus404ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 404.

+ +

The ValidateStatus404ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 404 (Not Found). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 404.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus404ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Not Found” (404).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 404, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus410ErrorBodyStrategy.html b/docs/Structs/ValidateStatus410ErrorBodyStrategy.html new file mode 100644 index 0000000..e1ea98e --- /dev/null +++ b/docs/Structs/ValidateStatus410ErrorBodyStrategy.html @@ -0,0 +1,433 @@ + + + + ValidateStatus410ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus410ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus410ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating the body of a response with a status code of 410.

+ +

The ValidateStatus410ErrorBodyStrategy struct provides a strategy for validating the body of a response with a status code of 410.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus410ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Gone” (410).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 410, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Structs/ValidateStatus422ErrorBodyStrategy.html b/docs/Structs/ValidateStatus422ErrorBodyStrategy.html new file mode 100644 index 0000000..bc62031 --- /dev/null +++ b/docs/Structs/ValidateStatus422ErrorBodyStrategy.html @@ -0,0 +1,433 @@ + + + + ValidateStatus422ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus422ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus422ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating the body of a response with a status code of 422.

+ +

The ValidateStatus422ErrorBodyStrategy struct provides a strategy for validating the body of a response with a status code of 422.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus422ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Unprocessable Entity” (422).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 422, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases.html b/docs/Typealiases.html new file mode 100644 index 0000000..ee1aaa3 --- /dev/null +++ b/docs/Typealiases.html @@ -0,0 +1,486 @@ + + + + Type Aliases Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/FormURLEncodedDecodable.html b/docs/Typealiases/FormURLEncodedDecodable.html new file mode 100644 index 0000000..df22013 --- /dev/null +++ b/docs/Typealiases/FormURLEncodedDecodable.html @@ -0,0 +1,368 @@ + + + + FormURLEncodedDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedDecodable

+
+
+ +
public typealias FormURLEncodedDecodable = Decodable & FormURLEncodedFormatProvider
+ +
+
+

A type that can decode itself from an external form-url encoded representation.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/FormURLEncodedEncodable.html b/docs/Typealiases/FormURLEncodedEncodable.html new file mode 100644 index 0000000..11b3a6c --- /dev/null +++ b/docs/Typealiases/FormURLEncodedEncodable.html @@ -0,0 +1,368 @@ + + + + FormURLEncodedEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Typealiases/FormURLEncodedRequest.html b/docs/Typealiases/FormURLEncodedRequest.html new file mode 100644 index 0000000..053250c --- /dev/null +++ b/docs/Typealiases/FormURLEncodedRequest.html @@ -0,0 +1,368 @@ + + + + FormURLEncodedRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedRequest

+
+
+ +
public typealias FormURLEncodedRequest = Request & FormURLEncodedEncodable
+ +
+
+

Protocol indicating a given request should be encoded into a form URL encoded request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/JSONDecodable.html b/docs/Typealiases/JSONDecodable.html new file mode 100644 index 0000000..b20b25a --- /dev/null +++ b/docs/Typealiases/JSONDecodable.html @@ -0,0 +1,368 @@ + + + + JSONDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONDecodable

+
+
+ +
public typealias JSONDecodable = Decodable & JSONFormatProvider
+ +
+
+

A type that can decode itself from an external JSON representation.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/JSONEncodable.html b/docs/Typealiases/JSONEncodable.html new file mode 100644 index 0000000..92c3bab --- /dev/null +++ b/docs/Typealiases/JSONEncodable.html @@ -0,0 +1,368 @@ + + + + JSONEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Typealiases/JSONRequest.html b/docs/Typealiases/JSONRequest.html new file mode 100644 index 0000000..349e677 --- /dev/null +++ b/docs/Typealiases/JSONRequest.html @@ -0,0 +1,368 @@ + + + + JSONRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONRequest

+
+
+ +
public typealias JSONRequest = Request & JSONEncodable
+ +
+
+

Protocol indicating a given request should be encoded into a JSON request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/PlainDecodable.html b/docs/Typealiases/PlainDecodable.html new file mode 100644 index 0000000..6964757 --- /dev/null +++ b/docs/Typealiases/PlainDecodable.html @@ -0,0 +1,368 @@ + + + + PlainDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainDecodable

+
+
+ +
public typealias PlainDecodable = String
+ +
+
+

A type which represents plain text

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/PlainEncodable.html b/docs/Typealiases/PlainEncodable.html new file mode 100644 index 0000000..602a991 --- /dev/null +++ b/docs/Typealiases/PlainEncodable.html @@ -0,0 +1,368 @@ + + + + PlainEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Typealiases/PlainRequest.html b/docs/Typealiases/PlainRequest.html new file mode 100644 index 0000000..f960085 --- /dev/null +++ b/docs/Typealiases/PlainRequest.html @@ -0,0 +1,368 @@ + + + + PlainRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainRequest

+
+
+ +
public typealias PlainRequest = Request & PlainEncodable
+ +
+
+

Protocol indicating a given request should be encoded into a JSON request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/ResponseBody.html b/docs/Typealiases/ResponseBody.html new file mode 100644 index 0000000..7778ba8 --- /dev/null +++ b/docs/Typealiases/ResponseBody.html @@ -0,0 +1,375 @@ + + + + ResponseBody Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseBody

+
+
+ +
public typealias ResponseBody<Body> = ResponseBodyWrapper<Body, DefaultBodyStrategy> where Body : Decodable
+ +
+
+

A type alias for ResponseBodyWrapper with a default body decoding strategy.

+ +

The ResponseBody type alias provides a convenient way to use ResponseBodyWrapper with the DefaultBodyStrategy. +It represents the response body of a request and uses the default decoding strategy to decode the response body.

+ +

Example usage:

+
let responseBody: ResponseBody<MyResponseType>
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/ResponseErrorBody.html b/docs/Typealiases/ResponseErrorBody.html new file mode 100644 index 0000000..32bfd2a --- /dev/null +++ b/docs/Typealiases/ResponseErrorBody.html @@ -0,0 +1,375 @@ + + + + ResponseErrorBody Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseErrorBody

+
+
+ +
public typealias ResponseErrorBody<Body> = ResponseErrorBodyWrapper<Body, DefaultErrorBodyStrategy> where Body : Decodable
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a default error body decoding strategy.

+ +

The ResponseErrorBody type alias provides a convenient way to use ResponseErrorBodyWrapper with the DefaultErrorBodyStrategy. +It represents the error response body of a request and uses the default decoding strategy to decode the error response body.

+ +

Example usage:

+
let errorResponseBody: ResponseErrorBody<MyErrorResponseType>
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/XMLDecodable.html b/docs/Typealiases/XMLDecodable.html new file mode 100644 index 0000000..2484c2d --- /dev/null +++ b/docs/Typealiases/XMLDecodable.html @@ -0,0 +1,368 @@ + + + + XMLDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLDecodable

+
+
+ +
public typealias XMLDecodable = Decodable & XMLFormatProvider
+ +
+
+

A type that can decode itself from an external JSON representation.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/Typealiases/XMLEncodable.html b/docs/Typealiases/XMLEncodable.html new file mode 100644 index 0000000..27a9317 --- /dev/null +++ b/docs/Typealiases/XMLEncodable.html @@ -0,0 +1,368 @@ + + + + XMLEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/Typealiases/XMLRequest.html b/docs/Typealiases/XMLRequest.html new file mode 100644 index 0000000..46d2609 --- /dev/null +++ b/docs/Typealiases/XMLRequest.html @@ -0,0 +1,368 @@ + + + + XMLRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLRequest

+
+
+ +
public typealias XMLRequest = Request & XMLEncodable
+ +
+
+

Protocol indicating a given request should be encoded into an XML request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/badge.svg b/docs/badge.svg new file mode 100644 index 0000000..a096fec --- /dev/null +++ b/docs/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 100% + + + 100% + + + diff --git a/docs/css/highlight.css b/docs/css/highlight.css new file mode 100644 index 0000000..c170357 --- /dev/null +++ b/docs/css/highlight.css @@ -0,0 +1,202 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight .c { + color: #999988; + font-style: italic; } + +.highlight .err { + color: #a61717; + background-color: #e3d2d2; } + +.highlight .k { + color: #000000; + font-weight: bold; } + +.highlight .o { + color: #000000; + font-weight: bold; } + +.highlight .cm { + color: #999988; + font-style: italic; } + +.highlight .cp { + color: #999999; + font-weight: bold; } + +.highlight .c1 { + color: #999988; + font-style: italic; } + +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + +.highlight .gd { + color: #000000; + background-color: #ffdddd; } + +.highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + +.highlight .ge { + color: #000000; + font-style: italic; } + +.highlight .gr { + color: #aa0000; } + +.highlight .gh { + color: #999999; } + +.highlight .gi { + color: #000000; + background-color: #ddffdd; } + +.highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + +.highlight .go { + color: #888888; } + +.highlight .gp { + color: #555555; } + +.highlight .gs { + font-weight: bold; } + +.highlight .gu { + color: #aaaaaa; } + +.highlight .gt { + color: #aa0000; } + +.highlight .kc { + color: #000000; + font-weight: bold; } + +.highlight .kd { + color: #000000; + font-weight: bold; } + +.highlight .kp { + color: #000000; + font-weight: bold; } + +.highlight .kr { + color: #000000; + font-weight: bold; } + +.highlight .kt { + color: #445588; } + +.highlight .m { + color: #009999; } + +.highlight .s { + color: #d14; } + +.highlight .na { + color: #008080; } + +.highlight .nb { + color: #0086B3; } + +.highlight .nc { + color: #445588; + font-weight: bold; } + +.highlight .no { + color: #008080; } + +.highlight .ni { + color: #800080; } + +.highlight .ne { + color: #990000; + font-weight: bold; } + +.highlight .nf { + color: #990000; } + +.highlight .nn { + color: #555555; } + +.highlight .nt { + color: #000080; } + +.highlight .nv { + color: #008080; } + +.highlight .ow { + color: #000000; + font-weight: bold; } + +.highlight .w { + color: #bbbbbb; } + +.highlight .mf { + color: #009999; } + +.highlight .mh { + color: #009999; } + +.highlight .mi { + color: #009999; } + +.highlight .mo { + color: #009999; } + +.highlight .sb { + color: #d14; } + +.highlight .sc { + color: #d14; } + +.highlight .sd { + color: #d14; } + +.highlight .s2 { + color: #d14; } + +.highlight .se { + color: #d14; } + +.highlight .sh { + color: #d14; } + +.highlight .si { + color: #d14; } + +.highlight .sx { + color: #d14; } + +.highlight .sr { + color: #009926; } + +.highlight .s1 { + color: #d14; } + +.highlight .ss { + color: #990073; } + +.highlight .bp { + color: #999999; } + +.highlight .vc { + color: #008080; } + +.highlight .vg { + color: #008080; } + +.highlight .vi { + color: #008080; } + +.highlight .il { + color: #009999; } diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css new file mode 100644 index 0000000..9d4b08b --- /dev/null +++ b/docs/css/jazzy.css @@ -0,0 +1,405 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + a.discouraged { + text-decoration: line-through; } + a.discouraged:hover, a.discouraged:focus { + text-decoration: underline line-through; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +hr { + height: 1px; + border: none; + background-color: #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { + background: #f7f7f7; + padding: .2em; } + .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 2px; + vertical-align: -3px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + .section-name p { + margin-bottom: inherit; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.section-name-container { + position: relative; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 20px; + font-size: 1rem; } + +.declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } + +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } + +form[role=search] .tt-highlight { + font-weight: bold; } + +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/Postie.docset/Contents/Info.plist b/docs/docsets/Postie.docset/Contents/Info.plist new file mode 100644 index 0000000..ed0a27a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleIdentifier + com.jazzy.postie + CFBundleName + Postie + DocSetPlatformFamily + postie + isDashDocset + + dashIndexFilePath + index.html + isJavaScriptEnabled + + DashDocSetFamily + dashtoc + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes.html new file mode 100644 index 0000000..fe5eaac --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes.html @@ -0,0 +1,387 @@ + + + + Classes Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/HTTPAPIClient.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/HTTPAPIClient.html new file mode 100644 index 0000000..e358c9e --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/HTTPAPIClient.html @@ -0,0 +1,1479 @@ + + + + HTTPAPIClient Class Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

HTTPAPIClient

+
+
+ +
open class HTTPAPIClient
+ +
+
+

A class responsible for sending HTTP API requests and handling responses.

+ +

The HTTPAPIClient class provides methods to send HTTP API requests using different encoding formats +and handle the responses. It supports callbacks, async-await, and Combine for handling responses.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + session + +
    +
    +
    +
    +
    +
    +

    The URL session provider used for sending requests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var session: URLSessionProvider { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + url + +
    +
    +
    +
    +
    +
    +

    The base URL for the API requests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var url: URL
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + pathPrefix + +
    +
    +
    +
    +
    +
    +

    An optional path prefix to be appended to the base URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var pathPrefix: String?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of HTTPAPIClient with the specified URL, path prefix, and session provider.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(url: URL, pathPrefix: String? = nil, session: URLSessionProvider = URLSession.shared)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + url + + +
    +

    The base URL for the API requests.

    +
    +
    + + pathPrefix + + +
    +

    An optional path prefix to be appended to the base URL.

    +
    +
    + + session + + +
    +

    The URL session provider used for sending requests. Defaults to URLSession.shared.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Callbacks +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<R>(_ request: R, receiveOn queue: DispatchQueue? = nil, callback: @escaping (Result<R.Response, Error>) -> Void) where R : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a JSON body using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myJsonRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request: JSONRequest>(
    +    _ request: Request,
    +    receiveOn queue: DispatchQueue? = nil,
    +    callback: @escaping (
    +        Result<Request.Response, Error>
    +    ) -> Void
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a Form URL Encoded body using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myFormURLEncodedRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request: FormURLEncodedRequest>(
    +    _ request: Request,
    +    receiveOn queue: DispatchQueue? = nil,
    +    callback: @escaping (
    +        Result<Request.Response, Error>
    +    ) -> Void
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a plain text body using a callback to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myPlainRequest) { result in
    +    switch result {
    +    case .success(let response):
    +        print("Received response: \(response)")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request: PlainRequest>(
    +    _ request: Request,
    +    receiveOn queue: DispatchQueue? = nil,
    +    callback: @escaping (
    +        Result<Request.Response, Error>
    +    ) -> Void
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    + + queue + + +
    +

    An optional dispatch queue to receive the callback on. Defaults to nil.

    +
    +
    + + callback + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Async-Await +

+
+
+
    +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<R>(_ request: R) async throws -> R.Response where R : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a JSON body using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myJsonRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) async throws -> Request.Response where Request : JSONBodyProvider, Request : JSONFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a Form URL Encoded body using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myFormURLEncodedRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) async throws -> Request.Response where Request : FormURLEncodedBodyProvider, Request : FormURLEncodedFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a plain text body using async-await to handle the response.

    +
    +

    Throws

    + An error if the request encoding or response decoding fails. + +
    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +let response = try await client.send(myPlainRequest)
    +print("Received response: \(response)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) async throws -> Request.Response where Request : PlainBodyProvider, Request : PlainFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded response.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Combine +

+
+
+
    +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<R>(_ request: R) -> AnyPublisher<R.Response, Error> where R : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a JSON body using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myJsonRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) -> AnyPublisher<Request.Response, Error> where Request : JSONBodyProvider, Request : JSONFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a Form URL Encoded body using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myFormURLEncodedRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) -> AnyPublisher<Request.Response, Error> where Request : FormURLEncodedBodyProvider, Request : FormURLEncodedFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
  • +
    + + + + send(_:) + +
    +
    +
    +
    +
    +
    +

    Sends an HTTP API request with a plain text body using Combine to handle the response.

    + +

    Example usage:

    +
    let client = HTTPAPIClient(url: URL(string: "https://api.example.com")!)
    +client.send(myPlainRequest)
    +    .sink(receiveCompletion: { completion in
    +        switch completion {
    +        case .finished:
    +            print("Request completed successfully")
    +        case .failure(let error):
    +            print("Request failed with error: \(error)")
    +        }
    +    }, receiveValue: { response in
    +        print("Received response: \(response)")
    +    })
    +    .store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func send<Request>(_ request: Request) -> AnyPublisher<Request.Response, Error> where Request : PlainBodyProvider, Request : PlainFormatProvider, Request : Request
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the decoded response or an error.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/RequestEncoder.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/RequestEncoder.html new file mode 100644 index 0000000..6da7b63 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/RequestEncoder.html @@ -0,0 +1,793 @@ + + + + RequestEncoder Class Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestEncoder

+
+
+ +
public class RequestEncoder
+
extension RequestEncoder: TopLevelEncoder
+ +
+
+

A class responsible for encoding HTTP requests into various formats.

+ +

The RequestEncoder class provides functionality to encode HTTP requests into different formats, +including JSON, Form URL Encoded, Plain, and XML. It uses the RequestEncoding encoder to perform +the encoding process.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(baseURL:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestEncoder with the specified base URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(baseURL: URL)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + baseURL + + +
    +

    The base URL for the requests.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + encode(_:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encode(myRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encode<Request>(_ request: Request) throws -> URLRequest where Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

JSON +

+
+
+
    +
  • +
    + + + + encodeJson(request:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request with a JSON body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodeJson(request: myJsonRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodeJson<Request>(request: Request) throws -> URLRequest where Request : JSONBodyProvider, Request : JSONFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Form URL Encoded +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Encodes an HTTP request with a Form URL Encoded body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodeFormURLEncoded(request: myFormURLEncodedRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodeFormURLEncoded<Request>(request: Request) throws -> URLRequest where Request : FormURLEncodedBodyProvider, Request : FormURLEncodedFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Plain +

+
+
+
    +
  • +
    + + + + encodePlain(request:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request with a plain text body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodePlain(request: myPlainRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodePlain<Request>(request: Request) throws -> URLRequest where Request : PlainBodyProvider, Request : PlainFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

XML +

+
+
+
    +
  • +
    + + + + encodeXML(request:) + +
    +
    +
    +
    +
    +
    +

    Encodes an HTTP request with an XML body into a URLRequest.

    +
    +

    Throws

    + An error if the encoding process fails. + +
    + +

    Example usage:

    +
    let encoder = RequestEncoder(baseURL: URL(string: "https://api.example.com")!)
    +let urlRequest = try encoder.encodeXML(request: myXmlRequest)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encodeXML<Request>(request: Request) throws -> URLRequest where Request : XMLBodyProvider, Request : XMLFormatProvider, Request : Encodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The request to encode.

    +
    +
    +
    +
    +

    Return Value

    +

    The encoded URLRequest.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/ResponseDecoder.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/ResponseDecoder.html new file mode 100644 index 0000000..950fbde --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Classes/ResponseDecoder.html @@ -0,0 +1,451 @@ + + + + ResponseDecoder Class Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseDecoder

+
+
+ +
public class ResponseDecoder
+
extension ResponseDecoder: TopLevelDecoder
+ +
+
+

A class responsible for decoding HTTP responses into specified types.

+ +

The ResponseDecoder class provides functionality to decode HTTP responses into specified types. +It uses the ResponseDecoding decoder to perform the decoding process.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decode(_:from:) + +
    +
    +
    +
    +
    +
    +

    Decodes an HTTP response into the specified type.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +

    Example usage:

    +
    let decoder = ResponseDecoder()
    +let decodedValue = try decoder.decode(MyType.self, from: (data: responseData, response: httpResponse))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func decode<T>(_ type: T.Type, from: (data: Data, response: HTTPURLResponse)) throws -> T where T : Decodable
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + type + + +
    +

    The type to decode the response into.

    +
    +
    + + from + + +
    +

    A tuple containing the response data and the HTTP URL response.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded value of the specified type.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums.html new file mode 100644 index 0000000..2d25a44 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums.html @@ -0,0 +1,396 @@ + + + + Enumerations Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/APIDataFormat.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/APIDataFormat.html new file mode 100644 index 0000000..440fe15 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/APIDataFormat.html @@ -0,0 +1,507 @@ + + + + APIDataFormat Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

APIDataFormat

+
+
+ +
public enum APIDataFormat
+ +
+
+

Represents the format of API data.

+ +

The APIDataFormat enum defines the format of data used in API requests and responses. +It provides different cases for various data formats, such as plain text, JSON, form URL encoded, and XML.

+ +

Example usage:

+
let format: APIDataFormat = .json
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + plain + +
    +
    +
    +
    +
    +
    +

    Plain text format.

    + +

    This case represents the plain text format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case plain
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + json + +
    +
    +
    +
    +
    +
    +

    JSON format.

    + +

    This case represents the JSON format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case json
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formURLEncoded + +
    +
    +
    +
    +
    +
    +

    Form URL encoded format.

    + +

    This case represents the form URL encoded format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case formURLEncoded
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + xml + +
    +
    +
    +
    +
    +
    +

    XML format.

    + +

    This case represents the XML format for API data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case xml
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/APIError.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/APIError.html new file mode 100644 index 0000000..7671cfe --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/APIError.html @@ -0,0 +1,724 @@ + + + + APIError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

APIError

+
+
+ +
public enum APIError : LocalizedError
+ +
+
+

Represents various errors that can occur when interacting with the API.

+ +

The APIError enum provides a comprehensive list of errors that can occur when interacting with the API. +Each case represents a specific type of error, and the associated values provide additional context or information +about the error.

+
+

See also

+ LocalizedError for more information on localized error descriptions. + +
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates a response error with a specific status code and data.

    + +

    This error occurs when the API returns a response with a non-success status code. +The associated values provide the status code and the response data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case responseError(statusCode: Int, data: Data)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    + + data + + +
    +

    The response data.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + invalidResponse + +
    +
    +
    +
    +
    +
    +

    Indicates an invalid response.

    + +

    This error occurs when the API returns an invalid response, such as a response with missing or malformed data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case invalidResponse
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + urlError(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates a URL error.

    + +

    This error occurs when there is an issue with the URL, such as a network connectivity problem or an invalid URL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case urlError(URLError)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    The underlying URLError that caused the failure.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + decodingError(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates a decoding error.

    + +

    This error occurs when there is an issue decoding the response data into the expected type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case decodingError(DecodingError)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    The underlying DecodingError that caused the failure.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Indicates a failure to encode plain text with a specific encoding.

    + +

    This error occurs when there is an issue encoding plain text data using the specified encoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failedToEncodePlainText(encoding: String.Encoding)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + encoding + + +
    +

    The String.Encoding used for encoding.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + unknown(error:) + +
    +
    +
    +
    +
    +
    +

    Indicates an unknown error.

    + +

    This error occurs when an unknown error is encountered.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknown(error: Error)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + error + + +
    +

    The underlying Error that caused the failure.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + errorDescription + +
    +
    +
    +
    +
    +
    +

    A localized message describing what error occurred.

    + +

    This property provides a human-readable description of the error, which can be used for displaying error messages +to the user.

    + +

    Example usage:

    +
    let error: APIError = .invalidResponse
    +print(error.errorDescription ?? "Unknown error")
    +// Output: "Received invalid URL response"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var errorDescription: String? { get }
    + +
    +
    +
    +

    Return Value

    +

    A localized string describing the error.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/HTTPMethod.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/HTTPMethod.html new file mode 100644 index 0000000..3319823 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/HTTPMethod.html @@ -0,0 +1,644 @@ + + + + HTTPMethod Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

HTTPMethod

+
+
+ +
public enum HTTPMethod : String, Encodable
+ +
+
+

Common HTTP Methods

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + get + +
    +
    +
    +
    +
    +
    +

    The GET method requests a representation of the specified resource.

    + +

    Requests using GET should only retrieve data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case get = "GET"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + head + +
    +
    +
    +
    +
    +
    +

    The HEAD method asks for a response identical to that of a GETrequest, but without the response body.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case head = "HEAD"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + post + +
    +
    +
    +
    +
    +
    +

    The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case post = "POST"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + put + +
    +
    +
    +
    +
    +
    +

    The PUT method replaces all current representations of the target resource with the request payload.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case put = "PUT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete + +
    +
    +
    +
    +
    +
    +

    The DELETE method deletes the specified resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case delete = "DELETE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + connect + +
    +
    +
    +
    +
    +
    +

    The CONNECT method establishes a tunnel to the server identified by the target resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case connect = "CONNECT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + options + +
    +
    +
    +
    +
    +
    +

    The OPTIONS method is used to describe the communication options for the target resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case options = "OPTIONS"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + trace + +
    +
    +
    +
    +
    +
    +

    The TRACE method performs a message loop-back test along the path to the target resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case trace = "TRACE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + patch + +
    +
    +
    +
    +
    +
    +

    The PATCH method is used to apply partial modifications to a resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case patch = "PATCH"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/HTTPStatusCode.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/HTTPStatusCode.html new file mode 100644 index 0000000..d49bab1 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Enums/HTTPStatusCode.html @@ -0,0 +1,2557 @@ + + + + HTTPStatusCode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

HTTPStatusCode

+
+
+ +
public enum HTTPStatusCode : UInt16
+
extension HTTPStatusCode: Comparable, Equatable
+ +
+
+

Common HTTP Status Codes

+ +

Reference: Wikipedia

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + continue + +
    +
    +
    +
    +
    +
    +

    The server has received the request headers and the client should proceed to send the request body (in the +case of a request for which a body needs to be sent; for example, a POST request).

    + +

    Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient. +To have a server check the request’s headers, a client must send Expect: 100-continue as a header in its initial request +and receive a 100 Continue status code in response before sending the body. +If the client receives an error code such as 403 (Forbidden) or 405 (Method Not Allowed) then it should not send the request’s body. +The response 417 Expectation Failed indicates that the request should be repeated without the Expect header as it indicates +that the server does not support expectations (this is the case, for example, of HTTP/1.0 servers).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `continue` = 100
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + switchingProtocols + +
    +
    +
    +
    +
    +
    +

    The requester has asked the server to switch protocols and the server has agreed to do so.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case switchingProtocols = 101
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + processing + +
    +
    +
    +
    +
    +
    +

    A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.

    + +

    This code indicates that the server has received and is processing the request, but no response is available yet. +This prevents the client from timing out and assuming the request was lost.

    + +

    (WebDAV; RFC 2518)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case processing = 102
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + earlyHints + +
    +
    +
    +
    +
    +
    +

    Used to return some response headers before final HTTP message.

    + +

    (RFC 8297)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case earlyHints = 103
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ok + +
    +
    +
    +
    +
    +
    +

    Standard response for successful HTTP requests. +The actual response will depend on the request method used. +In a GET request, the response will contain an entity corresponding to the requested resource. +In a POST request, the response will contain an entity describing or containing the result of the action.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ok = 200
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + created + +
    +
    +
    +
    +
    +
    +

    The request has been fulfilled, resulting in the creation of a new resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case created = 201
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accepted + +
    +
    +
    +
    +
    +
    +

    The request has been accepted for processing, but the processing has not been completed. +The request might or might not be eventually acted upon, and may be disallowed when processing occurs.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case accepted = 202
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The server is a transforming proxy (e.g.a Web accelerator) that received a 200 OK from its origin, but is returning a +modified version of the origin’s response.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nonAuthoritativeInformation = 203
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + noContent + +
    +
    +
    +
    +
    +
    +

    The server successfully processed the request, and is not returning any content.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case noContent = 204
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + resetContent + +
    +
    +
    +
    +
    +
    +

    The server successfully processed the request, asks that the requester reset its document view, and is not returning any content.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case resetContent = 205
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + partialContent + +
    +
    +
    +
    +
    +
    +

    The server is delivering only part of the resource (byte serving) due to a range header sent by the client. +The range header is used by HTTP clients to enable resuming of interrupted downloads, or split a download into multiple simultaneous streams.

    + +

    (RFC 7233)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case partialContent = 206
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + multiStatus + +
    +
    +
    +
    +
    +
    +

    The message body that follows is by default an XML message and can contain a number of separate response codes, +depending on how many sub-requests were made.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiStatus = 207
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + alreadyReported + +
    +
    +
    +
    +
    +
    +

    The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again.

    + +

    (WebDAV; RFC 5842)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case alreadyReported = 208
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + IMused + +
    +
    +
    +
    +
    +
    +

    The server has fulfilled a request for the resource, and the response is a representation of the result of one or more +instance-manipulations applied to the current instance.

    + +

    (RFC 3229)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case IMused = 226
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + multipleChoices + +
    +
    +
    +
    +
    +
    +

    Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).

    + +

    For example, this code could be used to present multiple video format options, to list files with different filename extensions, +or to suggest word-sense disambiguation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multipleChoices = 300
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + movedPermanently + +
    +
    +
    +
    +
    +
    +

    This and all future requests should be directed to the given URI.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case movedPermanently = 301
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + found + +
    +
    +
    +
    +
    +
    +

    Tells the client to look at (browse to) another URL (Previously “Moved temporarily”)

    + +

    302 has been superseded by 303 and 307. +This is an example of industry practice contradicting the standard.

    + +

    The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase +was “Moved Temporarily”), but popular browsers implemented 302 with the functionality of a 303 See Other. +Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.

    + +

    However, some Web applications and frameworks use the 302 status code as if it were the 303.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case found = 302
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + seeOther + +
    +
    +
    +
    +
    +
    +

    The response to the request can be found under another URI using the GET method.

    + +

    When received in response to a POST (or PUT/DELETE), the client should presume that the server has received the data +and should issue a new GET request to the given URI.

    + +

    (since HTTP/1.1)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case seeOther = 303
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notModified + +
    +
    +
    +
    +
    +
    +

    Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.

    + +

    In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.

    + +

    (RFC 7232)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notModified = 304
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + useProxy + +
    +
    +
    +
    +
    +
    +

    The requested resource is available only through a proxy, the address for which is provided in the response.

    + +

    For security reasons, many HTTP clients (such as Mozilla Firefox and Internet Explorer) do not obey this status code.

    + +

    (since HTTP/1.1)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case useProxy = 305
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + switchProxy + +
    +
    +
    +
    +
    +
    +

    No longer used. +Originally meant “Subsequent requests should use the specified proxy.”

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case switchProxy = 306
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + temporaryRedirect + +
    +
    +
    +
    +
    +
    +

    In this case, the request should be repeated with another URI; however, future requests should still use the original URI.

    + +

    In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request. +For example, a POST request should be repeated using another POST request.

    + +

    (since HTTP/1.1)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case temporaryRedirect = 307
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permanentRedirect + +
    +
    +
    +
    +
    +
    +

    The request and all future requests should be repeated using another URI.

    + +

    307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change. +So, for example, submitting a form to a permanently redirected resource may continue smoothly.

    + +

    (RFC 7538)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case permanentRedirect = 308
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + badRequest + +
    +
    +
    +
    +
    +
    +

    The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, +invalid request message framing, or deceptive request routing).

    + +

    (RFC 7235)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case badRequest = 400
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unauthorized + +
    +
    +
    +
    +
    +
    +

    Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.

    + +

    The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. +See Basic access authentication and Digest access authentication.

    + +

    401 semantically means “unauthorised”, the user does not have valid authentication credentials for the target resource.

    + +

    Note: Some sites incorrectly issue HTTP 401 when an IP address is banned from the website (usually the website domain) +and that specific address is refused permission to access a website. +[citation needed]

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unauthorized = 401
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + paymentRequired + +
    +
    +
    +
    +
    +
    +

    Reserved for future use. +The original intention was that this code might be used as part of some form of digital cash or micropayment +scheme, as proposed, for example, by GNU Taler, but that has not yet happened, and this code is not widely used.

    + +
      +
    • Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
    • +
    • Sipgate uses this code if an account does not have sufficient funds to start a call.
    • +
    • Shopify uses this code when the store has not paid their fees and is temporarily disabled.
    • +
    • Stripe uses this code for failed payments where parameters were correct, for example blocked fraudulent payments.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case paymentRequired = 402
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forbidden + +
    +
    +
    +
    +
    +
    +

    The request contained valid data and was understood by the server, but the server is refusing action.

    + +

    This may be due to the user not having the necessary permissions for a resource or needing an account of some sort, +or attempting a prohibited action (e.g. creating a duplicate record where only one is allowed). +This code is also typically used if the request provided authentication by answering the +WWW-Authenticate header field challenge, but the server did not accept that authentication. +The request should not be repeated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case forbidden = 403
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notFound + +
    +
    +
    +
    +
    +
    +

    The requested resource could not be found but may be available in the future. +Subsequent requests by the client are permissible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notFound = 404
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + methodNotAllowed + +
    +
    +
    +
    +
    +
    +

    A request method is not supported for the requested resource

    + +

    For example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case methodNotAllowed = 405
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notAcceptable + +
    +
    +
    +
    +
    +
    +

    The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.

    + +

    See Content negotiation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notAcceptable = 406
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The client must first authenticate itself with the proxy.

    + +

    (RFC 7235)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case proxyAuthenticationRequired = 407
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + requestTimeout + +
    +
    +
    +
    +
    +
    +

    The server timed out waiting for the request.

    + +

    According to HTTP specifications:

    +
    The client did not produce a request within the time that the server was prepared to wait.
    +The client MAY repeat the request without modifications at any later time.
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case requestTimeout = 408
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + conflict + +
    +
    +
    +
    +
    +
    +

    Indicates that the request could not be processed because of conflict in the current state of the resource, +such as an edit conflict between multiple simultaneous updates.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case conflict = 409
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + gone + +
    +
    +
    +
    +
    +
    +

    Indicates that the resource requested is no longer available and will not be available again.

    + +

    This should be used when a resource has been intentionally removed and the resource should be purged. +Upon receiving a 410 status code, the client should not request the resource in the future. +Clients such as search engines should remove the resource from their indices. +Most use cases do not require clients and search engines to purge the resource, and a “404 Not Found” may be used instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case gone = 410
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lengthRequired + +
    +
    +
    +
    +
    +
    +

    The request did not specify the length of its content, which is required by the requested resource.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lengthRequired = 411
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + preconditionFailed + +
    +
    +
    +
    +
    +
    +

    The server does not meet one of the preconditions that the requester put on the request header fields.

    + +

    (RFC 7232)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case preconditionFailed = 412
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + payloadTooLarge + +
    +
    +
    +
    +
    +
    +

    The request is larger than the server is willing or able to process. +Previously called “Request Entity Too Large”.

    + +

    (RFC 7231)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case payloadTooLarge = 413
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + uriTooLong + +
    +
    +
    +
    +
    +
    +

    The URI provided was too long for the server to process.

    + +

    Often the result of too much data being encoded as a query-string of a GET request, in which case it should be converted to a POST request. +Called “Request-URI Too Long” previously.

    + +

    (RFC 7231)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case uriTooLong = 414
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsupportedMediaType + +
    +
    +
    +
    +
    +
    +

    The request entity has a media type which the server or resource does not support. +For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.

    + +

    (RFC 7231)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unsupportedMediaType = 415
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rangeNotSatisfiable + +
    +
    +
    +
    +
    +
    +

    The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.

    + +

    For example, if the client asked for a part of the file that lies beyond the end of the file. +Called “Requested Range Not Satisfiable” previously.

    + +

    (RFC 7233)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rangeNotSatisfiable = 416
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + expectationFailed + +
    +
    +
    +
    +
    +
    +

    The server cannot meet the requirements of the Expect request-header field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case expectationFailed = 417
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + imATeapot + +
    +
    +
    +
    +
    +
    +

    This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, +and is not expected to be implemented by actual HTTP servers.

    + +

    The RFC specifies this code should be returned by teapots requested to brew coffee. +This HTTP status is used as an Easter egg in some websites, such as Google.com’s I’m a teapot easter egg.

    + +

    (RFC 2324, RFC 7168)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case imATeapot = 418
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + misdirectedRequest + +
    +
    +
    +
    +
    +
    +

    The request was directed at a server that is not able to produce a response (for example because of connection reuse).

    + +

    (RFC 7540)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case misdirectedRequest = 421
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unprocessableEntity + +
    +
    +
    +
    +
    +
    +

    The request was well-formed but was unable to be followed due to semantic errors.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unprocessableEntity = 422
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + locked + +
    +
    +
    +
    +
    +
    +

    The resource that is being accessed is locked.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case locked = 423
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + failedDependency + +
    +
    +
    +
    +
    +
    +

    The request failed because it depended on another request and that request failed (e.g., a PROPPATCH).

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failedDependency = 424
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tooEarly + +
    +
    +
    +
    +
    +
    +

    Indicates that the server is unwilling to risk processing a request that might be replayed.

    + +

    (RFC 8470)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tooEarly = 425
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + upgradeRequired + +
    +
    +
    +
    +
    +
    +

    The client should switch to a different protocol such as TLS/1.3, given in the Upgrade header field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case upgradeRequired = 426
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + preconditionRequired + +
    +
    +
    +
    +
    +
    +

    The origin server requires the request to be conditional.

    + +

    Intended to prevent the ‘lost update’ problem, where a client GETs a resource’s state, modifies it, and PUTs it back to the server, +when meanwhile a third party has modified the state on the server, leading to a conflict.

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case preconditionRequired = 428
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tooManyRequests + +
    +
    +
    +
    +
    +
    +

    The user has sent too many requests in a given amount of time.

    + +

    Intended for use with rate-limiting schemes.

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tooManyRequests = 429
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The server is unwilling to process the request because either an individual header field, or all the header fields collectively, +are too large.

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case requestHeaderFieldsTooLarge = 431
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.

    + +

    The code 451 was chosen as a reference to the novel Fahrenheit 451 (see the Acknowledgements in the RFC).

    + +

    Notes: (RFC 7725)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unavailableForLegalReasons = 451
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + internalServerError + +
    +
    +
    +
    +
    +
    +

    A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalServerError = 500
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notImplemented + +
    +
    +
    +
    +
    +
    +

    The server either does not recognize the request method, or it lacks the ability to fulfil the request.

    + +

    Usually this implies future availability (e.g., a new feature of a web-service API).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notImplemented = 501
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + badGateway + +
    +
    +
    +
    +
    +
    +

    The server was acting as a gateway or proxy and received an invalid response from the upstream server.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case badGateway = 502
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + serviceUnavailable + +
    +
    +
    +
    +
    +
    +

    The server cannot handle the request (because it is overloaded or down for maintenance).

    + +

    Generally, this is a temporary state.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case serviceUnavailable = 503
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + gatewayTimeout + +
    +
    +
    +
    +
    +
    +

    The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case gatewayTimeout = 504
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The server does not support the HTTP protocol version used in the request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case httpVersionNotSupported = 505
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + variantAlsoNegotiates + +
    +
    +
    +
    +
    +
    +

    Transparent content negotiation for the request results in a circular reference.

    + +

    (RFC 2295)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case variantAlsoNegotiates = 506
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + insufficientStorage + +
    +
    +
    +
    +
    +
    +

    The server is unable to store the representation needed to complete the request.

    + +

    (WebDAV; RFC 4918)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insufficientStorage = 507
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + loopDetected + +
    +
    +
    +
    +
    +
    +

    The server detected an infinite loop while processing the request (sent instead of 208 Already Reported).

    + +

    (WebDAV; RFC 5842)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case loopDetected = 508
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notExtended + +
    +
    +
    +
    +
    +
    +

    Further extensions to the request are required for the server to fulfil it.

    + +

    (RFC 2774)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notExtended = 510
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The client needs to authenticate to gain network

    + +

    (RFC 6585)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case networkAuthenticationRequired = 511
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func > (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func >= (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: HTTPStatusCode, rhs: HTTPStatusCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 0000000..7c6831f --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,547 @@ + + + + Extensions Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

Array + QueryItemValue +

+
+
+
    +
  • +
    + + + + Array + +
    +
  • +
+
+
+
+ + +
+ +

Set + QueryItemValue +

+
+
+
    +
  • +
    + + + + Set + +
    +
  • +
  • +
    + + + + String + +
    +
  • +
+
+
+
+ + +
+ +

Optional + OptionalType +

+
+
+ +
+
+
+ + +
+ +

Double + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Array.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Array.html new file mode 100644 index 0000000..2d69f58 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Array.html @@ -0,0 +1,464 @@ + + + + Array Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Array

+
+
+ +
extension Array: QueryItemValue where Element: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Element: QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Bool.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Bool.html new file mode 100644 index 0000000..ad02183 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Bool.html @@ -0,0 +1,498 @@ + + + + Bool Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Bool

+
+
+ +
extension Bool: RequestHeaderValue
+
extension Bool: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

Bool + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Double.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Double.html new file mode 100644 index 0000000..b8f20f4 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Double.html @@ -0,0 +1,455 @@ + + + + Double Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Double

+
+
+ +
extension Double: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int.html new file mode 100644 index 0000000..be4e48a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int.html @@ -0,0 +1,528 @@ + + + + Int Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Int

+
+
+ +
extension Int: RequestHeaderValue
+
extension Int: RequestPathParameterValue
+
extension Int: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + serializedHeaderValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var serializedHeaderValue: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + serialized + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var serialized: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Int + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int16.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int16.html new file mode 100644 index 0000000..fcadfd4 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int16.html @@ -0,0 +1,397 @@ + + + + Int16 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int32.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int32.html new file mode 100644 index 0000000..9ac7b2f --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int32.html @@ -0,0 +1,397 @@ + + + + Int32 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int64.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int64.html new file mode 100644 index 0000000..8f3ce68 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Int64.html @@ -0,0 +1,397 @@ + + + + Int64 Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Optional.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Optional.html new file mode 100644 index 0000000..8d7bd2c --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Optional.html @@ -0,0 +1,551 @@ + + + + Optional Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Optional

+
+
+ +
extension Optional: OptionalType
+
extension Optional: RequestHeaderValue where Wrapped: RequestHeaderValue
+
extension Optional: RequestPathParameterValue where Wrapped: RequestPathParameterValue
+
extension Optional: QueryItemValue where Wrapped: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Wrapped: RequestHeaderValue +

+
+
+ +
+
+
+ + +
+ +

Available where Wrapped: RequestPathParameterValue +

+
+
+
    +
  • +
    + + + + serialized + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var serialized: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Wrapped: QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/PlainDecodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/PlainDecodable.html new file mode 100644 index 0000000..3b4bd51 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/PlainDecodable.html @@ -0,0 +1,400 @@ + + + + PlainDecodable Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Range.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Range.html new file mode 100644 index 0000000..32a862f --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Range.html @@ -0,0 +1,442 @@ + + + + Range Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Range

+
+
+ +
extension Range where Bound == HTTPStatusCode
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound == HTTPStatusCode +

+
+
+
    +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Checks if a value is within a range of HTTP status codes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= (range: Range<HTTPStatusCode>, value: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + range + + +
    +

    The range of HTTP status codes to check against.

    +
    +
    + + value + + +
    +

    The value to check against the range.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the value is within the range, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody.html new file mode 100644 index 0000000..92bfaf1 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody.html @@ -0,0 +1,407 @@ + + + + ResponseBody Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/OptionalContent.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/OptionalContent.html new file mode 100644 index 0000000..ca97d91 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/OptionalContent.html @@ -0,0 +1,377 @@ + + + + OptionalContent Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OptionalContent

+
+
+ +
public typealias OptionalContent = ResponseBodyWrapper<Body, OptionalContentStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with an optional content strategy.

+ +

The OptionalContent type alias provides a convenient way to use ResponseBodyWrapper with the OptionalContentStrategy. +It represents the response body of a request where the content is optional.

+ +

Example usage:

+
@ResponseBody<Body>.OptionalContent var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status200.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status200.html new file mode 100644 index 0000000..94e0843 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status200.html @@ -0,0 +1,377 @@ + + + + Status200 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status200

+
+
+ +
public typealias Status200 = ResponseBodyWrapper<Body, ValidateStatus200BodyStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 200.

+ +

The Status200 type alias provides a convenient way to use ResponseBodyWrapper with the ValidateStatus200BodyStrategy. +It represents the response body of a request where the status code is expected to be 200.

+ +

Example usage:

+
@ResponseBody<Body>.Status200 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status201.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status201.html new file mode 100644 index 0000000..c8e7e89 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status201.html @@ -0,0 +1,377 @@ + + + + Status201 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status201

+
+
+ +
public typealias Status201 = ResponseBodyWrapper<Body, ValidateStatus201BodyStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 201.

+ +

The Status201 type alias provides a convenient way to use ResponseBodyWrapper with the ValidateStatus201BodyStrategy. +It represents the response body of a request where the status code is expected to be 201.

+ +

Example usage:

+
@ResponseBody<Body>.Status201 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status303.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status303.html new file mode 100644 index 0000000..8de1201 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseBody/Status303.html @@ -0,0 +1,377 @@ + + + + Status303 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status303

+
+
+ +
public typealias Status303 = ResponseBodyWrapper<Body, ValidateStatus303BodyStrategy>
+ +
+
+

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 303.

+ +

The Status303 type alias provides a convenient way to use ResponseBodyWrapper with the ValidateStatus303BodyStrategy. +It represents the response body of a request where the status code is expected to be 303.

+ +

Example usage:

+
@ResponseBody<Body>.Status303 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody.html new file mode 100644 index 0000000..4661d0e --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody.html @@ -0,0 +1,425 @@ + + + + ResponseErrorBody Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status400.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status400.html new file mode 100644 index 0000000..39020c7 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status400.html @@ -0,0 +1,377 @@ + + + + Status400 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status400

+
+
+ +
public typealias Status400 = ResponseErrorBodyWrapper<Body, ValidateStatus400ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 400.

+ +

The Status400 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus400ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 400.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status400 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status401.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status401.html new file mode 100644 index 0000000..40746e8 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status401.html @@ -0,0 +1,377 @@ + + + + Status401 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status401

+
+
+ +
public typealias Status401 = ResponseErrorBodyWrapper<Body, ValidateStatus401ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 401.

+ +

The Status401 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus401ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 401.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status401 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status403.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status403.html new file mode 100644 index 0000000..e8f237c --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status403.html @@ -0,0 +1,377 @@ + + + + Status403 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status403

+
+
+ +
public typealias Status403 = ResponseErrorBodyWrapper<Body, ValidateStatus403ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 403.

+ +

The Status403 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus403ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 403.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status403 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status404.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status404.html new file mode 100644 index 0000000..c2fc5fe --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status404.html @@ -0,0 +1,377 @@ + + + + Status404 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status404

+
+
+ +
public typealias Status404 = ResponseErrorBodyWrapper<Body, ValidateStatus404ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 404.

+ +

The Status404 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus404ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 404.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status404 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status410.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status410.html new file mode 100644 index 0000000..26210d2 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status410.html @@ -0,0 +1,377 @@ + + + + Status410 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status410

+
+
+ +
public typealias Status410 = ResponseErrorBodyWrapper<Body, ValidateStatus410ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 410.

+ +

The Status410 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus410ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 410.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status410 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status422.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status422.html new file mode 100644 index 0000000..ef64acf --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/ResponseErrorBody/Status422.html @@ -0,0 +1,377 @@ + + + + Status422 Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Status422

+
+
+ +
public typealias Status422 = ResponseErrorBodyWrapper<Body, ValidateStatus422ErrorBodyStrategy>
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 422.

+ +

The Status422 type alias provides a convenient way to use ResponseErrorBodyWrapper with the ValidateStatus422ErrorBodyStrategy. +It represents the error response body of a request where the status code is expected to be 422.

+ +

Example usage:

+
@ResponseErrorBody<Body>.Status422 var body: Body
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Set.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Set.html new file mode 100644 index 0000000..b991257 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/Set.html @@ -0,0 +1,464 @@ + + + + Set Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Set

+
+
+ +
extension Set: QueryItemValue where Element: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Element: QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/String.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/String.html new file mode 100644 index 0000000..878f8d3 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/String.html @@ -0,0 +1,537 @@ + + + + String Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

String

+
+
+ +
extension String: RequestHeaderValue
+
extension String: RequestPathParameterValue
+
extension String: QueryItemValue
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

String + QueryItemValue +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/String/Encoding.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/String/Encoding.html new file mode 100644 index 0000000..ad98fa7 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/String/Encoding.html @@ -0,0 +1,367 @@ + + + + Encoding Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Encoding

+
+
+ +
extension String.Encoding: @retroactive Encodable
+ +
+
+

Extension to make String.Encoding conform to Encodable

+ +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/URLSession.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/URLSession.html new file mode 100644 index 0000000..532d78f --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Extensions/URLSession.html @@ -0,0 +1,458 @@ + + + + URLSession Extension Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

URLSession

+
+
+ +
extension URLSession: URLSessionProvider
+ +
+
+ +
+
+ +
+
+
+
    +
  • +
    + + + + send(urlRequest:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func send(urlRequest request: URLRequest) -> AnyPublisher<URLSession.DataTaskPublisher.Output, URLSession.DataTaskPublisher.Failure>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func send(urlRequest request: URLRequest, completion: @escaping (Data?, URLResponse?, Error?) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + send(urlRequest:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func send(urlRequest request: URLRequest) async throws -> (Data, URLResponse)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols.html new file mode 100644 index 0000000..006f1b8 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols.html @@ -0,0 +1,526 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ + +
+ +

OptionalType +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/FormURLEncodedBodyProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/FormURLEncodedBodyProvider.html new file mode 100644 index 0000000..19631f5 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/FormURLEncodedBodyProvider.html @@ -0,0 +1,451 @@ + + + + FormURLEncodedBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedBodyProvider

+
+
+ +
public protocol FormURLEncodedBodyProvider
+ +
+
+

A provider for form URL encoded body data.

+ +

The FormURLEncodedBodyProvider protocol defines a type that provides a body for form URL encoded data. +It requires conforming types to specify an associated type Body that conforms to the Encodable protocol +and to provide a body property of that type.

+ +

Example usage:

+
struct MyFormURLEncodedRequest: FormURLEncodedBodyProvider {
+    struct Body: Encodable {
+        let name: String
+        let age: Int
+    }
+
+    var body: Body
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Body + +
    +
    +
    +
    +
    +
    +

    The associated type representing the body of the form URL encoded data.

    + +

    This associated type must conform to the Encodable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Body : Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body of the form URL encoded data.

    + +

    This property holds the body of the form URL encoded data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: Body { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/FormURLEncodedFormatProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/FormURLEncodedFormatProvider.html new file mode 100644 index 0000000..0f44804 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/FormURLEncodedFormatProvider.html @@ -0,0 +1,409 @@ + + + + FormURLEncodedFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedFormatProvider

+
+
+ +
public protocol FormURLEncodedFormatProvider
+ +
+
+

A type that has a default format of form-url-encoding

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .formURLEncoded

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/JSONBodyProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/JSONBodyProvider.html new file mode 100644 index 0000000..184094d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/JSONBodyProvider.html @@ -0,0 +1,472 @@ + + + + JSONBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONBodyProvider

+
+
+ +
public protocol JSONBodyProvider
+ +
+
+

A protocol that provides the body and key encoding strategy for JSON encoding.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Body + +
    +
    +
    +
    +
    +
    +

    The type of the body to be encoded.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Body : Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + keyEncodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The key encoding strategy to use for JSON encoding.

    + +
    +

    Default Implementation

    +
    +

    The default key encoding strategy for JSON encoding.

    + +

    By default, this is set to .convertToSnakeCase.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var keyEncodingStrategy: JSONEncoder.KeyEncodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body to be encoded.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: Body { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/JSONFormatProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/JSONFormatProvider.html new file mode 100644 index 0000000..9ad06b7 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/JSONFormatProvider.html @@ -0,0 +1,409 @@ + + + + JSONFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONFormatProvider

+
+
+ +
public protocol JSONFormatProvider
+ +
+
+

A type that has a default format of form-url-encoding

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .json

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/OptionalType.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/OptionalType.html new file mode 100644 index 0000000..93cbc7b --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/OptionalType.html @@ -0,0 +1,441 @@ + + + + OptionalType Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OptionalType

+
+
+ +
public protocol OptionalType
+ +
+
+

A type that can be used as a value for a query item.

+ +

The OptionalType protocol defines a type that can be used as a value for a query item. +It requires conforming types to provide a none property that returns a nil value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Wrapped + +
    +
    +
    +
    +
    +
    +

    The type of the wrapped value.

    + +

    This property represents the type of the wrapped value. +It is used to represent the type of the wrapped value for the optional type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Wrapped
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + none + +
    +
    +
    +
    +
    +
    +

    The nil value of the optional type.

    + +

    This property represents the nil value of the optional type. +It is used to represent a nil value for the optional type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var none: Self { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/PlainBodyProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/PlainBodyProvider.html new file mode 100644 index 0000000..182b047 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/PlainBodyProvider.html @@ -0,0 +1,467 @@ + + + + PlainBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainBodyProvider

+
+
+ +
public protocol PlainBodyProvider
+ +
+
+

A provider for plain text body data.

+ +

The PlainBodyProvider protocol defines a type that provides a body for plain text data. +It requires conforming types to specify an associated type Body that conforms to the Encodable protocol +and to provide a body property of that type.

+ +

Example usage:

+
struct MyPlainRequest: PlainBodyProvider {
+    struct Body: Encodable {
+        let content: String
+    }
+
+    var body: Body
+    var encoding: String.Encoding
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body of the plain text data.

    + +

    This property holds the body of the plain text data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + encoding + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The encoding used for the plain text data.

    + +

    This property holds the encoding used for the plain text data.

    + +
    +

    Default Implementation

    +
    +

    The encoding used for the plain text data.

    + +

    This property holds the encoding used for the plain text data. +Default implementation is .utf8

    +
    +

    Note

    + This property is required by the PlainBodyProvider protocol. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var encoding: String.Encoding { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/PlainFormatProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/PlainFormatProvider.html new file mode 100644 index 0000000..eebe5cb --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/PlainFormatProvider.html @@ -0,0 +1,410 @@ + + + + PlainFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainFormatProvider

+
+
+ +
public protocol PlainFormatProvider
+ +
+
+

A type that has a default format of plain text

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .plain

    + +
    +

    Default Implementation

    +
    +

    Default implementation is .plain

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/QueryItemValue.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/QueryItemValue.html new file mode 100644 index 0000000..3a35cb6 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/QueryItemValue.html @@ -0,0 +1,492 @@ + + + + QueryItemValue Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryItemValue

+
+
+ +
public protocol QueryItemValue
+ +
+
+

A type that can be used as a value for a query item.

+ +

The QueryItemValue protocol defines a type that can be used as a value for a query item. +It requires conforming types to provide a serializedQueryItem property that returns a string representation of the query item value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + serializedQueryItem + +
    +
    +
    +
    +
    +
    +

    The serialized value of the query item.

    + +

    This property represents the serialized value of the query item. +It is used to convert the query item value into a string format suitable for URL query parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var serializedQueryItem: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isCollection + +
    +
    +
    +
    +
    +
    +

    Indicates whether the query item is a collection.

    + +

    This property is used to determine if the query item is a collection.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var isCollection: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + iterateCollection(_:) + +
    +
    +
    +
    +
    +
    +

    Iterates over the elements of the collection.

    + +

    This method is used to iterate over the elements of the collection. +If the query item is not a collection, this method should not be called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func iterateCollection(_ iterator: (QueryItemValue) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + iterator + + +
    +

    A closure that is called for each element in the collection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/Request.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/Request.html new file mode 100644 index 0000000..0307fcf --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/Request.html @@ -0,0 +1,415 @@ + + + + Request Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Request

+
+
+ +
public protocol Request : Encodable
+ +
+
+

Protocol used to define a response type to a given request type.

+ +

The Request protocol is used to define a response type for a given request type. +It requires conforming types to be encodable and to specify an associated type Response +that conforms to the Decodable protocol.

+ +

Example usage:

+
struct MyRequest: Request {
+    typealias Response = MyResponse
+    // Implement the required properties and methods for the request
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Response + +
    +
    +
    +
    +
    +
    +

    The associated type representing the response type for the request.

    + +

    This associated type must conform to the Decodable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Response : Decodable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/RequestHeaderValue.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/RequestHeaderValue.html new file mode 100644 index 0000000..33484e6 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/RequestHeaderValue.html @@ -0,0 +1,408 @@ + + + + RequestHeaderValue Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestHeaderValue

+
+
+ +
public protocol RequestHeaderValue
+ +
+
+

A type that can be used as a value for an HTTP header.

+ +

The RequestHeaderValue protocol defines a type that can be used as a value for an HTTP header. +It requires conforming types to provide a serializedHeaderValue property that returns a string representation of the header value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + serializedHeaderValue + +
    +
    +
    +
    +
    +
    +

    The serialized value of the header.

    + +

    This property represents the serialized value of the header. +It is used to convert the header value into a string format suitable for HTTP headers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var serializedHeaderValue: String? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/RequestPathParameterValue.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/RequestPathParameterValue.html new file mode 100644 index 0000000..b3a85a1 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/RequestPathParameterValue.html @@ -0,0 +1,408 @@ + + + + RequestPathParameterValue Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestPathParameterValue

+
+
+ +
public protocol RequestPathParameterValue
+ +
+
+

A type that can be used as a value for a request path parameter.

+ +

The RequestPathParameterValue protocol defines a type that can be used as a value for a request path parameter. +It requires conforming types to provide a serialized property that returns a string representation of the path parameter value.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + serialized + +
    +
    +
    +
    +
    +
    +

    The serialized value of the path parameter.

    + +

    This property represents the serialized value of the path parameter. +It is used to convert the path parameter value into a string format suitable for URL paths.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var serialized: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseBodyDecodingStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseBodyDecodingStrategy.html new file mode 100644 index 0000000..502df5d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseBodyDecodingStrategy.html @@ -0,0 +1,492 @@ + + + + ResponseBodyDecodingStrategy Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseBodyDecodingStrategy

+
+
+ +
public protocol ResponseBodyDecodingStrategy
+ +
+
+

A protocol for defining strategies for handling response bodies.

+ +

Implement this protocol to create custom strategies for handling response bodies.

+ +

Example usage:

+
public class SpecificStatusCodeDecodingStrategy: ResponseBodyDecodingStrategy {
+
+    public static func allowsEmptyContent(for statusCode: Int) -> Bool {
+        return statusCode == 204 // your own statusCode value
+    }
+}
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether the decoding should fail when no content is returned or not.

    + +

    Use this property in a custom strategy implementation (example below) to check against the response’s +statusCode and determine whether or not it should fail when receiving empty data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func allowsEmptyContent(for statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is within the acceptable range.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is valid.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseErrorBodyDecodingStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseErrorBodyDecodingStrategy.html new file mode 100644 index 0000000..5087662 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseErrorBodyDecodingStrategy.html @@ -0,0 +1,418 @@ + + + + ResponseErrorBodyDecodingStrategy Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseErrorBodyDecodingStrategy

+
+
+ +
public protocol ResponseErrorBodyDecodingStrategy
+ +
+
+

A protocol for defining strategies for handling error response bodies.

+ +

Implement this protocol to create custom strategies for handling error response bodies.

+ +

Example usage:

+
public class SpecificStatusCodeDecodingStrategy: ResponseErrorBodyDecodingStrategy {
+
+    public static func isError(statusCode: Int) -> Bool {
+        return statusCode >= 400 // Handle every status code greater than 400 as an error
+    }
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Using the validate(statusCode:) method, you can define HTTP code(s) that should handled as an error.

    + +

    Use this property in a custom strategy implementation (example below) to check against the response’s +statusCode and determine wether or not it should fail when receiving empty data.

    + +

    Indicates wether the decoding should fail when no content is returned or not.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func isError(statusCode: Int) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseHeaderDecodingStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseHeaderDecodingStrategy.html new file mode 100644 index 0000000..71eef85 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/ResponseHeaderDecodingStrategy.html @@ -0,0 +1,473 @@ + + + + ResponseHeaderDecodingStrategy Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseHeaderDecodingStrategy

+
+
+ +
public protocol ResponseHeaderDecodingStrategy
+ +
+
+

A protocol for defining strategies for decoding response headers.

+ +

Implement this protocol to create custom strategies for decoding response headers.

+ +

Example usage:

+
public class SpecificHeaderDecodingStrategy: ResponseHeaderDecodingStrategy {
+    // Implement the required methods and properties here
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + RawValue + +
    +
    +
    +
    +
    +
    +

    The type of the raw value that will be decoded from the response header.

    + +

    This associated type represents the type of the raw value that will be decoded from the response header. +It must conform to the Codable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype RawValue : Decodable, Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + decode(decoder:) + +
    +
    +
    +
    +
    +
    +

    Decodes the raw value from the given decoder.

    + +

    This method is responsible for decoding the raw value from the given decoder.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func decode(decoder: Decoder) throws -> RawValue
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded raw value.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/URLSessionProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/URLSessionProvider.html new file mode 100644 index 0000000..bd42305 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/URLSessionProvider.html @@ -0,0 +1,586 @@ + + + + URLSessionProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

URLSessionProvider

+
+
+ +
public protocol URLSessionProvider
+ +
+
+

A protocol that provides methods for sending URL requests using different mechanisms.

+ +

The URLSessionProvider protocol defines methods for sending URL requests using Combine, callbacks, and async-await. +It allows for flexibility in handling URL requests and responses.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + send(urlRequest:) + +
    +
    +
    +
    +
    +
    +

    Sends a URL request using Combine and returns a publisher that emits the response.

    + +

    Example usage:

    +
    let provider: URLSessionProvider = URLSession.shared
    +let publisher = provider.send(urlRequest: myRequest)
    +publisher.sink(receiveCompletion: { completion in
    +    switch completion {
    +    case .finished:
    +        print("Request completed successfully")
    +    case .failure(let error):
    +        print("Request failed with error: \(error)")
    +    }
    +}, receiveValue: { output in
    +    print("Received response: \(output.response)")
    +    print("Received data: \(output.data)")
    +})
    +.store(in: &cancellables)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func send(urlRequest request: URLRequest) -> AnyPublisher<URLSession.DataTaskPublisher.Output, URLSession.DataTaskPublisher.Failure>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The URL request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A publisher that emits the response data and URL response, or an error.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Sends a URL request using a callback to handle the response.

    + +

    Example usage:

    +
    let provider: URLSessionProvider = URLSession.shared
    +provider.send(urlRequest: myRequest) { data, response, error in
    +    if let error = error {
    +        print("Request failed with error: \(error)")
    +    } else if let response = response, let data = data {
    +        print("Received response: \(response)")
    +        print("Received data: \(data)")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func send(urlRequest request: URLRequest, completion: @escaping (Data?, URLResponse?, Error?) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + request + + +
    +

    The URL request to send.

    +
    +
    + + completion + + +
    +

    The callback to handle the response.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + send(urlRequest:) + + + Asynchronous + +
    +
    +
    +
    +
    +
    +

    Sends a URL request using async-await and returns the response.

    +
    +

    Throws

    + An error if the request fails. + +
    + +

    Example usage:

    +
    let provider: URLSessionProvider = URLSession.shared
    +let (data, response) = try await provider.send(urlRequest: myRequest)
    +print("Received response: \(response)")
    +print("Received data: \(data)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func send(urlRequest request: URLRequest) async throws -> (Data, URLResponse)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    The URL request to send.

    +
    +
    +
    +
    +

    Return Value

    +

    A tuple containing the response data and URL response.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/XMLBodyProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/XMLBodyProvider.html new file mode 100644 index 0000000..5bc6470 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/XMLBodyProvider.html @@ -0,0 +1,451 @@ + + + + XMLBodyProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLBodyProvider

+
+
+ +
public protocol XMLBodyProvider
+ +
+
+

A provider for XML body data.

+ +

The XMLBodyProvider protocol defines a type that provides a body for XML data. +It requires conforming types to specify an associated type Body that conforms to the Encodable protocol +and to provide a body property of that type.

+ +

Example usage:

+
struct MyXMLRequest: XMLBodyProvider {
+    struct Body: Encodable {
+        let name: String
+        let age: Int
+    }
+
+    var body: Body
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Body + +
    +
    +
    +
    +
    +
    +

    The associated type representing the body of the XML data.

    + +

    This associated type must conform to the Encodable protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Body : Encodable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + body + +
    +
    +
    +
    +
    +
    +

    The body of the XML data.

    + +

    This property holds the body of the XML data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var body: Body { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/XMLFormatProvider.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/XMLFormatProvider.html new file mode 100644 index 0000000..8e7e506 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Protocols/XMLFormatProvider.html @@ -0,0 +1,409 @@ + + + + XMLFormatProvider Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLFormatProvider

+
+
+ +
public protocol XMLFormatProvider
+ +
+
+

A type that has a default format of xml

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + format + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Format of data, default extension is set to .xml

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var format: APIDataFormat { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs.html new file mode 100644 index 0000000..9dac406 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs.html @@ -0,0 +1,621 @@ + + + + Structures Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Structures

+

The following structures are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultBodyStrategy.html new file mode 100644 index 0000000..29c1d7a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultBodyStrategy.html @@ -0,0 +1,478 @@ + + + + DefaultBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultBodyStrategy

+
+
+ +
public struct DefaultBodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A default strategy for validating response bodies.

+ +

The DefaultBodyStrategy struct provides a default strategy for validating response bodies +by checking if the status code is between 200 (OK) and 300 (Multiple Choices). +It conforms to the ResponseBodyDecodingStrategy protocol and defines the +allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, DefaultBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Determines whether the decoding should fail when no content is returned.

    + +

    Example usage:

    +
    let allowsEmpty = DefaultBodyStrategy.allowsEmptyContent(for: 204)
    +print(allowsEmpty) // Output: false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for _: Int) -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is within the acceptable range.

    + +

    Example usage:

    +
    let isValid = DefaultBodyStrategy.validate(statusCode: 200)
    +print(isValid) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is valid.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultErrorBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultErrorBodyStrategy.html new file mode 100644 index 0000000..e96d0ab --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultErrorBodyStrategy.html @@ -0,0 +1,439 @@ + + + + DefaultErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultErrorBodyStrategy

+
+
+ +
public struct DefaultErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A default strategy for validating error response bodies.

+ +

The DefaultErrorBodyStrategy struct provides a default strategy for validating error response bodies +by checking if the status code is greater than or equal to 400 (Bad Request).

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, DefaultErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is greater than or equal to the HTTP status code for a bad request (400).

    + +

    Example usage:

    +
    let isError = DefaultErrorBodyStrategy.isError(statusCode: 404)
    +print(isError) // Prints: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code represents an error, false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultHeaderStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultHeaderStrategy.html new file mode 100644 index 0000000..a564518 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultHeaderStrategy.html @@ -0,0 +1,437 @@ + + + + DefaultHeaderStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultHeaderStrategy

+
+
+ +
public struct DefaultHeaderStrategy<RawValue> : ResponseHeaderDecodingStrategy where RawValue : Decodable, RawValue : Encodable
+ +
+
+

A default strategy for decoding response headers.

+ +

The DefaultHeaderStrategy struct provides a default strategy for decoding response headers +by checking if the header key is present in the response decoder.

+ +

Example usage:

+
@ResponseHeaderWrapper<Header, DefaultHeaderStrategy> var header: Header
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decode(decoder:) + +
    +
    +
    +
    +
    +
    +

    Decodes the response header value from the given decoder.

    +
    +

    Throws

    + An error if the header key is missing or the decoder is not a response decoder. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decode(decoder: Decoder) throws -> RawValue
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to decode the header value from.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded header value.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultHeaderStrategyOptional.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultHeaderStrategyOptional.html new file mode 100644 index 0000000..958be65 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/DefaultHeaderStrategyOptional.html @@ -0,0 +1,437 @@ + + + + DefaultHeaderStrategyOptional Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DefaultHeaderStrategyOptional

+
+
+ +
public struct DefaultHeaderStrategyOptional<RawValue> : ResponseHeaderDecodingStrategy where RawValue : Decodable, RawValue : Encodable
+ +
+
+

A default strategy for decoding optional response headers.

+ +

The DefaultHeaderStrategyOptional struct provides a default strategy for decoding optional response headers +by checking if the header key is present in the response decoder.

+ +

Example usage:

+
@ResponseHeaderWrapper<Header, DefaultHeaderStrategyOptional> var header: Header?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decode(decoder:) + +
    +
    +
    +
    +
    +
    +

    Decodes the response header value from the given decoder.

    +
    +

    Throws

    + An error if the header key is missing or the decoder is not a response decoder. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decode(decoder: Decoder) throws -> RawValue?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to decode the header value from.

    +
    +
    +
    +
    +

    Return Value

    +

    The decoded header value, or nil if the header key is missing or the decoder is not a response decoder.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/EmptyResponse.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/EmptyResponse.html new file mode 100644 index 0000000..7bff624 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/EmptyResponse.html @@ -0,0 +1,375 @@ + + + + EmptyResponse Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

EmptyResponse

+
+
+ +
public struct EmptyResponse : Decodable
+ +
+
+

A struct representing an empty response.

+ +

The EmptyResponse struct is used to represent an empty response from an API. +It conforms to the Decodable protocol, allowing it to be decoded from an empty response body.

+ +

Example usage:

+
let emptyResponse = try JSONDecoder().decode(EmptyResponse.self, from: Data())
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/NestedResponse.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/NestedResponse.html new file mode 100644 index 0000000..5d39c26 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/NestedResponse.html @@ -0,0 +1,536 @@ + + + + NestedResponse Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

NestedResponse

+
+
+ +
@propertyWrapper
+public struct NestedResponse<Response> where Response : Decodable
+
extension NestedResponse: Decodable
+ +
+
+

A property wrapper that wraps a nested response.

+ +

To support inheritance, which can be especially useful for pagination, use the property wrapper @NestedResponse to add nested responses.

+ +

While decoding the flat HTTP response will be applied recursively to all nested responses, therefore it is possible, that different nested responses access different values of the original HTTP response.

+ +

Example:

+
struct PaginatedResponse<NestedRequest: Request>: Decodable {
+
+    /// Header which indicates how many more elements are available
+    @ResponseHeader<DefaultHeaderStrategy> var totalElements
+
+    @NestedResponse var nested: NestedRequest
+}
+
+struct ListRequest: Request {
+
+    typealias Response = PaginatedResponse<ListResponse>
+
+    struct ListResponse: Decodable {
+        // see other examples
+    }
+}
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the nested response.

    + +

    This property holds the nested response value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: Response
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of NestedResponse with the specified wrapped value.

    + +

    Example usage:

    +
    @NestedResponse var nestedResponse: MyResponseType
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: Response)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the nested response.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of NestedResponse by decoding from the given decoder.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/OptionalContentStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/OptionalContentStrategy.html new file mode 100644 index 0000000..6bd7e89 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/OptionalContentStrategy.html @@ -0,0 +1,496 @@ + + + + OptionalContentStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

OptionalContentStrategy

+
+
+ +
public struct OptionalContentStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 204.

+ +

The OptionalContentStrategy struct provides a strategy for validating response bodies +with a status code of 204 (No Content). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, OptionalContentStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Determines whether the decoding should fail when no content is returned.

    + +

    Example usage:

    +
    let allowsEmpty = OptionalContentStrategy.allowsEmptyContent(for: 204)
    +print(allowsEmpty) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is within the acceptable range.

    + +

    Example usage:

    +
    let isValid = OptionalContentStrategy.validate(statusCode: 200)
    +print(isValid) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is valid.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/QueryItem.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/QueryItem.html new file mode 100644 index 0000000..87fcc20 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/QueryItem.html @@ -0,0 +1,1090 @@ + + + + QueryItem Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

QueryItem

+
+
+ +
@propertyWrapper
+public struct QueryItem<T> where T : QueryItemValue
+
extension QueryItem: Encodable where T: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle query items in a request.

+ +

Example usage:

+
@QueryItem(name: "search") var searchQuery: String
+
+ +

This property wrapper can be used to manage query items in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The custom name of the query item, can be nil.

    + +

    This property holds the custom name of the query item, which can be nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the query item value.

    + +

    This property holds the wrapped value representing the query item value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified wrapped value.

    + +

    Example usage:

    +
    @QueryItem var searchQuery: String = "example"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the query item value.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and default value.

    + +

    Example usage:

    +
    @QueryItem(name: "search") var searchQuery: String = "example"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String? = nil, defaultValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    + + defaultValue + + +
    +

    The default value representing the query item value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Bool +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a default value of false.

    + +

    Example usage:

    +
    @QueryItem(name: "isActive") var isActive: Bool
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Bool? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "isActive") var isActive: Bool?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Double +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a default value of 0.0.

    + +

    Example usage:

    +
    @QueryItem(name: "price") var price: Double
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Double? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "price") var price: Double?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "count") var count: Int?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and an empty string as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "search") var searchQuery: String
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "search") var searchQuery: String?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T: OptionalType, T.Wrapped: RawRepresentable +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @QueryItem(name: "status") var status: MyEnum?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the query item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestCachePolicy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestCachePolicy.html new file mode 100644 index 0000000..cddfe77 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestCachePolicy.html @@ -0,0 +1,536 @@ + + + + RequestCachePolicy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestCachePolicy

+
+
+ +
@propertyWrapper
+public struct RequestCachePolicy
+
extension RequestCachePolicy: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle request cache policies.

+ +

The RequestCachePolicy struct is a property wrapper that allows you to specify the cache policy for a request. +It wraps the URLRequest.CachePolicy type and provides a default value of .useProtocolCachePolicy.

+ +

Example usage:

+
@RequestCachePolicy var cachePolicy: URLRequest.CachePolicy
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the cache policy.

    + +

    This property holds the URLRequest.CachePolicy value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: URLRequest.CachePolicy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestCachePolicy with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestCachePolicy var cachePolicy: URLRequest.CachePolicy = .reloadIgnoringLocalCacheData
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: URLRequest.CachePolicy = .useProtocolCachePolicy)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the cache policy. Defaults to .useProtocolCachePolicy.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encodable +

+
+
+
    +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Encodes this value into the given encoder.

    + +

    This method should never be called because URLRequest.CachePolicy does not conform to Encodable. +If called, it will cause a runtime failure.

    +
    +

    Throws

    + A runtime error indicating that this method should not be called. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encode(to encoder: any Encoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + encoder + + +
    +

    The encoder to write data to.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestCookies.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestCookies.html new file mode 100644 index 0000000..8bd8349 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestCookies.html @@ -0,0 +1,535 @@ + + + + RequestCookies Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestCookies

+
+
+ +
@propertyWrapper
+public struct RequestCookies
+
extension RequestCookies: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP cookies in a request.

+ +

Example usage:

+
@RequestCookies var cookies: [HTTPCookie]
+
+ +

This property wrapper can be used to manage HTTP cookies in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing an array of HTTPCookie objects.

    + +

    This property holds the array of HTTPCookie objects that are managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: [HTTPCookie]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestCookies with an optional array of HTTPCookie objects.

    + +

    Example usage:

    +
    @RequestCookies var cookies: [HTTPCookie] = [cookie1, cookie2]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: [HTTPCookie] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    An array of HTTPCookie objects. Defaults to an empty array.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encodable +

+
+
+
    +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Encodes this value into the given encoder.

    + +

    This method should never be called because HTTPCookie does not conform to Encodable. +If called, it will cause a runtime failure.

    +
    +

    Throws

    + A runtime error indicating that this method should not be called. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func encode(to encoder: Encoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + encoder + + +
    +

    The encoder to write data to.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestHTTPMethod.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestHTTPMethod.html new file mode 100644 index 0000000..c634e52 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestHTTPMethod.html @@ -0,0 +1,465 @@ + + + + RequestHTTPMethod Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestHTTPMethod

+
+
+ +
@propertyWrapper
+public struct RequestHTTPMethod : Encodable
+ +
+
+

A property wrapper for the HTTP method of a request.

+ +

The RequestHTTPMethod property wrapper provides a convenient way to manage the HTTP method of a request. +It allows you to specify the HTTP method for a request using a property wrapper syntax.

+ +

Example usage:

+
@RequestHTTPMethod var httpMethod: HTTPMethod = .post
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the HTTP method.

    + +

    This property holds the HTTPMethod value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: HTTPMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHTTPMethod with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestHTTPMethod var httpMethod: HTTPMethod = .post
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: HTTPMethod = .get)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the HTTP method. Defaults to .get.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestHeader.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestHeader.html new file mode 100644 index 0000000..3183c3f --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestHeader.html @@ -0,0 +1,694 @@ + + + + RequestHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestHeader

+
+
+ +
@propertyWrapper
+public struct RequestHeader<T> where T : RequestHeaderValue
+
extension RequestHeader: Encodable where T: Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP headers in a request.

+ +

Example usage:

+
@RequestHeader var header: String
+
+ +

This property wrapper can be used to manage HTTP headers in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The custom name of the header item, can be nil.

    + +

    This property holds the custom name of the header item, which can be nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the header value.

    + +

    This property holds the wrapped value representing the header value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestHeader var header: String = "value"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the header value.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified name and default value.

    + +

    Example usage:

    +
    @RequestHeader(name: "Custom-Header") var header: String = "value"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String? = nil, defaultValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The custom name of the header item, can be nil.

    +
    +
    + + defaultValue + + +
    +

    The default value representing the header value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified name and an empty string as the default value.

    + +

    Example usage:

    +
    @RequestHeader(name: "Custom-Header") var header: String
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the header item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String? +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestHeader with the specified name and a nil value as the default value.

    + +

    Example usage:

    +
    @RequestHeader(name: "Custom-Header") var header: String?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the header item, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath.html new file mode 100644 index 0000000..8bd5ec1 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath.html @@ -0,0 +1,546 @@ + + + + RequestPath Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestPath

+
+
+ +
@propertyWrapper
+public struct RequestPath : Encodable
+
extension RequestPath: ExpressibleByStringLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByUnicodeScalarLiteral
+ +
+
+

A property wrapper that provides a convenient way to handle request paths.

+ +

The RequestPath struct is a property wrapper that allows you to specify the path for a request. +It wraps a String value and provides a default value of an empty string.

+ +

Example usage:

+
@RequestPath var path: String
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the request path.

    + +

    This property holds the String value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPath with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestPath var path: String = "/api/v1/resource"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: String = "")
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the request path. Defaults to an empty string.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
  • +
  • + +
  • +
  • +
    + + + + StringLiteralType + +
    +
  • +
  • +
    + + + + init(stringLiteral:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPath with the specified string literal.

    + +

    Example usage:

    +
    @RequestPath var path: String = "/api/v1/resource"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(stringLiteral value: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The string literal to initialize the RequestPath with.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html new file mode 100644 index 0000000..76e6a5a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html @@ -0,0 +1,370 @@ + + + + ExtendedGraphemeClusterLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ExtendedGraphemeClusterLiteralType

+
+
+ +
public typealias ExtendedGraphemeClusterLiteralType = String.ExtendedGraphemeClusterLiteralType
+ +
+
+

Initializes a new instance of RequestPath with the specified string literal.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/StringLiteralType.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/StringLiteralType.html new file mode 100644 index 0000000..a919b2d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/StringLiteralType.html @@ -0,0 +1,370 @@ + + + + StringLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

StringLiteralType

+
+
+ +
public typealias StringLiteralType = String.StringLiteralType
+ +
+
+

Initializes a new instance of RequestPath with the specified string literal.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/UnicodeScalarLiteralType.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/UnicodeScalarLiteralType.html new file mode 100644 index 0000000..aa082eb --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPath/UnicodeScalarLiteralType.html @@ -0,0 +1,370 @@ + + + + UnicodeScalarLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnicodeScalarLiteralType

+
+
+ +
public typealias UnicodeScalarLiteralType = String.UnicodeScalarLiteralType
+ +
+
+

Initializes a new instance of RequestPath with the specified string literal.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter.html new file mode 100644 index 0000000..bb88f18 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter.html @@ -0,0 +1,1085 @@ + + + + RequestPathParameter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestPathParameter

+
+
+ +
@propertyWrapper
+public struct RequestPathParameter<T> where T : RequestPathParameterValue
+
extension RequestPathParameter: Encodable where T: Encodable
+
extension RequestPathParameter: ExpressibleByNilLiteral where T: ExpressibleByNilLiteral
+
extension RequestPathParameter: ExpressibleByStringLiteral,
+    ExpressibleByExtendedGraphemeClusterLiteral,
+    ExpressibleByUnicodeScalarLiteral
+where T == String
+
extension RequestPathParameter: ExpressibleByIntegerLiteral where T == IntegerLiteralType
+ +
+
+

A property wrapper that provides a convenient way to handle path parameters in a request.

+ +

Example usage:

+
@RequestPathParameter var userId: String
+
+ +

This property wrapper can be used to manage path parameters in a request.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The custom name of the path parameter, can be nil.

    + +

    This property holds the custom name of the path parameter, which can be nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the path parameter value.

    + +

    This property holds the wrapped value representing the path parameter value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestPathParameter var userId: String = "123"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the path parameter value.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and default value.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: String = "123"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?, defaultValue: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    + + defaultValue + + +
    +

    The default value representing the path parameter value.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + getParameterType() + +
    +
    +
    +
    +
    +
    +

    Returns the type of the path parameter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getParameterType() -> Any.Type
    + +
    +
    +
    +

    Return Value

    +

    The type of the path parameter.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == String +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and an empty string as the default value.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: String
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int16 +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int16
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int32 +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int32
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T == Int64 +

+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

    + +

    Example usage:

    +
    @RequestPathParameter(name: "userId") var userId: Int64
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + name + + +
    +

    The custom name of the path parameter, can be nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where T: ExpressibleByNilLiteral +

+
+
+ +
+
+
+ + +
+ +

Available where T == String +

+
+
+ +
+
+
+ + +
+ +

Available where T == IntegerLiteralType +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html new file mode 100644 index 0000000..0db5299 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html @@ -0,0 +1,369 @@ + + + + ExtendedGraphemeClusterLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ExtendedGraphemeClusterLiteralType

+
+
+ +
public typealias ExtendedGraphemeClusterLiteralType = String.ExtendedGraphemeClusterLiteralType
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/StringLiteralType.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/StringLiteralType.html new file mode 100644 index 0000000..b8c624a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/StringLiteralType.html @@ -0,0 +1,369 @@ + + + + StringLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

StringLiteralType

+
+
+ +
public typealias StringLiteralType = String.StringLiteralType
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/UnicodeScalarLiteralType.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/UnicodeScalarLiteralType.html new file mode 100644 index 0000000..ca83f2d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestPathParameter/UnicodeScalarLiteralType.html @@ -0,0 +1,369 @@ + + + + UnicodeScalarLiteralType Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

UnicodeScalarLiteralType

+
+
+ +
public typealias UnicodeScalarLiteralType = String.UnicodeScalarLiteralType
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestURL.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestURL.html new file mode 100644 index 0000000..52dd39b --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/RequestURL.html @@ -0,0 +1,465 @@ + + + + RequestURL Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

RequestURL

+
+
+ +
@propertyWrapper
+public struct RequestURL : Encodable
+ +
+
+

A property wrapper that provides a convenient way to handle request URLs.

+ +

The RequestURL struct is a property wrapper that allows you to specify the URL for a request. +It wraps a URL? value and provides a default value of nil.

+ +

Example usage:

+
@RequestURL var url: URL?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the request URL.

    + +

    This property holds the URL? value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: URL?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of RequestURL with the specified wrapped value.

    + +

    Example usage:

    +
    @RequestURL var url: URL? = URL(string: "https://api.example.com/resource")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: URL? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the request URL. Defaults to nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseBodyWrapper.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseBodyWrapper.html new file mode 100644 index 0000000..38c8262 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseBodyWrapper.html @@ -0,0 +1,566 @@ + + + + ResponseBodyWrapper Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseBodyWrapper

+
+
+ +
@propertyWrapper
+public struct ResponseBodyWrapper<Body, BodyStrategy> where Body : Decodable, BodyStrategy : ResponseBodyDecodingStrategy
+
extension ResponseBodyWrapper: Decodable
+ +
+
+

A property wrapper that wraps a response body.

+ +

The ResponseBodyWrapper property wrapper is used to wrap a response body value. +It provides a wrappedValue property that holds the response body value.

+ +

Example usage:

+
@ResponseBodyWrapper var responseBody: MyResponseType?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the decoded response body.

    + +

    This property holds the decoded response body that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: Body?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseBodyWrapper with a nil value.

    + +

    Example usage:

    +
    @ResponseBodyWrapper var responseBody: MyResponseType?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseBodyWrapper with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseBodyWrapper var responseBody: MyResponseType? = MyResponseType()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: Body?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the decoded response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Decodable +

+
+
+
    +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseBodyWrapper from a decoder.

    + +

    Example usage:

    +
    let responseBody: MyResponseType? = try ResponseBodyWrapper(from: decoder)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to use for decoding the response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseCookies.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseCookies.html new file mode 100644 index 0000000..76b556a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseCookies.html @@ -0,0 +1,522 @@ + + + + ResponseCookies Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseCookies

+
+
+ +
@propertyWrapper
+public struct ResponseCookies
+
extension ResponseCookies: Decodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP cookies in a response.

+ +

Example usage:

+
@ResponseCookies var cookies: [HTTPCookie]
+
+ +

This property wrapper can be used to manage HTTP cookies in a response.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing an array of HTTPCookie objects.

    + +

    This property holds the array of HTTPCookie objects that are managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: [HTTPCookie]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseCookies with an optional array of HTTPCookie objects.

    + +

    Example usage:

    +
    @ResponseCookies var cookies: [HTTPCookie] = [cookie1, cookie2]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: [HTTPCookie] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    An array of HTTPCookie objects. Defaults to an empty array.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseCookies by decoding from the given decoder.

    + +

    This initializer should only be used with a ResponseDecoding decoder. +If the decoder is not a ResponseDecoding instance, a runtime failure will occur.

    +
    +

    Throws

    + APIError.invalidResponse if the response is invalid. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseErrorBodyWrapper.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseErrorBodyWrapper.html new file mode 100644 index 0000000..a4e7730 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseErrorBodyWrapper.html @@ -0,0 +1,566 @@ + + + + ResponseErrorBodyWrapper Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseErrorBodyWrapper

+
+
+ +
@propertyWrapper
+public struct ResponseErrorBodyWrapper<Body, BodyStrategy> where Body : Decodable, BodyStrategy : ResponseErrorBodyDecodingStrategy
+
extension ResponseErrorBodyWrapper: Decodable
+ +
+
+

A property wrapper that wraps an error response body.

+ +

The ResponseErrorBodyWrapper property wrapper is used to wrap an error response body value. +It provides a wrappedValue property that holds the error response body value.

+ +

Example usage:

+
@ResponseErrorBodyWrapper var errorResponseBody: MyErrorResponseType?
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the decoded error response body.

    + +

    This property holds the decoded error response body that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: Body?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseErrorBodyWrapper with a nil value.

    + +

    Example usage:

    +
    @ResponseErrorBodyWrapper var errorResponseBody: MyErrorResponseType?
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseErrorBodyWrapper with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseErrorBodyWrapper var errorResponseBody: MyErrorResponseType? = MyErrorResponseType()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: Body?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the decoded error response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Decodable +

+
+
+
    +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseErrorBodyWrapper from a decoder.

    + +

    Example usage:

    +
    let errorResponseBody: MyErrorResponseType? = try ResponseErrorBodyWrapper(from: decoder)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to use for decoding the error response body.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseHeader.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseHeader.html new file mode 100644 index 0000000..6477683 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseHeader.html @@ -0,0 +1,540 @@ + + + + ResponseHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseHeader

+
+
+ +
@propertyWrapper
+public struct ResponseHeader<DecodingStrategy> where DecodingStrategy : ResponseHeaderDecodingStrategy
+
extension ResponseHeader: Decodable where DecodingStrategy.RawValue: Decodable
+ +
+
+

A property wrapper that provides a convenient way to handle HTTP headers in a response.

+ +

The ResponseHeader struct is a property wrapper that allows you to decode HTTP headers from a response +using a specified decoding strategy. It wraps the DecodingStrategy.RawValue type and provides a default value.

+ +

Example usage:

+
@ResponseHeader<CustomDecodingStrategy> var header: String
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the decoded header value.

    + +

    This property holds the DecodingStrategy.RawValue value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: DecodingStrategy.RawValue
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseHeader with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseHeader<CustomDecodingStrategy> var header: String = "value"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: DecodingStrategy.RawValue)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the decoded header value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where DecodingStrategy.RawValue: Decodable +

+
+
+
    +
  • +
    + + + + init(from:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseHeader by decoding from the given decoder.

    + +

    This initializer uses the specified decoding strategy to decode the header value from the given decoder.

    +
    +

    Throws

    + An error if the decoding process fails. + +
    + +

    Example usage:

    +
    let decoder = JSONDecoder()
    +let header = try ResponseHeader<CustomDecodingStrategy>(from: decoder)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(from decoder: Decoder) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + decoder + + +
    +

    The decoder to read data from.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseStatusCode.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseStatusCode.html new file mode 100644 index 0000000..119d16d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ResponseStatusCode.html @@ -0,0 +1,531 @@ + + + + ResponseStatusCode Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseStatusCode

+
+
+ +
@propertyWrapper
+public struct ResponseStatusCode : Decodable
+ +
+
+

A property wrapper that provides a convenient way to handle response status codes.

+ +

The ResponseStatusCode struct is a property wrapper that allows you to specify the status code for a response. +It wraps the UInt16 type and provides a default value of 0.

+ +

Example usage:

+
@ResponseStatusCode var statusCode: UInt16
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrappedValue + +
    +
    +
    +
    +
    +
    +

    The wrapped value representing the status code.

    + +

    This property holds the UInt16 value that is managed by this property wrapper.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var wrappedValue: UInt16
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + projectedValue + +
    +
    +
    +
    +
    +
    +

    The projected value representing the HTTP status code.

    + +

    This property provides a convenient way to access the HTTPStatusCode value corresponding to the wrapped value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var projectedValue: HTTPStatusCode? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseStatusCode with the default value of 0.

    + +

    Example usage:

    +
    @ResponseStatusCode var statusCode: UInt16 = 0
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(wrappedValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes a new instance of ResponseStatusCode with the specified wrapped value.

    + +

    Example usage:

    +
    @ResponseStatusCode var statusCode: UInt16 = 200
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(wrappedValue: UInt16)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + wrappedValue + + +
    +

    The wrapped value representing the status code.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus200BodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus200BodyStrategy.html new file mode 100644 index 0000000..a65430f --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus200BodyStrategy.html @@ -0,0 +1,490 @@ + + + + ValidateStatus200BodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus200BodyStrategy

+
+
+ +
public struct ValidateStatus200BodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 200.

+ +

The ValidateStatus200BodyStrategy struct provides a strategy for validating response bodies +with a status code of 200 (OK). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, ValidateStatus200BodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether empty content is allowed for the given status code.

    + +

    This method always returns false for status code 200, indicating that empty content is not allowed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for _: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is 200 (OK).

    + +

    This method checks if the given status code is equal to 200 (OK).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is 200 (OK).

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus201BodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus201BodyStrategy.html new file mode 100644 index 0000000..53e035e --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus201BodyStrategy.html @@ -0,0 +1,493 @@ + + + + ValidateStatus201BodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus201BodyStrategy

+
+
+ +
public struct ValidateStatus201BodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 201.

+ +

The ValidateStatus201BodyStrategy struct provides a strategy for validating response bodies +with a status code of 201 (Created). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, ValidateStatus201BodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether empty content is allowed for the given status code.

    + +

    This method always returns false for status code 201, indicating that empty content is not allowed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is 201 (Created).

    + +

    Example usage:

    +
    let isValid = ValidateStatus201BodyStrategy.validate(statusCode: 201)
    +print(isValid) // Output: true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is 201 (Created).

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus303BodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus303BodyStrategy.html new file mode 100644 index 0000000..49c6b53 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus303BodyStrategy.html @@ -0,0 +1,490 @@ + + + + ValidateStatus303BodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus303BodyStrategy

+
+
+ +
public struct ValidateStatus303BodyStrategy : ResponseBodyDecodingStrategy
+ +
+
+

A strategy for validating response bodies with status code 303.

+ +

The ValidateStatus303BodyStrategy struct provides a strategy for validating response bodies +with a status code of 303 (See Other). It conforms to the ResponseBodyDecodingStrategy protocol +and defines the allowsEmptyContent(for:) and validate(statusCode:) methods.

+ +

Example usage:

+
@ResponseBodyWrapper<Body, ValidateStatus303BodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Indicates whether empty content is allowed for the given status code.

    + +

    This method always returns true for status code 303, indicating that empty content is allowed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func allowsEmptyContent(for _: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether empty content is allowed.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Validates the HTTP status code to determine if it is 303 (See Other).

    + +

    This method checks if the given status code is equal to the raw value of HTTPStatusCode.seeOther.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func validate(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The HTTP status code of the response.

    +
    +
    +
    +
    +

    Return Value

    +

    A Boolean value indicating whether the status code is 303.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus400ErrorBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus400ErrorBodyStrategy.html new file mode 100644 index 0000000..bea927d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus400ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus400ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus400ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus400ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 400.

+ +

The ValidateStatus400ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 400 (Bad Request). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 400.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus400ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Checks if the given status code represents an error.

    + +

    This method checks if the given status code is equal to 400 (Bad Request).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 400, false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus401ErrorBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus401ErrorBodyStrategy.html new file mode 100644 index 0000000..4eb075f --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus401ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus401ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus401ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus401ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 401.

+ +

The ValidateStatus401ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 401 (Unauthorized). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 401.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus401ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Checks if the given status code represents an error.

    + +

    This method checks if the given status code is equal to 401 (Unauthorized).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 401, false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus403ErrorBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus403ErrorBodyStrategy.html new file mode 100644 index 0000000..6287ff9 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus403ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus403ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus403ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus403ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 403.

+ +

The ValidateStatus403ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 403 (Forbidden). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 403.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus403ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Forbidden” (403).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 403 (Forbidden), false otherwise.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus404ErrorBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus404ErrorBodyStrategy.html new file mode 100644 index 0000000..2e24f17 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus404ErrorBodyStrategy.html @@ -0,0 +1,435 @@ + + + + ValidateStatus404ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus404ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus404ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating error response bodies with status code 404.

+ +

The ValidateStatus404ErrorBodyStrategy struct provides a strategy for validating error response bodies +with a status code of 404 (Not Found). It conforms to the ResponseErrorBodyDecodingStrategy protocol +and defines the isError(statusCode:) method to check if the status code is 404.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus404ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Not Found” (404).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 404, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus410ErrorBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus410ErrorBodyStrategy.html new file mode 100644 index 0000000..e1ea98e --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus410ErrorBodyStrategy.html @@ -0,0 +1,433 @@ + + + + ValidateStatus410ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus410ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus410ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating the body of a response with a status code of 410.

+ +

The ValidateStatus410ErrorBodyStrategy struct provides a strategy for validating the body of a response with a status code of 410.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus410ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Gone” (410).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 410, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus422ErrorBodyStrategy.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus422ErrorBodyStrategy.html new file mode 100644 index 0000000..bc62031 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Structs/ValidateStatus422ErrorBodyStrategy.html @@ -0,0 +1,433 @@ + + + + ValidateStatus422ErrorBodyStrategy Structure Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ValidateStatus422ErrorBodyStrategy

+
+
+ +
public struct ValidateStatus422ErrorBodyStrategy : ResponseErrorBodyDecodingStrategy
+ +
+
+

A strategy for validating the body of a response with a status code of 422.

+ +

The ValidateStatus422ErrorBodyStrategy struct provides a strategy for validating the body of a response with a status code of 422.

+ +

Example usage:

+
@ResponseErrorBodyWrapper<Body, ValidateStatus422ErrorBodyStrategy> var body: Body
+
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + isError(statusCode:) + +
    +
    +
    +
    +
    +
    +

    Determines if the given status code represents an error.

    + +

    This method checks if the provided status code is equal to the HTTP status code for “Unprocessable Entity” (422).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func isError(statusCode: Int) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + statusCode + + +
    +

    The status code to check.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the status code is 422, otherwise false.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases.html new file mode 100644 index 0000000..ee1aaa3 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases.html @@ -0,0 +1,486 @@ + + + + Type Aliases Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedDecodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedDecodable.html new file mode 100644 index 0000000..df22013 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedDecodable.html @@ -0,0 +1,368 @@ + + + + FormURLEncodedDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedDecodable

+
+
+ +
public typealias FormURLEncodedDecodable = Decodable & FormURLEncodedFormatProvider
+ +
+
+

A type that can decode itself from an external form-url encoded representation.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedEncodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedEncodable.html new file mode 100644 index 0000000..11b3a6c --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedEncodable.html @@ -0,0 +1,368 @@ + + + + FormURLEncodedEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedRequest.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedRequest.html new file mode 100644 index 0000000..053250c --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/FormURLEncodedRequest.html @@ -0,0 +1,368 @@ + + + + FormURLEncodedRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FormURLEncodedRequest

+
+
+ +
public typealias FormURLEncodedRequest = Request & FormURLEncodedEncodable
+ +
+
+

Protocol indicating a given request should be encoded into a form URL encoded request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONDecodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONDecodable.html new file mode 100644 index 0000000..b20b25a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONDecodable.html @@ -0,0 +1,368 @@ + + + + JSONDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONDecodable

+
+
+ +
public typealias JSONDecodable = Decodable & JSONFormatProvider
+ +
+
+

A type that can decode itself from an external JSON representation.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONEncodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONEncodable.html new file mode 100644 index 0000000..92c3bab --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONEncodable.html @@ -0,0 +1,368 @@ + + + + JSONEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONRequest.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONRequest.html new file mode 100644 index 0000000..349e677 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/JSONRequest.html @@ -0,0 +1,368 @@ + + + + JSONRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

JSONRequest

+
+
+ +
public typealias JSONRequest = Request & JSONEncodable
+ +
+
+

Protocol indicating a given request should be encoded into a JSON request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainDecodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainDecodable.html new file mode 100644 index 0000000..6964757 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainDecodable.html @@ -0,0 +1,368 @@ + + + + PlainDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainDecodable

+
+
+ +
public typealias PlainDecodable = String
+ +
+
+

A type which represents plain text

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainEncodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainEncodable.html new file mode 100644 index 0000000..602a991 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainEncodable.html @@ -0,0 +1,368 @@ + + + + PlainEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainRequest.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainRequest.html new file mode 100644 index 0000000..f960085 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/PlainRequest.html @@ -0,0 +1,368 @@ + + + + PlainRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

PlainRequest

+
+
+ +
public typealias PlainRequest = Request & PlainEncodable
+ +
+
+

Protocol indicating a given request should be encoded into a JSON request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/ResponseBody.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/ResponseBody.html new file mode 100644 index 0000000..7778ba8 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/ResponseBody.html @@ -0,0 +1,375 @@ + + + + ResponseBody Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseBody

+
+
+ +
public typealias ResponseBody<Body> = ResponseBodyWrapper<Body, DefaultBodyStrategy> where Body : Decodable
+ +
+
+

A type alias for ResponseBodyWrapper with a default body decoding strategy.

+ +

The ResponseBody type alias provides a convenient way to use ResponseBodyWrapper with the DefaultBodyStrategy. +It represents the response body of a request and uses the default decoding strategy to decode the response body.

+ +

Example usage:

+
let responseBody: ResponseBody<MyResponseType>
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/ResponseErrorBody.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/ResponseErrorBody.html new file mode 100644 index 0000000..32bfd2a --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/ResponseErrorBody.html @@ -0,0 +1,375 @@ + + + + ResponseErrorBody Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ResponseErrorBody

+
+
+ +
public typealias ResponseErrorBody<Body> = ResponseErrorBodyWrapper<Body, DefaultErrorBodyStrategy> where Body : Decodable
+ +
+
+

A type alias for ResponseErrorBodyWrapper with a default error body decoding strategy.

+ +

The ResponseErrorBody type alias provides a convenient way to use ResponseErrorBodyWrapper with the DefaultErrorBodyStrategy. +It represents the error response body of a request and uses the default decoding strategy to decode the error response body.

+ +

Example usage:

+
let errorResponseBody: ResponseErrorBody<MyErrorResponseType>
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLDecodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLDecodable.html new file mode 100644 index 0000000..2484c2d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLDecodable.html @@ -0,0 +1,368 @@ + + + + XMLDecodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLDecodable

+
+
+ +
public typealias XMLDecodable = Decodable & XMLFormatProvider
+ +
+
+

A type that can decode itself from an external JSON representation.

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLEncodable.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLEncodable.html new file mode 100644 index 0000000..27a9317 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLEncodable.html @@ -0,0 +1,368 @@ + + + + XMLEncodable Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ + +
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLRequest.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLRequest.html new file mode 100644 index 0000000..46d2609 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/Typealiases/XMLRequest.html @@ -0,0 +1,368 @@ + + + + XMLRequest Type Alias Reference + + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XMLRequest

+
+
+ +
public typealias XMLRequest = Request & XMLEncodable
+ +
+
+

Protocol indicating a given request should be encoded into an XML request

+ + +
+
+ +
+
+
+
+ +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/badge.svg b/docs/docsets/Postie.docset/Contents/Resources/Documents/badge.svg new file mode 100644 index 0000000..bfac052 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 99% + + + 99% + + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/css/highlight.css b/docs/docsets/Postie.docset/Contents/Resources/Documents/css/highlight.css new file mode 100644 index 0000000..c170357 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/css/highlight.css @@ -0,0 +1,202 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight .c { + color: #999988; + font-style: italic; } + +.highlight .err { + color: #a61717; + background-color: #e3d2d2; } + +.highlight .k { + color: #000000; + font-weight: bold; } + +.highlight .o { + color: #000000; + font-weight: bold; } + +.highlight .cm { + color: #999988; + font-style: italic; } + +.highlight .cp { + color: #999999; + font-weight: bold; } + +.highlight .c1 { + color: #999988; + font-style: italic; } + +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + +.highlight .gd { + color: #000000; + background-color: #ffdddd; } + +.highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + +.highlight .ge { + color: #000000; + font-style: italic; } + +.highlight .gr { + color: #aa0000; } + +.highlight .gh { + color: #999999; } + +.highlight .gi { + color: #000000; + background-color: #ddffdd; } + +.highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + +.highlight .go { + color: #888888; } + +.highlight .gp { + color: #555555; } + +.highlight .gs { + font-weight: bold; } + +.highlight .gu { + color: #aaaaaa; } + +.highlight .gt { + color: #aa0000; } + +.highlight .kc { + color: #000000; + font-weight: bold; } + +.highlight .kd { + color: #000000; + font-weight: bold; } + +.highlight .kp { + color: #000000; + font-weight: bold; } + +.highlight .kr { + color: #000000; + font-weight: bold; } + +.highlight .kt { + color: #445588; } + +.highlight .m { + color: #009999; } + +.highlight .s { + color: #d14; } + +.highlight .na { + color: #008080; } + +.highlight .nb { + color: #0086B3; } + +.highlight .nc { + color: #445588; + font-weight: bold; } + +.highlight .no { + color: #008080; } + +.highlight .ni { + color: #800080; } + +.highlight .ne { + color: #990000; + font-weight: bold; } + +.highlight .nf { + color: #990000; } + +.highlight .nn { + color: #555555; } + +.highlight .nt { + color: #000080; } + +.highlight .nv { + color: #008080; } + +.highlight .ow { + color: #000000; + font-weight: bold; } + +.highlight .w { + color: #bbbbbb; } + +.highlight .mf { + color: #009999; } + +.highlight .mh { + color: #009999; } + +.highlight .mi { + color: #009999; } + +.highlight .mo { + color: #009999; } + +.highlight .sb { + color: #d14; } + +.highlight .sc { + color: #d14; } + +.highlight .sd { + color: #d14; } + +.highlight .s2 { + color: #d14; } + +.highlight .se { + color: #d14; } + +.highlight .sh { + color: #d14; } + +.highlight .si { + color: #d14; } + +.highlight .sx { + color: #d14; } + +.highlight .sr { + color: #009926; } + +.highlight .s1 { + color: #d14; } + +.highlight .ss { + color: #990073; } + +.highlight .bp { + color: #999999; } + +.highlight .vc { + color: #008080; } + +.highlight .vg { + color: #008080; } + +.highlight .vi { + color: #008080; } + +.highlight .il { + color: #009999; } diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/css/jazzy.css b/docs/docsets/Postie.docset/Contents/Resources/Documents/css/jazzy.css new file mode 100644 index 0000000..9d4b08b --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/css/jazzy.css @@ -0,0 +1,405 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + a.discouraged { + text-decoration: line-through; } + a.discouraged:hover, a.discouraged:focus { + text-decoration: underline line-through; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +hr { + height: 1px; + border: none; + background-color: #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { + background: #f7f7f7; + padding: .2em; } + .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 2px; + vertical-align: -3px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + .section-name p { + margin-bottom: inherit; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.section-name-container { + position: relative; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 20px; + font-size: 1rem; } + +.declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } + +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } + +form[role=search] .tt-highlight { + font-weight: bold; } + +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/img/carat.png b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/carat.png new file mode 100755 index 0000000..29d2f7f Binary files /dev/null and b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/carat.png differ diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/img/dash.png b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/dash.png new file mode 100755 index 0000000..6f694c7 Binary files /dev/null and b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/dash.png differ diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/img/gh.png b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/gh.png new file mode 100755 index 0000000..628da97 Binary files /dev/null and b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/gh.png differ diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/img/spinner.gif b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/spinner.gif new file mode 100644 index 0000000..e3038d0 Binary files /dev/null and b/docs/docsets/Postie.docset/Contents/Resources/Documents/img/spinner.gif differ diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/index.html b/docs/docsets/Postie.docset/Contents/Resources/Documents/index.html new file mode 100644 index 0000000..a66ecd9 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,1078 @@ + + + + Postie Reference + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+ +

Postie

+

Postie - The next-level structured HTTP API Client

+ + + +

+ Created and maintained by Philip Niedertscheider at kula.app and all the amazing contributors. +

+ +

Postie is a pure Swift library for building URLRequests using property wrappers.

+

Example

+ +

Checkout this full example starting at defining the request and the expected response, up to creating a client and sending it to the remote endpoint.

+
import Foundation
+import Postie
+
+// Request contains body data encoded as a JSON
+struct MyRequest: JSONRequest {
+
+    // The request body is strongly typed defined
+    struct RequestBody: Encodable {
+        var someNumberValue: Int
+    }
+
+    // Define the response directly inside the request, so every
+    // Request-Response are isolated.
+    // Also directly define, that the response body shall be decoded
+    // from Form-URL-Encoding
+    struct Response: FormURLEncodedDecodable {
+
+        // The expected response body structure
+        struct Body: Decodable {
+            var someNumberValue: Int
+        }
+
+        // The expected response body structure, in case we did something wrong
+        struct ErrorBody: Decodable {
+            var message: String
+        }
+
+        // Property wrappers define the purpose
+        @ResponseBody<Body> var body
+        @ResponseErrorBody<ErrorBody> var errorBody
+
+        // Access specific response headers
+        @ResponseHeader<DefaultStrategy> var contentType: String
+
+        // Status codes also have convenience utilities
+        @ResponseStatusCode var statusCode
+
+        // Cookies send by the remote
+        @RequestCookies var cookies
+    }
+
+    // The `keyEncodingStrategy` determines how to encode a type’s coding keys as JSON keys.
+    // The default value return `.convertToSnakeCase` but you can optionally choose to return `.useDefaultKeys` by implementing JSONRequest's protocol requirement as follow:
+    // var keyEncodingStrategy: JSONEncoder.KeyEncodingStrategy {
+    //     .useDefaultKeys
+    // }
+
+
+    // This property holds the data which will be encoded
+    var body: RequestBody
+
+    // Location of our resource with template string
+    @RequestPath var path = "/profile/{user_id}"
+
+    // Parameter to replace in the template string
+    @RequestPathParameter(name: "userId") var userId: String
+
+    // HTTP method that shall be used
+    @RequestHTTPMethod var method = .post
+
+    // Set request headers using the property naming
+    @RequestHeader var authorization: String?
+
+    // Set multiple instances of HTTPCookie
+    @RequestCookies var cookies
+}
+
+// Create a request
+var request = MyRequest(body: MyRequest.RequestBody(someNumberValue: 42),
+                        userId: "my-user-id")
+request.authorization = "Bearer my-oauth-token"
+
+// Create a client
+let client = HTTPAPIClient(url: URL(string: "https://example.org")!)
+
+// Send the request
+client.send(request)
+    .sink { result in
+        switch result {
+        case .failure(let error):
+            print("Oh no something went wrong :(")
+            print(error)
+        case .finished:
+            print("Everything worked fine :)")
+        }
+    } receiveValue: { response in
+        // The single response object contains all the interesting data
+        print(response.statusCode)
+        print(response.body)
+        print(response.errorBody)
+        print(response.contentType)
+    }
+
+

Core Concept

+ +

The networking layer of Foundation (and with Combine) is already quite advanced. +Using URLRequest you can set many different configuration values, e.g. the HTTP Method or Headers.

+ +

Unfortunately you still need to manually serialize your payload into Foundation.Data and set it as the request body. +Additionally you also have to set Content-Type header, or otherwise the remote won’t be able to understand the content.

+ +

Also the response needs to be decoded, and even if a few decoders are included, e.g. JSONDecoder, reading and parsing the URLResponse is not intuitive.

+ +

Even worse when the response structure differs in case of an error, e.g. instead of

+
{
+  "some": "data"
+}
+
+ +

an error object is returned:

+
{
+  "error": {
+    "message": "Something went wrong!"
+  }
+}
+
+ +

This would require to create combined types such as this one:

+
struct Response: Decodable {
+    struct ErrorResponse: Decodable {
+        var message: String
+    }
+
+    var some: String?
+    var error: ErrorResponse?
+}
+
+ +

and you would have to use nil-checking (probably in combination with the HTTP Status Code) to see which data is present.

+ +

Postie simplifies these use cases. The main idea is defining slim struct types to build the requests, and serialize the associated responses. +Configuration of the request is done using property wrappers, e.g. @QueryItem.

+

Usage

+

Defining the request

+ +

Postie includes a couple of types to build your requests. As a first step, create your Request type, with an associated Response:

+
import Postie
+
+struct FooRequest: Request  {
+    typealias Response = EmptyResponse
+}
+
+ +

The default Request type is used for URL requests without any body data. +If you want to include payload data, use one of the following ones:

+ + + +

All of these expect a body instance variable. +For JSONRequest, FormURLEncodedRequest and XMLRequest the type of body is generic but needs to implement the Encodable protocol.

+ +

Example:

+
struct Foo: JSONRequest {
+
+    struct Body: Encodable {}
+    typealias Response = EmptyResponse
+
+    var body: Body
+
+}
+
+struct Bar: FormURLEncodedRequest {
+
+    struct Body: Encodable {}
+    typealias Response = EmptyResponse
+
+    var body: Body
+
+}
+
+struct Bar: XMLRequest {
+
+    struct Body: Encodable {}
+    typealias Response = EmptyResponse
+
+    var body: Body
+
+}
+
+ +

For the PlainRequest the body expects a plain String content. Optionally you can also overwrite the encoding variable with a custom encoding (default is utf8).

+ +

Example:

+
struct Foo: PlainRequest {
+
+    typealias Response = EmptyResponse
+
+    var body: String
+    var encoding: String.Encoding = .utf16 // default: .utf8
+
+}
+
+

Setting the request HTTP Method

+ +

The default HTTP method is GET, but it can be overwritten by adding an instance property with the property wrapper @RequestHTTPMethod:

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestHTTPMethod var method
+
+}
+
+// Usage
+var request = Request()
+request.method = .post
+
+ +

Note:

+ +

As the property name is ignored, it is possible to have multiple properties with this property wrapper, but only the last one will be used.

+

Setting the request URL path

+ +

The default path /, but it can be overwritten by adding an instance property with the property wrapper @RequestPath:

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestPath var path
+
+}
+
+// Usage
+let request = Request(path: "/some-detail-path")
+
+ +

Additionally the request path can contain variables using the mustache syntax, e.g. /path/with/{variable_name}/inside.

+ +

To set the variable value, add a new instance property using the @RequestPathParameter property wrapper. +By default the encoder uses the variable name for encoding, but you can also define a custom name:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestPath var path = "/app/{id}/contacts/{cid}"
+    @RequestPathParameter var id: Int
+    @RequestPathParameter(name: "cid") var contactId: String
+
+}
+
+// Usage
+var request = Request(id: 123)
+request.contactId = "ABC456"
+
+// Result:
+https://postie.local/app/123/contacts/ABC456
+
+ +

Note:

+ +

As the property name is ignored, it is possible to have multiple properties with this property wrapper, but only the last one will be used. +Also you need to require a leading forward slash (/) in the path.

+

Adding query items to the URL

+ +

Multiple query items can be added by adding them as properties using the property wrapper @QueryItem.

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @QueryItem
+    var text: String
+
+    @QueryItem(name: "other_text")
+    var anotherQuery: String
+
+    @QueryItem
+    var optionalText: String?
+
+}
+
+// Usage
+var request = Request(text: "foo")
+request.anotherQuery = "bar"
+
+// Result query in URL:
+?text=foo&other_text=bar
+
+ +

If no custom name is set, the variable name is used. If the query item is optional, and not set (therefore nil), it won’t be added to the list.

+ +

Supported query value types can be found in QueryItemValue.swift.

+ +

Note:

+ +

When using an Array as the query item type, every value in the array is appended using the same name. +The remote server is then responsible to collect all query items with the same name and merge them into an array.

+ +

Example: [1, 2, 3] with name values becomes ?values=1&values=2&values=3

+ +

As multiple query items can use the same custom name, they will all be appended to the query. +This does not apply to synthesized names, as a Swift type can not have more than one property with the exact same name.

+

Adding Headers to the request

+ +

Multiple headers can be set by adding them as properties using the property wrapper @RequestHeader.

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestHeader
+    var text: String
+
+    @RequestHeader(name: "other_text")
+    var anotherQuery: String
+
+    @RequestHeader
+    var optionalText: String?
+
+}
+
+// Usage
+var request = Request(text: "foo")
+request.anotherQuery = "bar"
+
+// Result query in URL:
+?text=foo&other_text=bar
+
+ +

If no custom name is set, the variable name is used. If the header is optional, and not set (therefore nil), it won’t be added to the list.

+ +

Supported header values types can be found in RequestHeaderValue.swift.

+ +

Note:

+ +

As multiple query items can use the same custom name, the last one will be used. +This does not apply to synthesized names, as a Swift type can not have more than one property with the exact same name.

+

Defining the response

+ +

Every struct implementing Request expects to have an associated Response type implementing the Decodable protocol. +In the examples above the EmptyResponse convenience type (which is an empty, decodable type) has been used.

+ +

The response structure will be populated with data from either the response body data or metadata.

+

Parsing the response body

+ +

To parse the response data into a Decodable type, add a property with the property wrapper @ResponseBody<BodyType> where BodyType is the response body type.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: Decodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+ +

To indicate the decoding system which response data format should be expected, conform your response type to one of the following protocols:

+ + + +

For JSONDecodable, FormURLEncodedDecodable and XMLDecodable the type of body is generic but needs to implement the Decodable protocol.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: JSONDecodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: FormURLEncodedDecodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: XMLDecodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+ +

For the type PlainDecodable, use it directly, as it is an alias for String.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        @ResponseBody<PlainDecodable> var body
+    }
+}
+
+

Response body on error

+ +

As mentioned in Core Concept Postie allows defining a body response type when receiving an invalid status code (>=400).

+ +

It’s usage is exactly the same as with @ResponseBody, but instead you need to use the property wrapper @ResponseErrorBody. +Either the @ResponseBody or the @ResponseErrorBody is set, never both at the same time.

+ +

The error response body gets set if the response status code is neither a 2XX nor a 3XX status code.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct ErrorBody: JSONDecodable {
+            var message: String
+        }
+        @ResponseErrorBody<ErrorBody> var errorBody
+    }
+}
+
+

Response parsing strategies

+ +

As the response body might differ depending on various factors, you can control the parsing using “decoding strategies”.

+ +

By default if you use ResponseBody to parse the response body, it will use the DefaultBodyStrategy (which expects an HTTP status code 2XX or 3XX).

+ +

The same applies to the ResponseErrorBody to parse the response body for a status code of 400 or above, which is using the DefaultErrorBodyStrategy.

+ +

For your convenience we added a couple of convenience strategies in ResponseBody and ResponseErrorBody, you can use with the ResponseBodyWrapper and ResponseErrorBodyWrapper.

+ +

If you want to implement a custom decoding strategy, all you need to do is define a struct implementing the protocol ResponseBodyDecodingStrategy or ResponseErrorBodyDecodingStrategy.

+ +

Example:*

+
struct CustomBodyDecodingStrategy {
+    public static func allowsEmptyContent(for _: Int) -> Bool {
+        return false
+    }
+
+    public static func validate(statusCode: Int) -> Bool {
+        // e.g. only decode if the status code is 999
+        statusCode == 999
+    }
+}
+
+struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct CreatedResponseBody: JSONDecodable {
+            ...
+        }
+
+        @ResponseBody<CreatedResponseBody>.Status201 var createdBody: CreatedResponseBody
+
+        struct CustomResponseBody: JSONDecodable {
+            ...
+        }
+
+        @ResponseBodyWrapper<CustomResponseBody, CustomBodyDecodingStrategy> var customBody
+    }
+}
+
+ +

Note: Due to technical limitations of the Codable protocol in Swift, it is currently not possible to have a non-static/dynamic decoding strategy.

+

Response headers

+ +

Use the property wrapper @ResponseHeader<Strategy> inside the response type.

+ +

In the moment, the following decoding strategies are implemented:

+ + + +

Converts the property name into camel-case format (e.g. Content-Type becomes contentType) and compares case-insensitive (e.g. Authorization equals authorization) +This strategy expects the response header to be set, otherwise an error will be thrown.

+ +

Response from URL requests are always of type String and no casting will be performed. Therefore the only valid property type is String.

+ +
    +
  • DefaultHeaderOptionalStrategy
  • +
+ +

Same as DefaultHeaderStrategy but won’t fail if the header can not be found.

+ +

Example:

+
struct Response: Decodable {
+
+    @ResponseHeader<DefaultHeaderStrategy>
+    var authorization: String
+
+    @ResponseHeader<DefaultHeaderStrategy>
+    var contentType: String
+
+    @ResponseHeader<DefaultHeaderStrategyOptional>
+    var optionalValue: String?
+
+}
+
+

Response Status

+ +

The default HTTP method is GET, but it can be overwritten by adding an instance property with the property wrapper @RequestHTTPMethod:

+ +

Example:

+
struct Response: Decodable {
+
+    @ResponseStatusCode var statusCode
+
+}
+
+ +

Note:

+ +

Multiple properties can be declared with this property wrapper. All of them will have the value set.

+

Nested Responses

+ +

To support inheritance, which can be especially useful for pagination, use the property wrapper @NestedResponse to add nested responses.

+ +

While decoding the flat HTTP response will be applied recursively to all nested responses, therefore it is possible, that different nested responses access different values of the original HTTP response.

+ +

Example:

+
struct PaginatedResponse<NestedRequest: Request>: Decodable {
+
+    /// Header which indicates how many more elements are available
+    @ResponseHeader<DefaultHeaderStrategy> var totalElements
+
+    @NestedResponse var nested: NestedRequest
+}
+
+struct ListRequest: Request {
+
+    typealias Response = PaginatedResponse<ListResponse>
+
+    struct ListResponse: Decodable {
+        // see other examples
+    }
+}
+
+

HTTP API Client

+ +

The easiest way of sending Postie requests, is using the HTTPAPIClient which takes care of encoding requests, and decoding responses.

+ +

All it takes to create a client, is the URL which is used as a base for all requests. Afterwards you can just send the requests, either using Async-Await, Combine publishers, or classic callbacks.

+ +

Additionally the HTTPAPIClient provides the option of setting a session provider, which encapsulates the default URLSession by a protocol. +This allows to create networking clients which can be mocked (perfect for unit testing).

+

Async Await

+ +

Example:

+
let url: URL = ...
+let client = HTTPAPIClient(baseURL: url)
+
+// ... create request ...
+
+try {
+    let response = try await client.send(request)
+    // process response
+    print(response)
+} catch {
+    // handle error
+}
+
+

Combine

+ +

Example:

+
let url: URL = ...
+let client = HTTPAPIClient(baseURL: url)
+
+// ... create request ...
+
+client.send(request)
+    .sink(receiveCompletion: { completion in
+        switch completion {
+        case .failure(let error):
+            // handle error
+            break
+        case .finished:
+            break
+        }
+    }, receiveValue: { response in
+        // process response
+        print(response)
+    })
+    .store(in: &cancellables)
+
+

Callback

+ +

Example:

+
let url: URL = ...
+let client = HTTPAPIClient(baseURL: url)
+
+// ... create request ...
+
+client.send(request) { result in
+    switch result {
+    case .failure(let error):
+        // handle error
+        break
+    case .finished(let response):
+        // process response
+        break
+    }
+}
+
+

Cookies

+ +

By default the cookies of requests and responses are handled by the session used by the HTTPAPIClient. If you want to explicitly set the request cookies, use RequestCookies, and to access the response cookies use ResponseCookies.

+ +

Example:

+
struct MyRequest: Request {
+    struct Response: Decodable {
+        // List of HTTPCookie parsed from the `Set-Cookie` headers of the response
+        @ResponseCookies var cookies
+    }
+
+    // List of HTTPCookie to be set in the request as `Cookie` headers
+    @RequestCookies var cookies
+}
+
+

Encoding & Decoding

+ +

The RequestEncoder is responsible to turn an encodable Request into an URLRequest. It requires an URL in the initializer, as Postie requests are relative requests.

+ +

Example:

+
// A request as explained above
+let request: Request = ...
+
+// Create a request encoder
+let url = URL(string: "http://techprimate.com")
+let encoder = RequestEncoder(baseURL: url)
+
+// Encode request
+let urlRequest: URLRequest
+do {
+    let urlRequest = try encoder.encode(request)
+    // continue with url request
+    ...
+} catch {
+    // Handle error
+    ...
+}
+
+ +

As its contrarity component, the RequestDecoder is responsible to turn a tuple of (data: Data, response: HTTPURLResponse) into a given type Response.

+ +

Example:

+
// Data received from the URL session task
+let response: HTTPURLResponse = ...
+let data: Data = ...
+
+// Create decoder
+let decoder = ResponseDecoder()
+do {
+    let decoded = try decoder.decode(Response.self, from: (data, response)))
+    // continue with decoded response
+    ...
+} catch{
+    // Handle error
+    ...
+}
+
+

Combine Support

+ +

RequestEncoder conforms to TopLevelEncoder and RequestDecoder conforms to TopLevelDecoder. +This means both encoders can be used in a Combine pipeline.

+ +

Example:

+
let request = Request()
+let session = URLSession.shared
+
+let url = URL(string: "https://techprimate.com")!
+let encodedRequest = try RequestEncoder(baseURL: url).encode(request)
+
+// Send request using the given URL session provider
+return session
+    .dataTaskPublisher(for: encodedRequest)
+    .tryMap { (data: Data, response: URLResponse) in
+        guard let response = response as? HTTPURLResponse else {
+            fatalError("handle non HTTP url responses")
+        }
+        return (data: data, response: response)
+    }
+    .decode(type: Request.Response.self, decoder: ResponseDecoder())
+    .sink(receiveCompletion: { result in
+        // handle result
+    }, receiveValue: { decoded in
+        // do something with decoded response
+    })
+
+

Articles & Stories

+ +

Here is a list of relevant articles and stories regarding Postie 🥳

+ +

(Please let us know if you found more.)

+ + + +
+
+ + +
+
+ + + diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jazzy.js b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jazzy.js new file mode 100755 index 0000000..1ac8699 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jazzy.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targeted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jazzy.search.js b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jazzy.search.js new file mode 100644 index 0000000..359cdbb --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jazzy.search.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +$(function(){ + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
'; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
'; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + const searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + this.field('abstract'); + for (const [url, doc] of Object.entries(searchData)) { + this.add({url: url, name: doc.name, abstract: doc.abstract}); + } + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3, + autoselect: true + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + const lcSearch = query.toLowerCase(); + const results = searchIndex.query(function(q) { + q.term(lcSearch, { boost: 100 }); + q.term(lcSearch, { + boost: 10, + wildcard: lunr.Query.wildcard.TRAILING + }); + }).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jquery.min.js b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jquery.min.js new file mode 100644 index 0000000..7f37b5d --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/js/typeahead.jquery.js b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/typeahead.jquery.js new file mode 100644 index 0000000..bcb734b --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/js/typeahead.jquery.js @@ -0,0 +1,1695 @@ +/*! + * typeahead.js 1.3.3 + * https://github.com/corejavascript/typeahead.js + * Copyright 2013-2024 Twitter, Inc. and other contributors; Licensed MIT + */ + + +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([ "jquery" ], function(a0) { + return factory(a0); + }); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +})(this, function($) { + var _ = function() { + "use strict"; + return { + isMsie: function() { + return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; + }, + isBlankString: function(str) { + return !str || /^\s*$/.test(str); + }, + escapeRegExChars: function(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, + isString: function(obj) { + return typeof obj === "string"; + }, + isNumber: function(obj) { + return typeof obj === "number"; + }, + isArray: $.isArray, + isFunction: $.isFunction, + isObject: $.isPlainObject, + isUndefined: function(obj) { + return typeof obj === "undefined"; + }, + isElement: function(obj) { + return !!(obj && obj.nodeType === 1); + }, + isJQuery: function(obj) { + return obj instanceof $; + }, + toStr: function toStr(s) { + return _.isUndefined(s) || s === null ? "" : s + ""; + }, + bind: $.proxy, + each: function(collection, cb) { + $.each(collection, reverseArgs); + function reverseArgs(index, value) { + return cb(value, index); + } + }, + map: $.map, + filter: $.grep, + every: function(obj, test) { + var result = true; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (!(result = test.call(null, val, key, obj))) { + return false; + } + }); + return !!result; + }, + some: function(obj, test) { + var result = false; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (result = test.call(null, val, key, obj)) { + return false; + } + }); + return !!result; + }, + mixin: $.extend, + identity: function(x) { + return x; + }, + clone: function(obj) { + return $.extend(true, {}, obj); + }, + getIdGenerator: function() { + var counter = 0; + return function() { + return counter++; + }; + }, + templatify: function templatify(obj) { + return $.isFunction(obj) ? obj : template; + function template() { + return String(obj); + } + }, + defer: function(fn) { + setTimeout(fn, 0); + }, + debounce: function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments, later, callNow; + later = function() { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + } + }; + callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + } + return result; + }; + }, + throttle: function(func, wait) { + var context, args, timeout, result, previous, later; + previous = 0; + later = function() { + previous = new Date(); + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date(), remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }, + stringify: function(val) { + return _.isString(val) ? val : JSON.stringify(val); + }, + guid: function() { + function _p8(s) { + var p = (Math.random().toString(16) + "000000000").substr(2, 8); + return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; + } + return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); + }, + noop: function() {} + }; + }(); + var WWW = function() { + "use strict"; + var defaultClassNames = { + wrapper: "twitter-typeahead", + input: "tt-input", + hint: "tt-hint", + menu: "tt-menu", + dataset: "tt-dataset", + suggestion: "tt-suggestion", + selectable: "tt-selectable", + empty: "tt-empty", + open: "tt-open", + cursor: "tt-cursor", + highlight: "tt-highlight" + }; + return build; + function build(o) { + var www, classes; + classes = _.mixin({}, defaultClassNames, o); + www = { + css: buildCss(), + classes: classes, + html: buildHtml(classes), + selectors: buildSelectors(classes) + }; + return { + css: www.css, + html: www.html, + classes: www.classes, + selectors: www.selectors, + mixin: function(o) { + _.mixin(o, www); + } + }; + } + function buildHtml(c) { + return { + wrapper: '', + menu: '
' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e = $.Event(namespace + type); + this.$el.trigger.call(this.$el, $e, args || []); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false, + diacriticInsensitive: false + }; + var accented = { + A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", + B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", + C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", + D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", + E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", + F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", + G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", + H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", + I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", + J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", + K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", + L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", + M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", + N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", + O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", + P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", + Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", + R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", + S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", + T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", + U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", + V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", + W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", + X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", + Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", + Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function accent_replacer(chr) { + return accented[chr.toUpperCase()] || chr; + } + function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + var escapedWord = _.escapeRegExChars(patterns[i]); + if (diacriticInsensitive) { + escapedWord = escapedWord.replace(/\S/g, accent_replacer); + } + escapedPatterns.push(escapedWord); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + var id; + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.$menu = $(o.menu); + id = this.$input.attr("id") || _.guid(); + this.$menu.attr("id", id + "_listbox"); + this.$hint.attr({ + "aria-hidden": true + }); + this.$input.attr({ + "aria-owns": id + "_listbox", + "aria-controls": id + "_listbox", + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": false + }); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + this.onSync("cursorchange", this._updateDescendent); + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + _updateDescendent: function updateDescendent(event, id) { + this.$input.attr("aria-activedescendant", id); + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
"); + }, + setAriaExpanded: function setAriaExpanded(value) { + this.$input.attr("aria-expanded", value); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + dataset: "tt-selectable-dataset", + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = _.toStr(o.name || nameGenerator()); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + dataset: $el.data(keys.dataset) || "", + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", suggestions, false, this.name); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", suggestions, true, this.name); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query, that.name); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query, that.name); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + var idx = Math.abs(rendered - that.limit); + rendered += idx; + that._append(query, suggestions.slice(0, idx)); + that.async && that.trigger("asyncReceived", query, that.name); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
"); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate + }; + function userSuggestionTemplate(context) { + var template = templates.suggestion; + return $(template(context)).attr("id", _.guid()); + } + function suggestionTemplate(context) { + return $('
').attr("id", _.guid()).text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { + var isEmpty = dataset.isEmpty(); + this.$node.attr("aria-expanded", !isEmpty); + return isEmpty; + }, this)); + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + this.$node.on("mouseover", this.selectors.selectable, function() { + that.setCursor($(this)); + }); + this.$node.on("mouseleave", function() { + that._removeCursor(); + }); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.scrollTop(0); + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.attr("aria-expanded", false); + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
"); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var Status = function() { + "use strict"; + function Status(options) { + this.$el = $("", { + role: "status", + "aria-live": "polite" + }).css({ + position: "absolute", + padding: "0", + border: "0", + height: "1px", + width: "1px", + "margin-bottom": "-1px", + "margin-right": "-1px", + overflow: "hidden", + clip: "rect(0 0 0 0)", + "white-space": "nowrap" + }); + options.$input.after(this.$el); + _.each(options.menu.datasets, _.bind(function(dataset) { + if (dataset.onSync) { + dataset.onSync("rendered", _.bind(this.update, this)); + dataset.onSync("cleared", _.bind(this.cleared, this)); + } + }, this)); + } + _.mixin(Status.prototype, { + update: function update(event, suggestions) { + var length = suggestions.length; + var words; + if (length === 1) { + words = { + result: "result", + is: "is" + }; + } else { + words = { + result: "results", + is: "are" + }; + } + this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); + }, + cleared: function() { + this.$el.text(""); + } + }); + return Status; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.autoselect = !!o.autoselect; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
"); + $menu = this.menu.$node || $("
"); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { + this._updateHint(); + if (this.autoselect) { + var cursorClass = this.selectors.cursor.substr(1); + this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); + } + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + if (this.select($selectable)) { + $e.preventDefault(); + $e.stopPropagation(); + } + } else if (this.autoselect) { + if (this.select(this.menu.getTopSelectable())) { + $e.preventDefault(); + $e.stopPropagation(); + } + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if (this.autoselect) { + if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.input.setAriaExpanded(true); + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.input.setAriaExpanded(false); + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj, data.dataset)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj, data.dataset); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj, data.dataset); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, suggestion, datasetName, cancelMove, id; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + suggestion = data ? data.obj : null; + datasetName = data ? data.dataset : null; + id = $candidate ? $candidate.attr("id") : null; + this.input.trigger("cursorchange", id); + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { + this.menu.setCursor($candidate); + if (data) { + if (typeof data.val === "string") { + this.input.setInputValue(data.val); + } + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", suggestion, datasetName); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input, + menu: $menu + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + status = new Status({ + $input: $input, + menu: menu + }); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength, + autoselect: o.autoselect + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(_.toStr(newVal)); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ + readonly: true, + required: false + }).removeAttr("id name placeholder").removeClass("required").attr({ + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/search.json b/docs/docsets/Postie.docset/Contents/Resources/Documents/search.json new file mode 100644 index 0000000..1094662 --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/search.json @@ -0,0 +1 @@ +{"Typealiases/FormURLEncodedDecodable.html":{"name":"FormURLEncodedDecodable","abstract":"

A type that can decode itself from an external form-url encoded representation.

"},"Typealiases/JSONDecodable.html":{"name":"JSONDecodable","abstract":"

A type that can decode itself from an external JSON representation.

"},"Typealiases/PlainDecodable.html":{"name":"PlainDecodable","abstract":"

A type which represents plain text

"},"Typealiases/XMLDecodable.html":{"name":"XMLDecodable","abstract":"

A type that can decode itself from an external JSON representation.

"},"Typealiases/FormURLEncodedEncodable.html":{"name":"FormURLEncodedEncodable","abstract":"

A type that can decode itself from an external form-url encoded representation.

"},"Typealiases/JSONEncodable.html":{"name":"JSONEncodable","abstract":"

A type that should encode itself to a JSON representation.

"},"Typealiases/PlainEncodable.html":{"name":"PlainEncodable","abstract":"

A type that should encode itself to a JSON representation.

"},"Typealiases/XMLEncodable.html":{"name":"XMLEncodable","abstract":"

A type that should encode itself to a JSON representation.

"},"Typealiases/FormURLEncodedRequest.html":{"name":"FormURLEncodedRequest","abstract":"

Protocol indicating a given request should be encoded into a form URL encoded request

"},"Typealiases/JSONRequest.html":{"name":"JSONRequest","abstract":"

Protocol indicating a given request should be encoded into a JSON request

"},"Typealiases/PlainRequest.html":{"name":"PlainRequest","abstract":"

Protocol indicating a given request should be encoded into a JSON request

"},"Typealiases/XMLRequest.html":{"name":"XMLRequest","abstract":"

Protocol indicating a given request should be encoded into an XML request

"},"Typealiases/ResponseBody.html":{"name":"ResponseBody","abstract":"

A type alias for ResponseBodyWrapper with a default body decoding strategy.

"},"Typealiases/ResponseErrorBody.html":{"name":"ResponseErrorBody","abstract":"

A type alias for ResponseErrorBodyWrapper with a default error body decoding strategy.

"},"Structs/DefaultHeaderStrategyOptional.html#/s:6Postie29DefaultHeaderStrategyOptionalV6decode7decoderxSgs7Decoder_p_tKFZ":{"name":"decode(decoder:)","abstract":"

Decodes the response header value from the given decoder.

","parent_name":"DefaultHeaderStrategyOptional"},"Structs/DefaultHeaderStrategy.html#/s:6Postie21DefaultHeaderStrategyV6decode7decoderxs7Decoder_p_tKFZ":{"name":"decode(decoder:)","abstract":"

Decodes the response header value from the given decoder.

","parent_name":"DefaultHeaderStrategy"},"Structs/ValidateStatus422ErrorBodyStrategy.html#/s:6Postie34ValidateStatus422ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus422ErrorBodyStrategy"},"Structs/ValidateStatus410ErrorBodyStrategy.html#/s:6Postie34ValidateStatus410ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus410ErrorBodyStrategy"},"Structs/ValidateStatus404ErrorBodyStrategy.html#/s:6Postie34ValidateStatus404ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus404ErrorBodyStrategy"},"Structs/ValidateStatus403ErrorBodyStrategy.html#/s:6Postie34ValidateStatus403ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus403ErrorBodyStrategy"},"Structs/ValidateStatus401ErrorBodyStrategy.html#/s:6Postie34ValidateStatus401ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Checks if the given status code represents an error.

","parent_name":"ValidateStatus401ErrorBodyStrategy"},"Structs/ValidateStatus400ErrorBodyStrategy.html#/s:6Postie34ValidateStatus400ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Checks if the given status code represents an error.

","parent_name":"ValidateStatus400ErrorBodyStrategy"},"Structs/ValidateStatus303BodyStrategy.html#/s:6Postie29ValidateStatus303BodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether empty content is allowed for the given status code.

","parent_name":"ValidateStatus303BodyStrategy"},"Structs/ValidateStatus303BodyStrategy.html#/s:6Postie29ValidateStatus303BodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is 303 (See Other).

","parent_name":"ValidateStatus303BodyStrategy"},"Structs/ValidateStatus201BodyStrategy.html#/s:6Postie29ValidateStatus201BodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether empty content is allowed for the given status code.

","parent_name":"ValidateStatus201BodyStrategy"},"Structs/ValidateStatus201BodyStrategy.html#/s:6Postie29ValidateStatus201BodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is 201 (Created).

","parent_name":"ValidateStatus201BodyStrategy"},"Structs/ValidateStatus200BodyStrategy.html#/s:6Postie29ValidateStatus200BodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether empty content is allowed for the given status code.

","parent_name":"ValidateStatus200BodyStrategy"},"Structs/ValidateStatus200BodyStrategy.html#/s:6Postie29ValidateStatus200BodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is 200 (OK).

","parent_name":"ValidateStatus200BodyStrategy"},"Structs/OptionalContentStrategy.html#/s:6Postie23OptionalContentStrategyV011allowsEmptyC03forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Determines whether the decoding should fail when no content is returned.

","parent_name":"OptionalContentStrategy"},"Structs/OptionalContentStrategy.html#/s:6Postie23OptionalContentStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is within the acceptable range.

","parent_name":"OptionalContentStrategy"},"Structs/DefaultErrorBodyStrategy.html#/s:6Postie24DefaultErrorBodyStrategyV02isC010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"DefaultErrorBodyStrategy"},"Structs/DefaultBodyStrategy.html#/s:6Postie19DefaultBodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Determines whether the decoding should fail when no content is returned.

","parent_name":"DefaultBodyStrategy"},"Structs/DefaultBodyStrategy.html#/s:6Postie19DefaultBodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is within the acceptable range.

","parent_name":"DefaultBodyStrategy"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeV12wrappedValues6UInt16Vvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the status code.

","parent_name":"ResponseStatusCode"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeV14projectedValueAA010HTTPStatusD0OSgvp":{"name":"projectedValue","abstract":"

The projected value representing the HTTP status code.

","parent_name":"ResponseStatusCode"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeVACycfc":{"name":"init()","abstract":"

Initializes a new instance of ResponseStatusCode with the default value of 0.

","parent_name":"ResponseStatusCode"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeV12wrappedValueACs6UInt16V_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseStatusCode with the specified wrapped value.

","parent_name":"ResponseStatusCode"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperV12wrappedValuexSgvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the decoded error response body.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperVACyxq_Gycfc":{"name":"init()","abstract":"

Initializes a new instance of ResponseErrorBodyWrapper with a nil value.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperV12wrappedValueACyxq_GxSg_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseErrorBodyWrapper with the specified wrapped value.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperV4fromACyxq_Gs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseErrorBodyWrapper from a decoder.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperV12wrappedValuexSgvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the decoded response body.

","parent_name":"ResponseBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperVACyxq_Gycfc":{"name":"init()","abstract":"

Initializes a new instance of ResponseBodyWrapper with a nil value.

","parent_name":"ResponseBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperV12wrappedValueACyxq_GxSg_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseBodyWrapper with the specified wrapped value.

","parent_name":"ResponseBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperV4fromACyxq_Gs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseBodyWrapper from a decoder.

","parent_name":"ResponseBodyWrapper"},"Structs/NestedResponse.html#/s:6Postie14NestedResponseV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the nested response.

","parent_name":"NestedResponse"},"Structs/NestedResponse.html#/s:6Postie14NestedResponseV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of NestedResponse with the specified wrapped value.

","parent_name":"NestedResponse"},"Structs/NestedResponse.html#/s:6Postie14NestedResponseV4fromACyxGs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of NestedResponse by decoding from the given decoder.

","parent_name":"NestedResponse"},"Structs/QueryItem.html#/s:6Postie9QueryItemV4nameSSSgvp":{"name":"name","abstract":"

The custom name of the query item, can be nil.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the query item value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of QueryItem with the specified wrapped value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemV4name12defaultValueACyxGSSSg_xtcfc":{"name":"init(name:defaultValue:)","abstract":"

Initializes a new instance of QueryItem with the specified name and default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASbRszrlE4nameACySbGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a default value of false.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASbSgRszrlE4nameACyADGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASdRszrlE4nameACySdGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a default value of 0.0.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASdSgRszrlE4nameACyADGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASiSgRszrlE4nameACyADGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASSRszrlE4nameACySSGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and an empty string as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASSSgRszrlE4nameACyADGAD_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVA2A12OptionalTypeRzSY7WrappedAaDPRpzrlE4nameACyxGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/RequestURL.html#/s:6Postie10RequestURLV12wrappedValue10Foundation0C0VSgvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the request URL.

","parent_name":"RequestURL"},"Structs/RequestURL.html#/s:6Postie10RequestURLV12wrappedValueAC10Foundation0C0VSg_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestURL with the specified wrapped value.

","parent_name":"RequestURL"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV4nameSSSgvp":{"name":"name","abstract":"

The custom name of the path parameter, can be nil.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the path parameter value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified wrapped value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV4name12defaultValueACyxGSSSg_xtcfc":{"name":"init(name:defaultValue:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and default value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV03getD4TypeypXpyFZ":{"name":"getParameterType()","abstract":"

Returns the type of the path parameter.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAASSRszrlE4nameACySSGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and an empty string as the default value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAASiRszrlE4nameACySiGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAAs5Int16VRszrlE4nameACyAEGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAAs5Int32VRszrlE4nameACyAEGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAAs5Int64VRszrlE4nameACyAEGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:s23ExpressibleByNilLiteralP03nilD0xyt_tcfc":{"name":"init(nilLiteral:)","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html":{"name":"ExtendedGraphemeClusterLiteralType","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter/UnicodeScalarLiteralType.html":{"name":"UnicodeScalarLiteralType","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter/StringLiteralType.html":{"name":"StringLiteralType","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:s26ExpressibleByStringLiteralP06stringD0x0cD4TypeQz_tcfc":{"name":"init(stringLiteral:)","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:s27ExpressibleByIntegerLiteralP07integerD0x0cD4TypeQz_tcfc":{"name":"init(integerLiteral:)","parent_name":"RequestPathParameter"},"Structs/RequestPath.html#/s:6Postie11RequestPathV12wrappedValueSSvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the request path.

","parent_name":"RequestPath"},"Structs/RequestPath.html#/s:6Postie11RequestPathV12wrappedValueACSS_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestPath with the specified wrapped value.

","parent_name":"RequestPath"},"Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html":{"name":"ExtendedGraphemeClusterLiteralType","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/RequestPath/UnicodeScalarLiteralType.html":{"name":"UnicodeScalarLiteralType","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/RequestPath/StringLiteralType.html":{"name":"StringLiteralType","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/RequestPath.html#/s:6Postie11RequestPathV13stringLiteralACSS_tcfc":{"name":"init(stringLiteral:)","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/ResponseHeader.html#/s:6Postie14ResponseHeaderV12wrappedValue03RawE0Qzvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the decoded header value.

","parent_name":"ResponseHeader"},"Structs/ResponseHeader.html#/s:6Postie14ResponseHeaderV12wrappedValueACyxG03RawE0Qz_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseHeader with the specified wrapped value.

","parent_name":"ResponseHeader"},"Structs/ResponseHeader.html#/s:6Postie14ResponseHeaderV4fromACyxGs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseHeader by decoding from the given decoder.

","parent_name":"ResponseHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV4nameSSSgvp":{"name":"name","abstract":"

The custom name of the header item, can be nil.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the header value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestHeader with the specified wrapped value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV4name12defaultValueACyxGSSSg_xtcfc":{"name":"init(name:defaultValue:)","abstract":"

Initializes a new instance of RequestHeader with the specified name and default value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderVAASSRszrlE4nameACySSGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestHeader with the specified name and an empty string as the default value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderVAASSSgRszrlE4nameACyADGAD_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestHeader with the specified name and a nil value as the default value.

","parent_name":"RequestHeader"},"Structs/RequestHTTPMethod.html#/s:6Postie17RequestHTTPMethodV12wrappedValueAA0C0Ovp":{"name":"wrappedValue","abstract":"

The wrapped value representing the HTTP method.

","parent_name":"RequestHTTPMethod"},"Structs/RequestHTTPMethod.html#/s:6Postie17RequestHTTPMethodV12wrappedValueAcA0C0O_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestHTTPMethod with the specified wrapped value.

","parent_name":"RequestHTTPMethod"},"Structs/ResponseCookies.html#/s:6Postie15ResponseCookiesV12wrappedValueSaySo12NSHTTPCookieCGvp":{"name":"wrappedValue","abstract":"

The wrapped value representing an array of HTTPCookie objects.

","parent_name":"ResponseCookies"},"Structs/ResponseCookies.html#/s:6Postie15ResponseCookiesV12wrappedValueACSaySo12NSHTTPCookieCG_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseCookies with an optional array of HTTPCookie objects.

","parent_name":"ResponseCookies"},"Structs/ResponseCookies.html#/s:6Postie15ResponseCookiesV4fromACs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseCookies by decoding from the given decoder.

","parent_name":"ResponseCookies"},"Structs/RequestCookies.html#/s:6Postie14RequestCookiesV12wrappedValueSaySo12NSHTTPCookieCGvp":{"name":"wrappedValue","abstract":"

The wrapped value representing an array of HTTPCookie objects.

","parent_name":"RequestCookies"},"Structs/RequestCookies.html#/s:6Postie14RequestCookiesV12wrappedValueACSaySo12NSHTTPCookieCG_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestCookies with an optional array of HTTPCookie objects.

","parent_name":"RequestCookies"},"Structs/RequestCookies.html#/s:6Postie14RequestCookiesV6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","abstract":"

Encodes this value into the given encoder.

","parent_name":"RequestCookies"},"Structs/RequestCachePolicy.html#/s:6Postie18RequestCachePolicyV12wrappedValueSo012NSURLRequestcD0Vvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the cache policy.

","parent_name":"RequestCachePolicy"},"Structs/RequestCachePolicy.html#/s:6Postie18RequestCachePolicyV12wrappedValueACSo012NSURLRequestcD0V_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestCachePolicy with the specified wrapped value.

","parent_name":"RequestCachePolicy"},"Structs/RequestCachePolicy.html#/s:6Postie18RequestCachePolicyV6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","abstract":"

Encodes this value into the given encoder.

","parent_name":"RequestCachePolicy"},"Structs/RequestCachePolicy.html":{"name":"RequestCachePolicy","abstract":"

A property wrapper that provides a convenient way to handle request cache policies.

"},"Structs/RequestCookies.html":{"name":"RequestCookies","abstract":"

A property wrapper that provides a convenient way to handle HTTP cookies in a request.

"},"Structs/ResponseCookies.html":{"name":"ResponseCookies","abstract":"

A property wrapper that provides a convenient way to handle HTTP cookies in a response.

"},"Structs/RequestHTTPMethod.html":{"name":"RequestHTTPMethod","abstract":"

A property wrapper for the HTTP method of a request.

"},"Structs/RequestHeader.html":{"name":"RequestHeader","abstract":"

A property wrapper that provides a convenient way to handle HTTP headers in a request.

"},"Structs/ResponseHeader.html":{"name":"ResponseHeader","abstract":"

A property wrapper that provides a convenient way to handle HTTP headers in a response.

"},"Structs/RequestPath.html":{"name":"RequestPath","abstract":"

A property wrapper that provides a convenient way to handle request paths.

"},"Structs/RequestPathParameter.html":{"name":"RequestPathParameter","abstract":"

A property wrapper that provides a convenient way to handle path parameters in a request.

"},"Structs/RequestURL.html":{"name":"RequestURL","abstract":"

A property wrapper that provides a convenient way to handle request URLs.

"},"Structs/QueryItem.html":{"name":"QueryItem","abstract":"

A property wrapper that provides a convenient way to handle query items in a request.

"},"Structs/EmptyResponse.html":{"name":"EmptyResponse","abstract":"

A struct representing an empty response.

"},"Structs/NestedResponse.html":{"name":"NestedResponse","abstract":"

A property wrapper that wraps a nested response.

"},"Structs/ResponseBodyWrapper.html":{"name":"ResponseBodyWrapper","abstract":"

A property wrapper that wraps a response body.

"},"Structs/ResponseErrorBodyWrapper.html":{"name":"ResponseErrorBodyWrapper","abstract":"

A property wrapper that wraps an error response body.

"},"Structs/ResponseStatusCode.html":{"name":"ResponseStatusCode","abstract":"

A property wrapper that provides a convenient way to handle response status codes.

"},"Structs/DefaultBodyStrategy.html":{"name":"DefaultBodyStrategy","abstract":"

A default strategy for validating response bodies.

"},"Structs/DefaultErrorBodyStrategy.html":{"name":"DefaultErrorBodyStrategy","abstract":"

A default strategy for validating error response bodies.

"},"Structs/OptionalContentStrategy.html":{"name":"OptionalContentStrategy","abstract":"

A strategy for validating response bodies with status code 204.

"},"Structs/ValidateStatus200BodyStrategy.html":{"name":"ValidateStatus200BodyStrategy","abstract":"

A strategy for validating response bodies with status code 200.

"},"Structs/ValidateStatus201BodyStrategy.html":{"name":"ValidateStatus201BodyStrategy","abstract":"

A strategy for validating response bodies with status code 201.

"},"Structs/ValidateStatus303BodyStrategy.html":{"name":"ValidateStatus303BodyStrategy","abstract":"

A strategy for validating response bodies with status code 303.

"},"Structs/ValidateStatus400ErrorBodyStrategy.html":{"name":"ValidateStatus400ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 400.

"},"Structs/ValidateStatus401ErrorBodyStrategy.html":{"name":"ValidateStatus401ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 401.

"},"Structs/ValidateStatus403ErrorBodyStrategy.html":{"name":"ValidateStatus403ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 403.

"},"Structs/ValidateStatus404ErrorBodyStrategy.html":{"name":"ValidateStatus404ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 404.

"},"Structs/ValidateStatus410ErrorBodyStrategy.html":{"name":"ValidateStatus410ErrorBodyStrategy","abstract":"

A strategy for validating the body of a response with a status code of 410.

"},"Structs/ValidateStatus422ErrorBodyStrategy.html":{"name":"ValidateStatus422ErrorBodyStrategy","abstract":"

A strategy for validating the body of a response with a status code of 422.

"},"Structs/DefaultHeaderStrategy.html":{"name":"DefaultHeaderStrategy","abstract":"

A default strategy for decoding response headers.

"},"Structs/DefaultHeaderStrategyOptional.html":{"name":"DefaultHeaderStrategyOptional","abstract":"

A default strategy for decoding optional response headers.

"},"Protocols/ResponseHeaderDecodingStrategy.html#/s:6Postie30ResponseHeaderDecodingStrategyP8RawValueQa":{"name":"RawValue","abstract":"

The type of the raw value that will be decoded from the response header.

","parent_name":"ResponseHeaderDecodingStrategy"},"Protocols/ResponseHeaderDecodingStrategy.html#/s:6Postie30ResponseHeaderDecodingStrategyP6decode7decoder8RawValueQzs7Decoder_p_tKFZ":{"name":"decode(decoder:)","abstract":"

Decodes the raw value from the given decoder.

","parent_name":"ResponseHeaderDecodingStrategy"},"Protocols/ResponseErrorBodyDecodingStrategy.html#/s:6Postie33ResponseErrorBodyDecodingStrategyP02isC010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Using the validate(statusCode:) method, you can define HTTP code(s) that should handled as an error.

","parent_name":"ResponseErrorBodyDecodingStrategy"},"Protocols/ResponseBodyDecodingStrategy.html#/s:6Postie28ResponseBodyDecodingStrategyP18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether the decoding should fail when no content is returned or not.

","parent_name":"ResponseBodyDecodingStrategy"},"Protocols/ResponseBodyDecodingStrategy.html#/s:6Postie28ResponseBodyDecodingStrategyP8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is within the acceptable range.

","parent_name":"ResponseBodyDecodingStrategy"},"Protocols/Request.html#/s:6Postie7RequestP8ResponseQa":{"name":"Response","abstract":"

The associated type representing the response type for the request.

","parent_name":"Request"},"Protocols/QueryItemValue.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","abstract":"

The serialized value of the query item.

","parent_name":"QueryItemValue"},"Protocols/QueryItemValue.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","abstract":"

Indicates whether the query item is a collection.

","parent_name":"QueryItemValue"},"Protocols/QueryItemValue.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","abstract":"

Iterates over the elements of the collection.

","parent_name":"QueryItemValue"},"Protocols/OptionalType.html#/s:6Postie12OptionalTypeP7WrappedQa":{"name":"Wrapped","abstract":"

The type of the wrapped value.

","parent_name":"OptionalType"},"Protocols/OptionalType.html#/s:6Postie12OptionalTypeP4nonexvpZ":{"name":"none","abstract":"

The nil value of the optional type.

","parent_name":"OptionalType"},"Protocols/RequestPathParameterValue.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","abstract":"

The serialized value of the path parameter.

","parent_name":"RequestPathParameterValue"},"Protocols/URLSessionProvider.html#/s:6Postie18URLSessionProviderP4send10urlRequest7Combine12AnyPublisherVy10Foundation4DataV4data_So13NSURLResponseC8responsetAI8URLErrorVGAI10URLRequestV_tF":{"name":"send(urlRequest:)","abstract":"

Sends a URL request using Combine and returns a publisher that emits the response.

","parent_name":"URLSessionProvider"},"Protocols/URLSessionProvider.html#/s:6Postie18URLSessionProviderP4send10urlRequest10completiony10Foundation10URLRequestV_yAG4DataVSg_So13NSURLResponseCSgs5Error_pSgtctF":{"name":"send(urlRequest:completion:)","abstract":"

Sends a URL request using a callback to handle the response.

","parent_name":"URLSessionProvider"},"Protocols/URLSessionProvider.html#/s:6Postie18URLSessionProviderP4send10urlRequest10Foundation4DataV_So13NSURLResponseCtAF10URLRequestV_tYaKF":{"name":"send(urlRequest:)","abstract":"

Sends a URL request using async-await and returns the response.

","parent_name":"URLSessionProvider"},"Protocols/RequestHeaderValue.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","abstract":"

The serialized value of the header.

","parent_name":"RequestHeaderValue"},"Protocols/XMLFormatProvider.html#/s:6Postie17XMLFormatProviderP6formatAA13APIDataFormatOvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .xml

","parent_name":"XMLFormatProvider"},"Protocols/PlainFormatProvider.html#/s:6Postie19PlainFormatProviderP6formatAA07APIDataC0OvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .plain

","parent_name":"PlainFormatProvider"},"Protocols/JSONFormatProvider.html#/s:6Postie18JSONFormatProviderP6formatAA13APIDataFormatOvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .json

","parent_name":"JSONFormatProvider"},"Protocols/FormURLEncodedFormatProvider.html#/s:6Postie28FormURLEncodedFormatProviderP6formatAA07APIDataD0OvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .formURLEncoded

","parent_name":"FormURLEncodedFormatProvider"},"Protocols/XMLBodyProvider.html#/s:6Postie15XMLBodyProviderP4BodyQa":{"name":"Body","abstract":"

The associated type representing the body of the XML data.

","parent_name":"XMLBodyProvider"},"Protocols/XMLBodyProvider.html#/s:6Postie15XMLBodyProviderP4body4BodyQzvp":{"name":"body","abstract":"

The body of the XML data.

","parent_name":"XMLBodyProvider"},"Protocols/PlainBodyProvider.html#/s:6Postie17PlainBodyProviderP4bodySSvp":{"name":"body","abstract":"

The body of the plain text data.

","parent_name":"PlainBodyProvider"},"Protocols/PlainBodyProvider.html#/s:6Postie17PlainBodyProviderP8encodingSS10FoundationE8EncodingVvp":{"name":"encoding","abstract":"

The encoding used for the plain text data.

","parent_name":"PlainBodyProvider"},"Protocols/JSONBodyProvider.html#/s:6Postie16JSONBodyProviderP4BodyQa":{"name":"Body","abstract":"

The type of the body to be encoded.

","parent_name":"JSONBodyProvider"},"Protocols/JSONBodyProvider.html#/s:6Postie16JSONBodyProviderP19keyEncodingStrategy10Foundation11JSONEncoderC03KeyeF0Ovp":{"name":"keyEncodingStrategy","abstract":"

The key encoding strategy to use for JSON encoding.

","parent_name":"JSONBodyProvider"},"Protocols/JSONBodyProvider.html#/s:6Postie16JSONBodyProviderP4body4BodyQzvp":{"name":"body","abstract":"

The body to be encoded.

","parent_name":"JSONBodyProvider"},"Protocols/FormURLEncodedBodyProvider.html#/s:6Postie26FormURLEncodedBodyProviderP0D0Qa":{"name":"Body","abstract":"

The associated type representing the body of the form URL encoded data.

","parent_name":"FormURLEncodedBodyProvider"},"Protocols/FormURLEncodedBodyProvider.html#/s:6Postie26FormURLEncodedBodyProviderP4body0D0Qzvp":{"name":"body","abstract":"

The body of the form URL encoded data.

","parent_name":"FormURLEncodedBodyProvider"},"Protocols/FormURLEncodedBodyProvider.html":{"name":"FormURLEncodedBodyProvider","abstract":"

A provider for form URL encoded body data.

"},"Protocols/JSONBodyProvider.html":{"name":"JSONBodyProvider","abstract":"

A protocol that provides the body and key encoding strategy for JSON encoding.

"},"Protocols/PlainBodyProvider.html":{"name":"PlainBodyProvider","abstract":"

A provider for plain text body data.

"},"Protocols/XMLBodyProvider.html":{"name":"XMLBodyProvider","abstract":"

A provider for XML body data.

"},"Protocols/FormURLEncodedFormatProvider.html":{"name":"FormURLEncodedFormatProvider","abstract":"

A type that has a default format of form-url-encoding

"},"Protocols/JSONFormatProvider.html":{"name":"JSONFormatProvider","abstract":"

A type that has a default format of form-url-encoding

"},"Protocols/PlainFormatProvider.html":{"name":"PlainFormatProvider","abstract":"

A type that has a default format of plain text

"},"Protocols/XMLFormatProvider.html":{"name":"XMLFormatProvider","abstract":"

A type that has a default format of xml

"},"Protocols/RequestHeaderValue.html":{"name":"RequestHeaderValue","abstract":"

A type that can be used as a value for an HTTP header.

"},"Protocols/URLSessionProvider.html":{"name":"URLSessionProvider","abstract":"

A protocol that provides methods for sending URL requests using different mechanisms.

"},"Protocols/RequestPathParameterValue.html":{"name":"RequestPathParameterValue","abstract":"

A type that can be used as a value for a request path parameter.

"},"Protocols/OptionalType.html":{"name":"OptionalType","abstract":"

A type that can be used as a value for a query item.

"},"Protocols/QueryItemValue.html":{"name":"QueryItemValue","abstract":"

A type that can be used as a value for a query item.

"},"Protocols/Request.html":{"name":"Request","abstract":"

Protocol used to define a response type to a given request type.

"},"Protocols/ResponseBodyDecodingStrategy.html":{"name":"ResponseBodyDecodingStrategy","abstract":"

A protocol for defining strategies for handling response bodies.

"},"Protocols/ResponseErrorBodyDecodingStrategy.html":{"name":"ResponseErrorBodyDecodingStrategy","abstract":"

A protocol for defining strategies for handling error response bodies.

"},"Protocols/ResponseHeaderDecodingStrategy.html":{"name":"ResponseHeaderDecodingStrategy","abstract":"

A protocol for defining strategies for decoding response headers.

"},"Extensions/Range.html#/s:Sn6PostieAA14HTTPStatusCodeORszrlE2teoiySbSnyACG_SitFZ":{"name":"~=(_:_:)","abstract":"

Checks if a value is within a range of HTTP status codes.

","parent_name":"Range"},"Extensions/ResponseErrorBody/Status400.html":{"name":"Status400","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 400.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status401.html":{"name":"Status401","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 401.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status403.html":{"name":"Status403","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 403.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status404.html":{"name":"Status404","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 404.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status410.html":{"name":"Status410","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 410.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status422.html":{"name":"Status422","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 422.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseBody/OptionalContent.html":{"name":"OptionalContent","abstract":"

A type alias for ResponseBodyWrapper with an optional content strategy.

","parent_name":"ResponseBody"},"Extensions/ResponseBody/Status200.html":{"name":"Status200","abstract":"

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 200.

","parent_name":"ResponseBody"},"Extensions/ResponseBody/Status201.html":{"name":"Status201","abstract":"

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 201.

","parent_name":"ResponseBody"},"Extensions/ResponseBody/Status303.html":{"name":"Status303","abstract":"

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 303.

","parent_name":"ResponseBody"},"Extensions/Double.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Double"},"Extensions/Double.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Double"},"Extensions/Double.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Double"},"Extensions/Int64.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int64"},"Extensions/Int32.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int32"},"Extensions/Int16.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int16"},"Extensions/URLSession.html#/s:6Postie18URLSessionProviderP4send10urlRequest7Combine12AnyPublisherVy10Foundation4DataV4data_So13NSURLResponseC8responsetAI8URLErrorVGAI10URLRequestV_tF":{"name":"send(urlRequest:)","parent_name":"URLSession"},"Extensions/URLSession.html#/s:6Postie18URLSessionProviderP4send10urlRequest10completiony10Foundation10URLRequestV_yAG4DataVSg_So13NSURLResponseCSgs5Error_pSgtctF":{"name":"send(urlRequest:completion:)","parent_name":"URLSession"},"Extensions/URLSession.html#/s:6Postie18URLSessionProviderP4send10urlRequest10Foundation4DataV_So13NSURLResponseCtAF10URLRequestV_tYaKF":{"name":"send(urlRequest:)","parent_name":"URLSession"},"Extensions/Bool.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"Bool"},"Extensions/Bool.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Bool"},"Extensions/Bool.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Bool"},"Extensions/Bool.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Bool"},"Extensions/Int.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"Int"},"Extensions/Int.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int"},"Extensions/Int.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Int"},"Extensions/Int.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Int"},"Extensions/Int.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Int"},"Extensions/Optional.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Optional"},"Extensions/String/Encoding.html":{"name":"Encoding","abstract":"

Extension to make String.Encoding conform to Encodable

","parent_name":"String"},"Extensions/String.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"String"},"Extensions/String.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"String"},"Extensions/String.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"String"},"Extensions/String.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"String"},"Extensions/String.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"String"},"Extensions/Set.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Set"},"Extensions/Set.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Set"},"Extensions/Set.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Set"},"Extensions/Array.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Array"},"Extensions/Array.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Array"},"Extensions/Array.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Array"},"Extensions/PlainDecodable.html#/s:6Postie19PlainFormatProviderP6formatAA07APIDataC0OvpZ":{"name":"format","parent_name":"PlainDecodable"},"Extensions/PlainDecodable.html":{"name":"PlainDecodable"},"Extensions/Array.html":{"name":"Array"},"Extensions/Set.html":{"name":"Set"},"Extensions/String.html":{"name":"String"},"Extensions/Optional.html":{"name":"Optional"},"Extensions/Int.html":{"name":"Int"},"Extensions/Bool.html":{"name":"Bool"},"Extensions/URLSession.html":{"name":"URLSession"},"Extensions/Int16.html":{"name":"Int16"},"Extensions/Int32.html":{"name":"Int32"},"Extensions/Int64.html":{"name":"Int64"},"Extensions/Double.html":{"name":"Double"},"Extensions/ResponseBody.html":{"name":"ResponseBody"},"Extensions/ResponseErrorBody.html":{"name":"ResponseErrorBody"},"Extensions/Range.html":{"name":"Range"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8continueyA2CmF":{"name":"continue","abstract":"

The server has received the request headers and the client should proceed to send the request body (in the","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18switchingProtocolsyA2CmF":{"name":"switchingProtocols","abstract":"

The requester has asked the server to switch protocols and the server has agreed to do so.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10processingyA2CmF":{"name":"processing","abstract":"

A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10earlyHintsyA2CmF":{"name":"earlyHints","abstract":"

Used to return some response headers before final HTTP message.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO2okyA2CmF":{"name":"ok","abstract":"

Standard response for successful HTTP requests.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO7createdyA2CmF":{"name":"created","abstract":"

The request has been fulfilled, resulting in the creation of a new resource.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8acceptedyA2CmF":{"name":"accepted","abstract":"

The request has been accepted for processing, but the processing has not been completed.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO27nonAuthoritativeInformationyA2CmF":{"name":"nonAuthoritativeInformation","abstract":"

The server is a transforming proxy (e.g.a Web accelerator) that received a 200 OK from its origin, but is returning a","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO9noContentyA2CmF":{"name":"noContent","abstract":"

The server successfully processed the request, and is not returning any content.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO12resetContentyA2CmF":{"name":"resetContent","abstract":"

The server successfully processed the request, asks that the requester reset its document view, and is not returning any content.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14partialContentyA2CmF":{"name":"partialContent","abstract":"

The server is delivering only part of the resource (byte serving) due to a range header sent by the client.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11multiStatusyA2CmF":{"name":"multiStatus","abstract":"

The message body that follows is by default an XML message and can contain a number of separate response codes,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15alreadyReportedyA2CmF":{"name":"alreadyReported","abstract":"

The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO6IMusedyA2CmF":{"name":"IMused","abstract":"

The server has fulfilled a request for the resource, and the response is a representation of the result of one or more","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15multipleChoicesyA2CmF":{"name":"multipleChoices","abstract":"

Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO16movedPermanentlyyA2CmF":{"name":"movedPermanently","abstract":"

This and all future requests should be directed to the given URI.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO5foundyA2CmF":{"name":"found","abstract":"

Tells the client to look at (browse to) another URL (Previously “Moved temporarily”)

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8seeOtheryA2CmF":{"name":"seeOther","abstract":"

The response to the request can be found under another URI using the GET method.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11notModifiedyA2CmF":{"name":"notModified","abstract":"

Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8useProxyyA2CmF":{"name":"useProxy","abstract":"

The requested resource is available only through a proxy, the address for which is provided in the response.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11switchProxyyA2CmF":{"name":"switchProxy","abstract":"

No longer used.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO17temporaryRedirectyA2CmF":{"name":"temporaryRedirect","abstract":"

In this case, the request should be repeated with another URI; however, future requests should still use the original URI.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO17permanentRedirectyA2CmF":{"name":"permanentRedirect","abstract":"

The request and all future requests should be repeated using another URI.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10badRequestyA2CmF":{"name":"badRequest","abstract":"

The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO12unauthorizedyA2CmF":{"name":"unauthorized","abstract":"

Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15paymentRequiredyA2CmF":{"name":"paymentRequired","abstract":"

Reserved for future use.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO9forbiddenyA2CmF":{"name":"forbidden","abstract":"

The request contained valid data and was understood by the server, but the server is refusing action.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8notFoundyA2CmF":{"name":"notFound","abstract":"

The requested resource could not be found but may be available in the future.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO16methodNotAllowedyA2CmF":{"name":"methodNotAllowed","abstract":"

A request method is not supported for the requested resource

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO13notAcceptableyA2CmF":{"name":"notAcceptable","abstract":"

The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO27proxyAuthenticationRequiredyA2CmF":{"name":"proxyAuthenticationRequired","abstract":"

The client must first authenticate itself with the proxy.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14requestTimeoutyA2CmF":{"name":"requestTimeout","abstract":"

The server timed out waiting for the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8conflictyA2CmF":{"name":"conflict","abstract":"

Indicates that the request could not be processed because of conflict in the current state of the resource,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO4goneyA2CmF":{"name":"gone","abstract":"

Indicates that the resource requested is no longer available and will not be available again.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14lengthRequiredyA2CmF":{"name":"lengthRequired","abstract":"

The request did not specify the length of its content, which is required by the requested resource.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18preconditionFailedyA2CmF":{"name":"preconditionFailed","abstract":"

The server does not meet one of the preconditions that the requester put on the request header fields.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15payloadTooLargeyA2CmF":{"name":"payloadTooLarge","abstract":"

The request is larger than the server is willing or able to process.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10uriTooLongyA2CmF":{"name":"uriTooLong","abstract":"

The URI provided was too long for the server to process.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO20unsupportedMediaTypeyA2CmF":{"name":"unsupportedMediaType","abstract":"

The request entity has a media type which the server or resource does not support.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19rangeNotSatisfiableyA2CmF":{"name":"rangeNotSatisfiable","abstract":"

The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO17expectationFailedyA2CmF":{"name":"expectationFailed","abstract":"

The server cannot meet the requirements of the Expect request-header field.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO9imATeapotyA2CmF":{"name":"imATeapot","abstract":"

This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18misdirectedRequestyA2CmF":{"name":"misdirectedRequest","abstract":"

The request was directed at a server that is not able to produce a response (for example because of connection reuse).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19unprocessableEntityyA2CmF":{"name":"unprocessableEntity","abstract":"

The request was well-formed but was unable to be followed due to semantic errors.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO6lockedyA2CmF":{"name":"locked","abstract":"

The resource that is being accessed is locked.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO16failedDependencyyA2CmF":{"name":"failedDependency","abstract":"

The request failed because it depended on another request and that request failed (e.g., a PROPPATCH).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8tooEarlyyA2CmF":{"name":"tooEarly","abstract":"

Indicates that the server is unwilling to risk processing a request that might be replayed.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15upgradeRequiredyA2CmF":{"name":"upgradeRequired","abstract":"

The client should switch to a different protocol such as TLS/1.3, given in the Upgrade header field.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO20preconditionRequiredyA2CmF":{"name":"preconditionRequired","abstract":"

The origin server requires the request to be conditional.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15tooManyRequestsyA2CmF":{"name":"tooManyRequests","abstract":"

The user has sent too many requests in a given amount of time.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO27requestHeaderFieldsTooLargeyA2CmF":{"name":"requestHeaderFieldsTooLarge","abstract":"

The server is unwilling to process the request because either an individual header field, or all the header fields collectively,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO26unavailableForLegalReasonsyA2CmF":{"name":"unavailableForLegalReasons","abstract":"

A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19internalServerErroryA2CmF":{"name":"internalServerError","abstract":"

A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14notImplementedyA2CmF":{"name":"notImplemented","abstract":"

The server either does not recognize the request method, or it lacks the ability to fulfil the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10badGatewayyA2CmF":{"name":"badGateway","abstract":"

The server was acting as a gateway or proxy and received an invalid response from the upstream server.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18serviceUnavailableyA2CmF":{"name":"serviceUnavailable","abstract":"

The server cannot handle the request (because it is overloaded or down for maintenance).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14gatewayTimeoutyA2CmF":{"name":"gatewayTimeout","abstract":"

The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO23httpVersionNotSupportedyA2CmF":{"name":"httpVersionNotSupported","abstract":"

The server does not support the HTTP protocol version used in the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO21variantAlsoNegotiatesyA2CmF":{"name":"variantAlsoNegotiates","abstract":"

Transparent content negotiation for the request results in a circular reference.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19insufficientStorageyA2CmF":{"name":"insufficientStorage","abstract":"

The server is unable to store the representation needed to complete the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO12loopDetectedyA2CmF":{"name":"loopDetected","abstract":"

The server detected an infinite loop while processing the request (sent instead of 208 Already Reported).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11notExtendedyA2CmF":{"name":"notExtended","abstract":"

Further extensions to the request are required for the server to fulfil it.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO29networkAuthenticationRequiredyA2CmF":{"name":"networkAuthenticationRequired","abstract":"

The client needs to authenticate to gain network

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SL1goiySbx_xtFZ":{"name":">(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SL2geoiySbx_xtFZ":{"name":">=(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO3getyA2CmF":{"name":"get","abstract":"

The GET method requests a representation of the specified resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO4headyA2CmF":{"name":"head","abstract":"

The HEAD method asks for a response identical to that of a GETrequest, but without the response body.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO4postyA2CmF":{"name":"post","abstract":"

The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO3putyA2CmF":{"name":"put","abstract":"

The PUT method replaces all current representations of the target resource with the request payload.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO6deleteyA2CmF":{"name":"delete","abstract":"

The DELETE method deletes the specified resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO7connectyA2CmF":{"name":"connect","abstract":"

The CONNECT method establishes a tunnel to the server identified by the target resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO7optionsyA2CmF":{"name":"options","abstract":"

The OPTIONS method is used to describe the communication options for the target resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO5traceyA2CmF":{"name":"trace","abstract":"

The TRACE method performs a message loop-back test along the path to the target resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO5patchyA2CmF":{"name":"patch","abstract":"

The PATCH method is used to apply partial modifications to a resource.

","parent_name":"HTTPMethod"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO5plainyA2CmF":{"name":"plain","abstract":"

Plain text format.

","parent_name":"APIDataFormat"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO4jsonyA2CmF":{"name":"json","abstract":"

JSON format.

","parent_name":"APIDataFormat"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO14formURLEncodedyA2CmF":{"name":"formURLEncoded","abstract":"

Form URL encoded format.

","parent_name":"APIDataFormat"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO3xmlyA2CmF":{"name":"xml","abstract":"

XML format.

","parent_name":"APIDataFormat"},"Enums/APIError.html#/s:6Postie8APIErrorO13responseErroryACSi_10Foundation4DataVtcACmF":{"name":"responseError(statusCode:data:)","abstract":"

Indicates a response error with a specific status code and data.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO15invalidResponseyA2CmF":{"name":"invalidResponse","abstract":"

Indicates an invalid response.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO8urlErroryAC10Foundation8URLErrorVcACmF":{"name":"urlError(_:)","abstract":"

Indicates a URL error.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO13decodingErroryACs08DecodingD0OcACmF":{"name":"decodingError(_:)","abstract":"

Indicates a decoding error.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO23failedToEncodePlainTextyACSS10FoundationE8EncodingV_tcACmF":{"name":"failedToEncodePlainText(encoding:)","abstract":"

Indicates a failure to encode plain text with a specific encoding.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO7unknownyACs5Error_p_tcACmF":{"name":"unknown(error:)","abstract":"

Indicates an unknown error.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO16errorDescriptionSSSgvp":{"name":"errorDescription","abstract":"

A localized message describing what error occurred.

","parent_name":"APIError"},"Enums/APIError.html":{"name":"APIError","abstract":"

Represents various errors that can occur when interacting with the API.

"},"Enums/APIDataFormat.html":{"name":"APIDataFormat","abstract":"

Represents the format of API data.

"},"Enums/HTTPMethod.html":{"name":"HTTPMethod","abstract":"

Common HTTP Methods

"},"Enums/HTTPStatusCode.html":{"name":"HTTPStatusCode","abstract":"

Common HTTP Status Codes

"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC7sessionAA18URLSessionProvider_pvp":{"name":"session","abstract":"

The URL session provider used for sending requests.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC3url10Foundation3URLVvp":{"name":"url","abstract":"

The base URL for the API requests.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC10pathPrefixSSSgvp":{"name":"pathPrefix","abstract":"

An optional path prefix to be appended to the base URL.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC3url10pathPrefix7sessionAC10Foundation3URLV_SSSgAA18URLSessionProvider_ptcfc":{"name":"init(url:pathPrefix:session:)","abstract":"

Initializes a new instance of HTTPAPIClient with the specified URL, path prefix, and session provider.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseQzs5Error_pGctAA7RequestRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseAA7RequestPQzs5Error_pGctAA16JSONBodyProviderRzAA010JSONFormatO0RzAaMRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request with a JSON body using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseAA7RequestPQzs5Error_pGctAA26FormURLEncodedBodyProviderRzAA0no6FormatQ0RzAaMRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request with a Form URL Encoded body using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseAA7RequestPQzs5Error_pGctAA17PlainBodyProviderRzAA0n6FormatP0RzAaMRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request with a plain text body using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseQzxYaKAA7RequestRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseAA7RequestPQzxYaKAA16JSONBodyProviderRzAA010JSONFormatG0RzAaFRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a JSON body using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseAA7RequestPQzxYaKAA26FormURLEncodedBodyProviderRzAA0fg6FormatI0RzAaFRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a Form URL Encoded body using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseAA7RequestPQzxYaKAA17PlainBodyProviderRzAA0f6FormatH0RzAaFRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a plain text body using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseQzs5Error_pGxAA7RequestRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseAA7RequestPQzs5Error_pGxAA16JSONBodyProviderRzAA010JSONFormatK0RzAaIRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a JSON body using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseAA7RequestPQzs5Error_pGxAA26FormURLEncodedBodyProviderRzAA0jk6FormatM0RzAaIRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a Form URL Encoded body using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseAA7RequestPQzs5Error_pGxAA17PlainBodyProviderRzAA0j6FormatL0RzAaIRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a plain text body using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC7baseURLAC10Foundation0E0V_tcfc":{"name":"init(baseURL:)","abstract":"

Initializes a new instance of RequestEncoder with the specified base URL.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC6encodey10Foundation10URLRequestVxKSERzlF":{"name":"encode(_:)","abstract":"

Encodes an HTTP request into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC10encodeJson7request10Foundation10URLRequestVx_tKAA16JSONBodyProviderRzAA010JSONFormatJ0RzSERzlF":{"name":"encodeJson(request:)","abstract":"

Encodes an HTTP request with a JSON body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC20encodeFormURLEncoded7request10Foundation10URLRequestVx_tKAA0eF12BodyProviderRzAA0ef6FormatK0RzSERzlF":{"name":"encodeFormURLEncoded(request:)","abstract":"

Encodes an HTTP request with a Form URL Encoded body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC11encodePlain7request10Foundation10URLRequestVx_tKAA0E12BodyProviderRzAA0e6FormatJ0RzSERzlF":{"name":"encodePlain(request:)","abstract":"

Encodes an HTTP request with a plain text body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC9encodeXML7request10Foundation10URLRequestVx_tKAA15XMLBodyProviderRzAA09XMLFormatJ0RzSERzlF":{"name":"encodeXML(request:)","abstract":"

Encodes an HTTP request with an XML body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/ResponseDecoder.html#/s:6Postie15ResponseDecoderC6decode_4fromxxm_10Foundation4DataV4data_So17NSHTTPURLResponseC8responsettKSeRzlF":{"name":"decode(_:from:)","abstract":"

Decodes an HTTP response into the specified type.

","parent_name":"ResponseDecoder"},"Classes/ResponseDecoder.html":{"name":"ResponseDecoder","abstract":"

A class responsible for decoding HTTP responses into specified types.

"},"Classes/RequestEncoder.html":{"name":"RequestEncoder","abstract":"

A class responsible for encoding HTTP requests into various formats.

"},"Classes/HTTPAPIClient.html":{"name":"HTTPAPIClient","abstract":"

A class responsible for sending HTTP API requests and handling responses.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"},"Typealiases.html":{"name":"Type Aliases","abstract":"

The following type aliases are available globally.

"}} \ No newline at end of file diff --git a/docs/docsets/Postie.docset/Contents/Resources/Documents/undocumented.json b/docs/docsets/Postie.docset/Contents/Resources/Documents/undocumented.json new file mode 100644 index 0000000..aececcb --- /dev/null +++ b/docs/docsets/Postie.docset/Contents/Resources/Documents/undocumented.json @@ -0,0 +1,12 @@ +{ + "warnings": [ + { + "file": "/Volumes/Developer/kula/Postie/Sources/Postie/Status Codes/HTTPStatusCode.swift", + "line": 417, + "symbol": "Range.~=(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + } + ], + "source_directory": "/Volumes/Developer/kula/Postie" +} \ No newline at end of file diff --git a/docs/docsets/Postie.docset/Contents/Resources/docSet.dsidx b/docs/docsets/Postie.docset/Contents/Resources/docSet.dsidx new file mode 100644 index 0000000..e0e80d7 Binary files /dev/null and b/docs/docsets/Postie.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/docsets/Postie.tgz b/docs/docsets/Postie.tgz new file mode 100644 index 0000000..6a1976f Binary files /dev/null and b/docs/docsets/Postie.tgz differ diff --git a/docs/img/carat.png b/docs/img/carat.png new file mode 100755 index 0000000..29d2f7f Binary files /dev/null and b/docs/img/carat.png differ diff --git a/docs/img/dash.png b/docs/img/dash.png new file mode 100755 index 0000000..6f694c7 Binary files /dev/null and b/docs/img/dash.png differ diff --git a/docs/img/gh.png b/docs/img/gh.png new file mode 100755 index 0000000..628da97 Binary files /dev/null and b/docs/img/gh.png differ diff --git a/docs/img/spinner.gif b/docs/img/spinner.gif new file mode 100644 index 0000000..e3038d0 Binary files /dev/null and b/docs/img/spinner.gif differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..a66ecd9 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,1078 @@ + + + + Postie Reference + + + + + + + + + + + + + + + +
+

+ + Postie + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+ +

Postie

+

Postie - The next-level structured HTTP API Client

+ + + +

+ Created and maintained by Philip Niedertscheider at kula.app and all the amazing contributors. +

+ +

Postie is a pure Swift library for building URLRequests using property wrappers.

+

Example

+ +

Checkout this full example starting at defining the request and the expected response, up to creating a client and sending it to the remote endpoint.

+
import Foundation
+import Postie
+
+// Request contains body data encoded as a JSON
+struct MyRequest: JSONRequest {
+
+    // The request body is strongly typed defined
+    struct RequestBody: Encodable {
+        var someNumberValue: Int
+    }
+
+    // Define the response directly inside the request, so every
+    // Request-Response are isolated.
+    // Also directly define, that the response body shall be decoded
+    // from Form-URL-Encoding
+    struct Response: FormURLEncodedDecodable {
+
+        // The expected response body structure
+        struct Body: Decodable {
+            var someNumberValue: Int
+        }
+
+        // The expected response body structure, in case we did something wrong
+        struct ErrorBody: Decodable {
+            var message: String
+        }
+
+        // Property wrappers define the purpose
+        @ResponseBody<Body> var body
+        @ResponseErrorBody<ErrorBody> var errorBody
+
+        // Access specific response headers
+        @ResponseHeader<DefaultStrategy> var contentType: String
+
+        // Status codes also have convenience utilities
+        @ResponseStatusCode var statusCode
+
+        // Cookies send by the remote
+        @RequestCookies var cookies
+    }
+
+    // The `keyEncodingStrategy` determines how to encode a type’s coding keys as JSON keys.
+    // The default value return `.convertToSnakeCase` but you can optionally choose to return `.useDefaultKeys` by implementing JSONRequest's protocol requirement as follow:
+    // var keyEncodingStrategy: JSONEncoder.KeyEncodingStrategy {
+    //     .useDefaultKeys
+    // }
+
+
+    // This property holds the data which will be encoded
+    var body: RequestBody
+
+    // Location of our resource with template string
+    @RequestPath var path = "/profile/{user_id}"
+
+    // Parameter to replace in the template string
+    @RequestPathParameter(name: "userId") var userId: String
+
+    // HTTP method that shall be used
+    @RequestHTTPMethod var method = .post
+
+    // Set request headers using the property naming
+    @RequestHeader var authorization: String?
+
+    // Set multiple instances of HTTPCookie
+    @RequestCookies var cookies
+}
+
+// Create a request
+var request = MyRequest(body: MyRequest.RequestBody(someNumberValue: 42),
+                        userId: "my-user-id")
+request.authorization = "Bearer my-oauth-token"
+
+// Create a client
+let client = HTTPAPIClient(url: URL(string: "https://example.org")!)
+
+// Send the request
+client.send(request)
+    .sink { result in
+        switch result {
+        case .failure(let error):
+            print("Oh no something went wrong :(")
+            print(error)
+        case .finished:
+            print("Everything worked fine :)")
+        }
+    } receiveValue: { response in
+        // The single response object contains all the interesting data
+        print(response.statusCode)
+        print(response.body)
+        print(response.errorBody)
+        print(response.contentType)
+    }
+
+

Core Concept

+ +

The networking layer of Foundation (and with Combine) is already quite advanced. +Using URLRequest you can set many different configuration values, e.g. the HTTP Method or Headers.

+ +

Unfortunately you still need to manually serialize your payload into Foundation.Data and set it as the request body. +Additionally you also have to set Content-Type header, or otherwise the remote won’t be able to understand the content.

+ +

Also the response needs to be decoded, and even if a few decoders are included, e.g. JSONDecoder, reading and parsing the URLResponse is not intuitive.

+ +

Even worse when the response structure differs in case of an error, e.g. instead of

+
{
+  "some": "data"
+}
+
+ +

an error object is returned:

+
{
+  "error": {
+    "message": "Something went wrong!"
+  }
+}
+
+ +

This would require to create combined types such as this one:

+
struct Response: Decodable {
+    struct ErrorResponse: Decodable {
+        var message: String
+    }
+
+    var some: String?
+    var error: ErrorResponse?
+}
+
+ +

and you would have to use nil-checking (probably in combination with the HTTP Status Code) to see which data is present.

+ +

Postie simplifies these use cases. The main idea is defining slim struct types to build the requests, and serialize the associated responses. +Configuration of the request is done using property wrappers, e.g. @QueryItem.

+

Usage

+

Defining the request

+ +

Postie includes a couple of types to build your requests. As a first step, create your Request type, with an associated Response:

+
import Postie
+
+struct FooRequest: Request  {
+    typealias Response = EmptyResponse
+}
+
+ +

The default Request type is used for URL requests without any body data. +If you want to include payload data, use one of the following ones:

+ + + +

All of these expect a body instance variable. +For JSONRequest, FormURLEncodedRequest and XMLRequest the type of body is generic but needs to implement the Encodable protocol.

+ +

Example:

+
struct Foo: JSONRequest {
+
+    struct Body: Encodable {}
+    typealias Response = EmptyResponse
+
+    var body: Body
+
+}
+
+struct Bar: FormURLEncodedRequest {
+
+    struct Body: Encodable {}
+    typealias Response = EmptyResponse
+
+    var body: Body
+
+}
+
+struct Bar: XMLRequest {
+
+    struct Body: Encodable {}
+    typealias Response = EmptyResponse
+
+    var body: Body
+
+}
+
+ +

For the PlainRequest the body expects a plain String content. Optionally you can also overwrite the encoding variable with a custom encoding (default is utf8).

+ +

Example:

+
struct Foo: PlainRequest {
+
+    typealias Response = EmptyResponse
+
+    var body: String
+    var encoding: String.Encoding = .utf16 // default: .utf8
+
+}
+
+

Setting the request HTTP Method

+ +

The default HTTP method is GET, but it can be overwritten by adding an instance property with the property wrapper @RequestHTTPMethod:

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestHTTPMethod var method
+
+}
+
+// Usage
+var request = Request()
+request.method = .post
+
+ +

Note:

+ +

As the property name is ignored, it is possible to have multiple properties with this property wrapper, but only the last one will be used.

+

Setting the request URL path

+ +

The default path /, but it can be overwritten by adding an instance property with the property wrapper @RequestPath:

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestPath var path
+
+}
+
+// Usage
+let request = Request(path: "/some-detail-path")
+
+ +

Additionally the request path can contain variables using the mustache syntax, e.g. /path/with/{variable_name}/inside.

+ +

To set the variable value, add a new instance property using the @RequestPathParameter property wrapper. +By default the encoder uses the variable name for encoding, but you can also define a custom name:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestPath var path = "/app/{id}/contacts/{cid}"
+    @RequestPathParameter var id: Int
+    @RequestPathParameter(name: "cid") var contactId: String
+
+}
+
+// Usage
+var request = Request(id: 123)
+request.contactId = "ABC456"
+
+// Result:
+https://postie.local/app/123/contacts/ABC456
+
+ +

Note:

+ +

As the property name is ignored, it is possible to have multiple properties with this property wrapper, but only the last one will be used. +Also you need to require a leading forward slash (/) in the path.

+

Adding query items to the URL

+ +

Multiple query items can be added by adding them as properties using the property wrapper @QueryItem.

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @QueryItem
+    var text: String
+
+    @QueryItem(name: "other_text")
+    var anotherQuery: String
+
+    @QueryItem
+    var optionalText: String?
+
+}
+
+// Usage
+var request = Request(text: "foo")
+request.anotherQuery = "bar"
+
+// Result query in URL:
+?text=foo&other_text=bar
+
+ +

If no custom name is set, the variable name is used. If the query item is optional, and not set (therefore nil), it won’t be added to the list.

+ +

Supported query value types can be found in QueryItemValue.swift.

+ +

Note:

+ +

When using an Array as the query item type, every value in the array is appended using the same name. +The remote server is then responsible to collect all query items with the same name and merge them into an array.

+ +

Example: [1, 2, 3] with name values becomes ?values=1&values=2&values=3

+ +

As multiple query items can use the same custom name, they will all be appended to the query. +This does not apply to synthesized names, as a Swift type can not have more than one property with the exact same name.

+

Adding Headers to the request

+ +

Multiple headers can be set by adding them as properties using the property wrapper @RequestHeader.

+ +

Example:

+
struct Request: Encodable {
+
+    typealias Response = EmptyResponse
+
+    @RequestHeader
+    var text: String
+
+    @RequestHeader(name: "other_text")
+    var anotherQuery: String
+
+    @RequestHeader
+    var optionalText: String?
+
+}
+
+// Usage
+var request = Request(text: "foo")
+request.anotherQuery = "bar"
+
+// Result query in URL:
+?text=foo&other_text=bar
+
+ +

If no custom name is set, the variable name is used. If the header is optional, and not set (therefore nil), it won’t be added to the list.

+ +

Supported header values types can be found in RequestHeaderValue.swift.

+ +

Note:

+ +

As multiple query items can use the same custom name, the last one will be used. +This does not apply to synthesized names, as a Swift type can not have more than one property with the exact same name.

+

Defining the response

+ +

Every struct implementing Request expects to have an associated Response type implementing the Decodable protocol. +In the examples above the EmptyResponse convenience type (which is an empty, decodable type) has been used.

+ +

The response structure will be populated with data from either the response body data or metadata.

+

Parsing the response body

+ +

To parse the response data into a Decodable type, add a property with the property wrapper @ResponseBody<BodyType> where BodyType is the response body type.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: Decodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+ +

To indicate the decoding system which response data format should be expected, conform your response type to one of the following protocols:

+ + + +

For JSONDecodable, FormURLEncodedDecodable and XMLDecodable the type of body is generic but needs to implement the Decodable protocol.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: JSONDecodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: FormURLEncodedDecodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct Body: XMLDecodable {
+            var value: String
+        }
+
+        @ResponseBody<Body> var body
+    }
+}
+
+ +

For the type PlainDecodable, use it directly, as it is an alias for String.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        @ResponseBody<PlainDecodable> var body
+    }
+}
+
+

Response body on error

+ +

As mentioned in Core Concept Postie allows defining a body response type when receiving an invalid status code (>=400).

+ +

It’s usage is exactly the same as with @ResponseBody, but instead you need to use the property wrapper @ResponseErrorBody. +Either the @ResponseBody or the @ResponseErrorBody is set, never both at the same time.

+ +

The error response body gets set if the response status code is neither a 2XX nor a 3XX status code.

+ +

Example:

+
struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct ErrorBody: JSONDecodable {
+            var message: String
+        }
+        @ResponseErrorBody<ErrorBody> var errorBody
+    }
+}
+
+

Response parsing strategies

+ +

As the response body might differ depending on various factors, you can control the parsing using “decoding strategies”.

+ +

By default if you use ResponseBody to parse the response body, it will use the DefaultBodyStrategy (which expects an HTTP status code 2XX or 3XX).

+ +

The same applies to the ResponseErrorBody to parse the response body for a status code of 400 or above, which is using the DefaultErrorBodyStrategy.

+ +

For your convenience we added a couple of convenience strategies in ResponseBody and ResponseErrorBody, you can use with the ResponseBodyWrapper and ResponseErrorBodyWrapper.

+ +

If you want to implement a custom decoding strategy, all you need to do is define a struct implementing the protocol ResponseBodyDecodingStrategy or ResponseErrorBodyDecodingStrategy.

+ +

Example:*

+
struct CustomBodyDecodingStrategy {
+    public static func allowsEmptyContent(for _: Int) -> Bool {
+        return false
+    }
+
+    public static func validate(statusCode: Int) -> Bool {
+        // e.g. only decode if the status code is 999
+        statusCode == 999
+    }
+}
+
+struct Request: Postie.Request {
+    struct Response: Decodable {
+        struct CreatedResponseBody: JSONDecodable {
+            ...
+        }
+
+        @ResponseBody<CreatedResponseBody>.Status201 var createdBody: CreatedResponseBody
+
+        struct CustomResponseBody: JSONDecodable {
+            ...
+        }
+
+        @ResponseBodyWrapper<CustomResponseBody, CustomBodyDecodingStrategy> var customBody
+    }
+}
+
+ +

Note: Due to technical limitations of the Codable protocol in Swift, it is currently not possible to have a non-static/dynamic decoding strategy.

+

Response headers

+ +

Use the property wrapper @ResponseHeader<Strategy> inside the response type.

+ +

In the moment, the following decoding strategies are implemented:

+ + + +

Converts the property name into camel-case format (e.g. Content-Type becomes contentType) and compares case-insensitive (e.g. Authorization equals authorization) +This strategy expects the response header to be set, otherwise an error will be thrown.

+ +

Response from URL requests are always of type String and no casting will be performed. Therefore the only valid property type is String.

+ +
    +
  • DefaultHeaderOptionalStrategy
  • +
+ +

Same as DefaultHeaderStrategy but won’t fail if the header can not be found.

+ +

Example:

+
struct Response: Decodable {
+
+    @ResponseHeader<DefaultHeaderStrategy>
+    var authorization: String
+
+    @ResponseHeader<DefaultHeaderStrategy>
+    var contentType: String
+
+    @ResponseHeader<DefaultHeaderStrategyOptional>
+    var optionalValue: String?
+
+}
+
+

Response Status

+ +

The default HTTP method is GET, but it can be overwritten by adding an instance property with the property wrapper @RequestHTTPMethod:

+ +

Example:

+
struct Response: Decodable {
+
+    @ResponseStatusCode var statusCode
+
+}
+
+ +

Note:

+ +

Multiple properties can be declared with this property wrapper. All of them will have the value set.

+

Nested Responses

+ +

To support inheritance, which can be especially useful for pagination, use the property wrapper @NestedResponse to add nested responses.

+ +

While decoding the flat HTTP response will be applied recursively to all nested responses, therefore it is possible, that different nested responses access different values of the original HTTP response.

+ +

Example:

+
struct PaginatedResponse<NestedRequest: Request>: Decodable {
+
+    /// Header which indicates how many more elements are available
+    @ResponseHeader<DefaultHeaderStrategy> var totalElements
+
+    @NestedResponse var nested: NestedRequest
+}
+
+struct ListRequest: Request {
+
+    typealias Response = PaginatedResponse<ListResponse>
+
+    struct ListResponse: Decodable {
+        // see other examples
+    }
+}
+
+

HTTP API Client

+ +

The easiest way of sending Postie requests, is using the HTTPAPIClient which takes care of encoding requests, and decoding responses.

+ +

All it takes to create a client, is the URL which is used as a base for all requests. Afterwards you can just send the requests, either using Async-Await, Combine publishers, or classic callbacks.

+ +

Additionally the HTTPAPIClient provides the option of setting a session provider, which encapsulates the default URLSession by a protocol. +This allows to create networking clients which can be mocked (perfect for unit testing).

+

Async Await

+ +

Example:

+
let url: URL = ...
+let client = HTTPAPIClient(baseURL: url)
+
+// ... create request ...
+
+try {
+    let response = try await client.send(request)
+    // process response
+    print(response)
+} catch {
+    // handle error
+}
+
+

Combine

+ +

Example:

+
let url: URL = ...
+let client = HTTPAPIClient(baseURL: url)
+
+// ... create request ...
+
+client.send(request)
+    .sink(receiveCompletion: { completion in
+        switch completion {
+        case .failure(let error):
+            // handle error
+            break
+        case .finished:
+            break
+        }
+    }, receiveValue: { response in
+        // process response
+        print(response)
+    })
+    .store(in: &cancellables)
+
+

Callback

+ +

Example:

+
let url: URL = ...
+let client = HTTPAPIClient(baseURL: url)
+
+// ... create request ...
+
+client.send(request) { result in
+    switch result {
+    case .failure(let error):
+        // handle error
+        break
+    case .finished(let response):
+        // process response
+        break
+    }
+}
+
+

Cookies

+ +

By default the cookies of requests and responses are handled by the session used by the HTTPAPIClient. If you want to explicitly set the request cookies, use RequestCookies, and to access the response cookies use ResponseCookies.

+ +

Example:

+
struct MyRequest: Request {
+    struct Response: Decodable {
+        // List of HTTPCookie parsed from the `Set-Cookie` headers of the response
+        @ResponseCookies var cookies
+    }
+
+    // List of HTTPCookie to be set in the request as `Cookie` headers
+    @RequestCookies var cookies
+}
+
+

Encoding & Decoding

+ +

The RequestEncoder is responsible to turn an encodable Request into an URLRequest. It requires an URL in the initializer, as Postie requests are relative requests.

+ +

Example:

+
// A request as explained above
+let request: Request = ...
+
+// Create a request encoder
+let url = URL(string: "http://techprimate.com")
+let encoder = RequestEncoder(baseURL: url)
+
+// Encode request
+let urlRequest: URLRequest
+do {
+    let urlRequest = try encoder.encode(request)
+    // continue with url request
+    ...
+} catch {
+    // Handle error
+    ...
+}
+
+ +

As its contrarity component, the RequestDecoder is responsible to turn a tuple of (data: Data, response: HTTPURLResponse) into a given type Response.

+ +

Example:

+
// Data received from the URL session task
+let response: HTTPURLResponse = ...
+let data: Data = ...
+
+// Create decoder
+let decoder = ResponseDecoder()
+do {
+    let decoded = try decoder.decode(Response.self, from: (data, response)))
+    // continue with decoded response
+    ...
+} catch{
+    // Handle error
+    ...
+}
+
+

Combine Support

+ +

RequestEncoder conforms to TopLevelEncoder and RequestDecoder conforms to TopLevelDecoder. +This means both encoders can be used in a Combine pipeline.

+ +

Example:

+
let request = Request()
+let session = URLSession.shared
+
+let url = URL(string: "https://techprimate.com")!
+let encodedRequest = try RequestEncoder(baseURL: url).encode(request)
+
+// Send request using the given URL session provider
+return session
+    .dataTaskPublisher(for: encodedRequest)
+    .tryMap { (data: Data, response: URLResponse) in
+        guard let response = response as? HTTPURLResponse else {
+            fatalError("handle non HTTP url responses")
+        }
+        return (data: data, response: response)
+    }
+    .decode(type: Request.Response.self, decoder: ResponseDecoder())
+    .sink(receiveCompletion: { result in
+        // handle result
+    }, receiveValue: { decoded in
+        // do something with decoded response
+    })
+
+

Articles & Stories

+ +

Here is a list of relevant articles and stories regarding Postie 🥳

+ +

(Please let us know if you found more.)

+ + + +
+
+ + +
+
+ + + diff --git a/docs/js/jazzy.js b/docs/js/jazzy.js new file mode 100755 index 0000000..1ac8699 --- /dev/null +++ b/docs/js/jazzy.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targeted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docs/js/jazzy.search.js b/docs/js/jazzy.search.js new file mode 100644 index 0000000..359cdbb --- /dev/null +++ b/docs/js/jazzy.search.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +$(function(){ + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
'; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
'; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + const searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + this.field('abstract'); + for (const [url, doc] of Object.entries(searchData)) { + this.add({url: url, name: doc.name, abstract: doc.abstract}); + } + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3, + autoselect: true + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + const lcSearch = query.toLowerCase(); + const results = searchIndex.query(function(q) { + q.term(lcSearch, { boost: 100 }); + q.term(lcSearch, { + boost: 10, + wildcard: lunr.Query.wildcard.TRAILING + }); + }).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docs/js/jquery.min.js b/docs/js/jquery.min.js new file mode 100644 index 0000000..7f37b5d --- /dev/null +++ b/docs/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/docs/js/typeahead.jquery.js b/docs/js/typeahead.jquery.js new file mode 100644 index 0000000..bcb734b --- /dev/null +++ b/docs/js/typeahead.jquery.js @@ -0,0 +1,1695 @@ +/*! + * typeahead.js 1.3.3 + * https://github.com/corejavascript/typeahead.js + * Copyright 2013-2024 Twitter, Inc. and other contributors; Licensed MIT + */ + + +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([ "jquery" ], function(a0) { + return factory(a0); + }); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +})(this, function($) { + var _ = function() { + "use strict"; + return { + isMsie: function() { + return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; + }, + isBlankString: function(str) { + return !str || /^\s*$/.test(str); + }, + escapeRegExChars: function(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, + isString: function(obj) { + return typeof obj === "string"; + }, + isNumber: function(obj) { + return typeof obj === "number"; + }, + isArray: $.isArray, + isFunction: $.isFunction, + isObject: $.isPlainObject, + isUndefined: function(obj) { + return typeof obj === "undefined"; + }, + isElement: function(obj) { + return !!(obj && obj.nodeType === 1); + }, + isJQuery: function(obj) { + return obj instanceof $; + }, + toStr: function toStr(s) { + return _.isUndefined(s) || s === null ? "" : s + ""; + }, + bind: $.proxy, + each: function(collection, cb) { + $.each(collection, reverseArgs); + function reverseArgs(index, value) { + return cb(value, index); + } + }, + map: $.map, + filter: $.grep, + every: function(obj, test) { + var result = true; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (!(result = test.call(null, val, key, obj))) { + return false; + } + }); + return !!result; + }, + some: function(obj, test) { + var result = false; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (result = test.call(null, val, key, obj)) { + return false; + } + }); + return !!result; + }, + mixin: $.extend, + identity: function(x) { + return x; + }, + clone: function(obj) { + return $.extend(true, {}, obj); + }, + getIdGenerator: function() { + var counter = 0; + return function() { + return counter++; + }; + }, + templatify: function templatify(obj) { + return $.isFunction(obj) ? obj : template; + function template() { + return String(obj); + } + }, + defer: function(fn) { + setTimeout(fn, 0); + }, + debounce: function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments, later, callNow; + later = function() { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + } + }; + callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + } + return result; + }; + }, + throttle: function(func, wait) { + var context, args, timeout, result, previous, later; + previous = 0; + later = function() { + previous = new Date(); + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date(), remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }, + stringify: function(val) { + return _.isString(val) ? val : JSON.stringify(val); + }, + guid: function() { + function _p8(s) { + var p = (Math.random().toString(16) + "000000000").substr(2, 8); + return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; + } + return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); + }, + noop: function() {} + }; + }(); + var WWW = function() { + "use strict"; + var defaultClassNames = { + wrapper: "twitter-typeahead", + input: "tt-input", + hint: "tt-hint", + menu: "tt-menu", + dataset: "tt-dataset", + suggestion: "tt-suggestion", + selectable: "tt-selectable", + empty: "tt-empty", + open: "tt-open", + cursor: "tt-cursor", + highlight: "tt-highlight" + }; + return build; + function build(o) { + var www, classes; + classes = _.mixin({}, defaultClassNames, o); + www = { + css: buildCss(), + classes: classes, + html: buildHtml(classes), + selectors: buildSelectors(classes) + }; + return { + css: www.css, + html: www.html, + classes: www.classes, + selectors: www.selectors, + mixin: function(o) { + _.mixin(o, www); + } + }; + } + function buildHtml(c) { + return { + wrapper: '', + menu: '
' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e = $.Event(namespace + type); + this.$el.trigger.call(this.$el, $e, args || []); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false, + diacriticInsensitive: false + }; + var accented = { + A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", + B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", + C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", + D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", + E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", + F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", + G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", + H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", + I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", + J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", + K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", + L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", + M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", + N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", + O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", + P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", + Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", + R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", + S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", + T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", + U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", + V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", + W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", + X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", + Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", + Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function accent_replacer(chr) { + return accented[chr.toUpperCase()] || chr; + } + function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + var escapedWord = _.escapeRegExChars(patterns[i]); + if (diacriticInsensitive) { + escapedWord = escapedWord.replace(/\S/g, accent_replacer); + } + escapedPatterns.push(escapedWord); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + var id; + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.$menu = $(o.menu); + id = this.$input.attr("id") || _.guid(); + this.$menu.attr("id", id + "_listbox"); + this.$hint.attr({ + "aria-hidden": true + }); + this.$input.attr({ + "aria-owns": id + "_listbox", + "aria-controls": id + "_listbox", + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": false + }); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + this.onSync("cursorchange", this._updateDescendent); + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + _updateDescendent: function updateDescendent(event, id) { + this.$input.attr("aria-activedescendant", id); + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
"); + }, + setAriaExpanded: function setAriaExpanded(value) { + this.$input.attr("aria-expanded", value); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + dataset: "tt-selectable-dataset", + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = _.toStr(o.name || nameGenerator()); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + dataset: $el.data(keys.dataset) || "", + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", suggestions, false, this.name); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", suggestions, true, this.name); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query, that.name); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query, that.name); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + var idx = Math.abs(rendered - that.limit); + rendered += idx; + that._append(query, suggestions.slice(0, idx)); + that.async && that.trigger("asyncReceived", query, that.name); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
"); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate + }; + function userSuggestionTemplate(context) { + var template = templates.suggestion; + return $(template(context)).attr("id", _.guid()); + } + function suggestionTemplate(context) { + return $('
').attr("id", _.guid()).text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { + var isEmpty = dataset.isEmpty(); + this.$node.attr("aria-expanded", !isEmpty); + return isEmpty; + }, this)); + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + this.$node.on("mouseover", this.selectors.selectable, function() { + that.setCursor($(this)); + }); + this.$node.on("mouseleave", function() { + that._removeCursor(); + }); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.scrollTop(0); + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.attr("aria-expanded", false); + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
"); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var Status = function() { + "use strict"; + function Status(options) { + this.$el = $("", { + role: "status", + "aria-live": "polite" + }).css({ + position: "absolute", + padding: "0", + border: "0", + height: "1px", + width: "1px", + "margin-bottom": "-1px", + "margin-right": "-1px", + overflow: "hidden", + clip: "rect(0 0 0 0)", + "white-space": "nowrap" + }); + options.$input.after(this.$el); + _.each(options.menu.datasets, _.bind(function(dataset) { + if (dataset.onSync) { + dataset.onSync("rendered", _.bind(this.update, this)); + dataset.onSync("cleared", _.bind(this.cleared, this)); + } + }, this)); + } + _.mixin(Status.prototype, { + update: function update(event, suggestions) { + var length = suggestions.length; + var words; + if (length === 1) { + words = { + result: "result", + is: "is" + }; + } else { + words = { + result: "results", + is: "are" + }; + } + this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); + }, + cleared: function() { + this.$el.text(""); + } + }); + return Status; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.autoselect = !!o.autoselect; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
"); + $menu = this.menu.$node || $("
"); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { + this._updateHint(); + if (this.autoselect) { + var cursorClass = this.selectors.cursor.substr(1); + this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); + } + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + if (this.select($selectable)) { + $e.preventDefault(); + $e.stopPropagation(); + } + } else if (this.autoselect) { + if (this.select(this.menu.getTopSelectable())) { + $e.preventDefault(); + $e.stopPropagation(); + } + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if (this.autoselect) { + if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.input.setAriaExpanded(true); + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.input.setAriaExpanded(false); + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj, data.dataset)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj, data.dataset); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj, data.dataset); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, suggestion, datasetName, cancelMove, id; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + suggestion = data ? data.obj : null; + datasetName = data ? data.dataset : null; + id = $candidate ? $candidate.attr("id") : null; + this.input.trigger("cursorchange", id); + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { + this.menu.setCursor($candidate); + if (data) { + if (typeof data.val === "string") { + this.input.setInputValue(data.val); + } + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", suggestion, datasetName); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input, + menu: $menu + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + status = new Status({ + $input: $input, + menu: menu + }); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength, + autoselect: o.autoselect + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(_.toStr(newVal)); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ + readonly: true, + required: false + }).removeAttr("id name placeholder").removeClass("required").attr({ + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docs/search.json b/docs/search.json new file mode 100644 index 0000000..1094662 --- /dev/null +++ b/docs/search.json @@ -0,0 +1 @@ +{"Typealiases/FormURLEncodedDecodable.html":{"name":"FormURLEncodedDecodable","abstract":"

A type that can decode itself from an external form-url encoded representation.

"},"Typealiases/JSONDecodable.html":{"name":"JSONDecodable","abstract":"

A type that can decode itself from an external JSON representation.

"},"Typealiases/PlainDecodable.html":{"name":"PlainDecodable","abstract":"

A type which represents plain text

"},"Typealiases/XMLDecodable.html":{"name":"XMLDecodable","abstract":"

A type that can decode itself from an external JSON representation.

"},"Typealiases/FormURLEncodedEncodable.html":{"name":"FormURLEncodedEncodable","abstract":"

A type that can decode itself from an external form-url encoded representation.

"},"Typealiases/JSONEncodable.html":{"name":"JSONEncodable","abstract":"

A type that should encode itself to a JSON representation.

"},"Typealiases/PlainEncodable.html":{"name":"PlainEncodable","abstract":"

A type that should encode itself to a JSON representation.

"},"Typealiases/XMLEncodable.html":{"name":"XMLEncodable","abstract":"

A type that should encode itself to a JSON representation.

"},"Typealiases/FormURLEncodedRequest.html":{"name":"FormURLEncodedRequest","abstract":"

Protocol indicating a given request should be encoded into a form URL encoded request

"},"Typealiases/JSONRequest.html":{"name":"JSONRequest","abstract":"

Protocol indicating a given request should be encoded into a JSON request

"},"Typealiases/PlainRequest.html":{"name":"PlainRequest","abstract":"

Protocol indicating a given request should be encoded into a JSON request

"},"Typealiases/XMLRequest.html":{"name":"XMLRequest","abstract":"

Protocol indicating a given request should be encoded into an XML request

"},"Typealiases/ResponseBody.html":{"name":"ResponseBody","abstract":"

A type alias for ResponseBodyWrapper with a default body decoding strategy.

"},"Typealiases/ResponseErrorBody.html":{"name":"ResponseErrorBody","abstract":"

A type alias for ResponseErrorBodyWrapper with a default error body decoding strategy.

"},"Structs/DefaultHeaderStrategyOptional.html#/s:6Postie29DefaultHeaderStrategyOptionalV6decode7decoderxSgs7Decoder_p_tKFZ":{"name":"decode(decoder:)","abstract":"

Decodes the response header value from the given decoder.

","parent_name":"DefaultHeaderStrategyOptional"},"Structs/DefaultHeaderStrategy.html#/s:6Postie21DefaultHeaderStrategyV6decode7decoderxs7Decoder_p_tKFZ":{"name":"decode(decoder:)","abstract":"

Decodes the response header value from the given decoder.

","parent_name":"DefaultHeaderStrategy"},"Structs/ValidateStatus422ErrorBodyStrategy.html#/s:6Postie34ValidateStatus422ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus422ErrorBodyStrategy"},"Structs/ValidateStatus410ErrorBodyStrategy.html#/s:6Postie34ValidateStatus410ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus410ErrorBodyStrategy"},"Structs/ValidateStatus404ErrorBodyStrategy.html#/s:6Postie34ValidateStatus404ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus404ErrorBodyStrategy"},"Structs/ValidateStatus403ErrorBodyStrategy.html#/s:6Postie34ValidateStatus403ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"ValidateStatus403ErrorBodyStrategy"},"Structs/ValidateStatus401ErrorBodyStrategy.html#/s:6Postie34ValidateStatus401ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Checks if the given status code represents an error.

","parent_name":"ValidateStatus401ErrorBodyStrategy"},"Structs/ValidateStatus400ErrorBodyStrategy.html#/s:6Postie34ValidateStatus400ErrorBodyStrategyV02isD010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Checks if the given status code represents an error.

","parent_name":"ValidateStatus400ErrorBodyStrategy"},"Structs/ValidateStatus303BodyStrategy.html#/s:6Postie29ValidateStatus303BodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether empty content is allowed for the given status code.

","parent_name":"ValidateStatus303BodyStrategy"},"Structs/ValidateStatus303BodyStrategy.html#/s:6Postie29ValidateStatus303BodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is 303 (See Other).

","parent_name":"ValidateStatus303BodyStrategy"},"Structs/ValidateStatus201BodyStrategy.html#/s:6Postie29ValidateStatus201BodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether empty content is allowed for the given status code.

","parent_name":"ValidateStatus201BodyStrategy"},"Structs/ValidateStatus201BodyStrategy.html#/s:6Postie29ValidateStatus201BodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is 201 (Created).

","parent_name":"ValidateStatus201BodyStrategy"},"Structs/ValidateStatus200BodyStrategy.html#/s:6Postie29ValidateStatus200BodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether empty content is allowed for the given status code.

","parent_name":"ValidateStatus200BodyStrategy"},"Structs/ValidateStatus200BodyStrategy.html#/s:6Postie29ValidateStatus200BodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is 200 (OK).

","parent_name":"ValidateStatus200BodyStrategy"},"Structs/OptionalContentStrategy.html#/s:6Postie23OptionalContentStrategyV011allowsEmptyC03forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Determines whether the decoding should fail when no content is returned.

","parent_name":"OptionalContentStrategy"},"Structs/OptionalContentStrategy.html#/s:6Postie23OptionalContentStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is within the acceptable range.

","parent_name":"OptionalContentStrategy"},"Structs/DefaultErrorBodyStrategy.html#/s:6Postie24DefaultErrorBodyStrategyV02isC010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Determines if the given status code represents an error.

","parent_name":"DefaultErrorBodyStrategy"},"Structs/DefaultBodyStrategy.html#/s:6Postie19DefaultBodyStrategyV18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Determines whether the decoding should fail when no content is returned.

","parent_name":"DefaultBodyStrategy"},"Structs/DefaultBodyStrategy.html#/s:6Postie19DefaultBodyStrategyV8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is within the acceptable range.

","parent_name":"DefaultBodyStrategy"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeV12wrappedValues6UInt16Vvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the status code.

","parent_name":"ResponseStatusCode"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeV14projectedValueAA010HTTPStatusD0OSgvp":{"name":"projectedValue","abstract":"

The projected value representing the HTTP status code.

","parent_name":"ResponseStatusCode"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeVACycfc":{"name":"init()","abstract":"

Initializes a new instance of ResponseStatusCode with the default value of 0.

","parent_name":"ResponseStatusCode"},"Structs/ResponseStatusCode.html#/s:6Postie18ResponseStatusCodeV12wrappedValueACs6UInt16V_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseStatusCode with the specified wrapped value.

","parent_name":"ResponseStatusCode"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperV12wrappedValuexSgvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the decoded error response body.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperVACyxq_Gycfc":{"name":"init()","abstract":"

Initializes a new instance of ResponseErrorBodyWrapper with a nil value.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperV12wrappedValueACyxq_GxSg_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseErrorBodyWrapper with the specified wrapped value.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseErrorBodyWrapper.html#/s:6Postie24ResponseErrorBodyWrapperV4fromACyxq_Gs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseErrorBodyWrapper from a decoder.

","parent_name":"ResponseErrorBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperV12wrappedValuexSgvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the decoded response body.

","parent_name":"ResponseBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperVACyxq_Gycfc":{"name":"init()","abstract":"

Initializes a new instance of ResponseBodyWrapper with a nil value.

","parent_name":"ResponseBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperV12wrappedValueACyxq_GxSg_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseBodyWrapper with the specified wrapped value.

","parent_name":"ResponseBodyWrapper"},"Structs/ResponseBodyWrapper.html#/s:6Postie19ResponseBodyWrapperV4fromACyxq_Gs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseBodyWrapper from a decoder.

","parent_name":"ResponseBodyWrapper"},"Structs/NestedResponse.html#/s:6Postie14NestedResponseV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the nested response.

","parent_name":"NestedResponse"},"Structs/NestedResponse.html#/s:6Postie14NestedResponseV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of NestedResponse with the specified wrapped value.

","parent_name":"NestedResponse"},"Structs/NestedResponse.html#/s:6Postie14NestedResponseV4fromACyxGs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of NestedResponse by decoding from the given decoder.

","parent_name":"NestedResponse"},"Structs/QueryItem.html#/s:6Postie9QueryItemV4nameSSSgvp":{"name":"name","abstract":"

The custom name of the query item, can be nil.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the query item value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of QueryItem with the specified wrapped value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemV4name12defaultValueACyxGSSSg_xtcfc":{"name":"init(name:defaultValue:)","abstract":"

Initializes a new instance of QueryItem with the specified name and default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASbRszrlE4nameACySbGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a default value of false.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASbSgRszrlE4nameACyADGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASdRszrlE4nameACySdGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a default value of 0.0.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASdSgRszrlE4nameACyADGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASiSgRszrlE4nameACyADGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASSRszrlE4nameACySSGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and an empty string as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVAASSSgRszrlE4nameACyADGAD_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/QueryItem.html#/s:6Postie9QueryItemVA2A12OptionalTypeRzSY7WrappedAaDPRpzrlE4nameACyxGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of QueryItem with the specified name and a nil value as the default value.

","parent_name":"QueryItem"},"Structs/RequestURL.html#/s:6Postie10RequestURLV12wrappedValue10Foundation0C0VSgvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the request URL.

","parent_name":"RequestURL"},"Structs/RequestURL.html#/s:6Postie10RequestURLV12wrappedValueAC10Foundation0C0VSg_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestURL with the specified wrapped value.

","parent_name":"RequestURL"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV4nameSSSgvp":{"name":"name","abstract":"

The custom name of the path parameter, can be nil.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the path parameter value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified wrapped value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV4name12defaultValueACyxGSSSg_xtcfc":{"name":"init(name:defaultValue:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and default value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterV03getD4TypeypXpyFZ":{"name":"getParameterType()","abstract":"

Returns the type of the path parameter.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAASSRszrlE4nameACySSGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and an empty string as the default value.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAASiRszrlE4nameACySiGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAAs5Int16VRszrlE4nameACyAEGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAAs5Int32VRszrlE4nameACyAEGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:6Postie20RequestPathParameterVAAs5Int64VRszrlE4nameACyAEGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestPathParameter with the specified name and a default value of -1.

","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:s23ExpressibleByNilLiteralP03nilD0xyt_tcfc":{"name":"init(nilLiteral:)","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter/ExtendedGraphemeClusterLiteralType.html":{"name":"ExtendedGraphemeClusterLiteralType","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter/UnicodeScalarLiteralType.html":{"name":"UnicodeScalarLiteralType","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter/StringLiteralType.html":{"name":"StringLiteralType","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:s26ExpressibleByStringLiteralP06stringD0x0cD4TypeQz_tcfc":{"name":"init(stringLiteral:)","parent_name":"RequestPathParameter"},"Structs/RequestPathParameter.html#/s:s27ExpressibleByIntegerLiteralP07integerD0x0cD4TypeQz_tcfc":{"name":"init(integerLiteral:)","parent_name":"RequestPathParameter"},"Structs/RequestPath.html#/s:6Postie11RequestPathV12wrappedValueSSvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the request path.

","parent_name":"RequestPath"},"Structs/RequestPath.html#/s:6Postie11RequestPathV12wrappedValueACSS_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestPath with the specified wrapped value.

","parent_name":"RequestPath"},"Structs/RequestPath/ExtendedGraphemeClusterLiteralType.html":{"name":"ExtendedGraphemeClusterLiteralType","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/RequestPath/UnicodeScalarLiteralType.html":{"name":"UnicodeScalarLiteralType","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/RequestPath/StringLiteralType.html":{"name":"StringLiteralType","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/RequestPath.html#/s:6Postie11RequestPathV13stringLiteralACSS_tcfc":{"name":"init(stringLiteral:)","abstract":"

Initializes a new instance of RequestPath with the specified string literal.

","parent_name":"RequestPath"},"Structs/ResponseHeader.html#/s:6Postie14ResponseHeaderV12wrappedValue03RawE0Qzvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the decoded header value.

","parent_name":"ResponseHeader"},"Structs/ResponseHeader.html#/s:6Postie14ResponseHeaderV12wrappedValueACyxG03RawE0Qz_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseHeader with the specified wrapped value.

","parent_name":"ResponseHeader"},"Structs/ResponseHeader.html#/s:6Postie14ResponseHeaderV4fromACyxGs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseHeader by decoding from the given decoder.

","parent_name":"ResponseHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV4nameSSSgvp":{"name":"name","abstract":"

The custom name of the header item, can be nil.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the header value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV12wrappedValueACyxGx_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestHeader with the specified wrapped value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderV4name12defaultValueACyxGSSSg_xtcfc":{"name":"init(name:defaultValue:)","abstract":"

Initializes a new instance of RequestHeader with the specified name and default value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderVAASSRszrlE4nameACySSGSSSg_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestHeader with the specified name and an empty string as the default value.

","parent_name":"RequestHeader"},"Structs/RequestHeader.html#/s:6Postie13RequestHeaderVAASSSgRszrlE4nameACyADGAD_tcfc":{"name":"init(name:)","abstract":"

Initializes a new instance of RequestHeader with the specified name and a nil value as the default value.

","parent_name":"RequestHeader"},"Structs/RequestHTTPMethod.html#/s:6Postie17RequestHTTPMethodV12wrappedValueAA0C0Ovp":{"name":"wrappedValue","abstract":"

The wrapped value representing the HTTP method.

","parent_name":"RequestHTTPMethod"},"Structs/RequestHTTPMethod.html#/s:6Postie17RequestHTTPMethodV12wrappedValueAcA0C0O_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestHTTPMethod with the specified wrapped value.

","parent_name":"RequestHTTPMethod"},"Structs/ResponseCookies.html#/s:6Postie15ResponseCookiesV12wrappedValueSaySo12NSHTTPCookieCGvp":{"name":"wrappedValue","abstract":"

The wrapped value representing an array of HTTPCookie objects.

","parent_name":"ResponseCookies"},"Structs/ResponseCookies.html#/s:6Postie15ResponseCookiesV12wrappedValueACSaySo12NSHTTPCookieCG_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of ResponseCookies with an optional array of HTTPCookie objects.

","parent_name":"ResponseCookies"},"Structs/ResponseCookies.html#/s:6Postie15ResponseCookiesV4fromACs7Decoder_p_tKcfc":{"name":"init(from:)","abstract":"

Initializes a new instance of ResponseCookies by decoding from the given decoder.

","parent_name":"ResponseCookies"},"Structs/RequestCookies.html#/s:6Postie14RequestCookiesV12wrappedValueSaySo12NSHTTPCookieCGvp":{"name":"wrappedValue","abstract":"

The wrapped value representing an array of HTTPCookie objects.

","parent_name":"RequestCookies"},"Structs/RequestCookies.html#/s:6Postie14RequestCookiesV12wrappedValueACSaySo12NSHTTPCookieCG_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestCookies with an optional array of HTTPCookie objects.

","parent_name":"RequestCookies"},"Structs/RequestCookies.html#/s:6Postie14RequestCookiesV6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","abstract":"

Encodes this value into the given encoder.

","parent_name":"RequestCookies"},"Structs/RequestCachePolicy.html#/s:6Postie18RequestCachePolicyV12wrappedValueSo012NSURLRequestcD0Vvp":{"name":"wrappedValue","abstract":"

The wrapped value representing the cache policy.

","parent_name":"RequestCachePolicy"},"Structs/RequestCachePolicy.html#/s:6Postie18RequestCachePolicyV12wrappedValueACSo012NSURLRequestcD0V_tcfc":{"name":"init(wrappedValue:)","abstract":"

Initializes a new instance of RequestCachePolicy with the specified wrapped value.

","parent_name":"RequestCachePolicy"},"Structs/RequestCachePolicy.html#/s:6Postie18RequestCachePolicyV6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","abstract":"

Encodes this value into the given encoder.

","parent_name":"RequestCachePolicy"},"Structs/RequestCachePolicy.html":{"name":"RequestCachePolicy","abstract":"

A property wrapper that provides a convenient way to handle request cache policies.

"},"Structs/RequestCookies.html":{"name":"RequestCookies","abstract":"

A property wrapper that provides a convenient way to handle HTTP cookies in a request.

"},"Structs/ResponseCookies.html":{"name":"ResponseCookies","abstract":"

A property wrapper that provides a convenient way to handle HTTP cookies in a response.

"},"Structs/RequestHTTPMethod.html":{"name":"RequestHTTPMethod","abstract":"

A property wrapper for the HTTP method of a request.

"},"Structs/RequestHeader.html":{"name":"RequestHeader","abstract":"

A property wrapper that provides a convenient way to handle HTTP headers in a request.

"},"Structs/ResponseHeader.html":{"name":"ResponseHeader","abstract":"

A property wrapper that provides a convenient way to handle HTTP headers in a response.

"},"Structs/RequestPath.html":{"name":"RequestPath","abstract":"

A property wrapper that provides a convenient way to handle request paths.

"},"Structs/RequestPathParameter.html":{"name":"RequestPathParameter","abstract":"

A property wrapper that provides a convenient way to handle path parameters in a request.

"},"Structs/RequestURL.html":{"name":"RequestURL","abstract":"

A property wrapper that provides a convenient way to handle request URLs.

"},"Structs/QueryItem.html":{"name":"QueryItem","abstract":"

A property wrapper that provides a convenient way to handle query items in a request.

"},"Structs/EmptyResponse.html":{"name":"EmptyResponse","abstract":"

A struct representing an empty response.

"},"Structs/NestedResponse.html":{"name":"NestedResponse","abstract":"

A property wrapper that wraps a nested response.

"},"Structs/ResponseBodyWrapper.html":{"name":"ResponseBodyWrapper","abstract":"

A property wrapper that wraps a response body.

"},"Structs/ResponseErrorBodyWrapper.html":{"name":"ResponseErrorBodyWrapper","abstract":"

A property wrapper that wraps an error response body.

"},"Structs/ResponseStatusCode.html":{"name":"ResponseStatusCode","abstract":"

A property wrapper that provides a convenient way to handle response status codes.

"},"Structs/DefaultBodyStrategy.html":{"name":"DefaultBodyStrategy","abstract":"

A default strategy for validating response bodies.

"},"Structs/DefaultErrorBodyStrategy.html":{"name":"DefaultErrorBodyStrategy","abstract":"

A default strategy for validating error response bodies.

"},"Structs/OptionalContentStrategy.html":{"name":"OptionalContentStrategy","abstract":"

A strategy for validating response bodies with status code 204.

"},"Structs/ValidateStatus200BodyStrategy.html":{"name":"ValidateStatus200BodyStrategy","abstract":"

A strategy for validating response bodies with status code 200.

"},"Structs/ValidateStatus201BodyStrategy.html":{"name":"ValidateStatus201BodyStrategy","abstract":"

A strategy for validating response bodies with status code 201.

"},"Structs/ValidateStatus303BodyStrategy.html":{"name":"ValidateStatus303BodyStrategy","abstract":"

A strategy for validating response bodies with status code 303.

"},"Structs/ValidateStatus400ErrorBodyStrategy.html":{"name":"ValidateStatus400ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 400.

"},"Structs/ValidateStatus401ErrorBodyStrategy.html":{"name":"ValidateStatus401ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 401.

"},"Structs/ValidateStatus403ErrorBodyStrategy.html":{"name":"ValidateStatus403ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 403.

"},"Structs/ValidateStatus404ErrorBodyStrategy.html":{"name":"ValidateStatus404ErrorBodyStrategy","abstract":"

A strategy for validating error response bodies with status code 404.

"},"Structs/ValidateStatus410ErrorBodyStrategy.html":{"name":"ValidateStatus410ErrorBodyStrategy","abstract":"

A strategy for validating the body of a response with a status code of 410.

"},"Structs/ValidateStatus422ErrorBodyStrategy.html":{"name":"ValidateStatus422ErrorBodyStrategy","abstract":"

A strategy for validating the body of a response with a status code of 422.

"},"Structs/DefaultHeaderStrategy.html":{"name":"DefaultHeaderStrategy","abstract":"

A default strategy for decoding response headers.

"},"Structs/DefaultHeaderStrategyOptional.html":{"name":"DefaultHeaderStrategyOptional","abstract":"

A default strategy for decoding optional response headers.

"},"Protocols/ResponseHeaderDecodingStrategy.html#/s:6Postie30ResponseHeaderDecodingStrategyP8RawValueQa":{"name":"RawValue","abstract":"

The type of the raw value that will be decoded from the response header.

","parent_name":"ResponseHeaderDecodingStrategy"},"Protocols/ResponseHeaderDecodingStrategy.html#/s:6Postie30ResponseHeaderDecodingStrategyP6decode7decoder8RawValueQzs7Decoder_p_tKFZ":{"name":"decode(decoder:)","abstract":"

Decodes the raw value from the given decoder.

","parent_name":"ResponseHeaderDecodingStrategy"},"Protocols/ResponseErrorBodyDecodingStrategy.html#/s:6Postie33ResponseErrorBodyDecodingStrategyP02isC010statusCodeSbSi_tFZ":{"name":"isError(statusCode:)","abstract":"

Using the validate(statusCode:) method, you can define HTTP code(s) that should handled as an error.

","parent_name":"ResponseErrorBodyDecodingStrategy"},"Protocols/ResponseBodyDecodingStrategy.html#/s:6Postie28ResponseBodyDecodingStrategyP18allowsEmptyContent3forSbSi_tFZ":{"name":"allowsEmptyContent(for:)","abstract":"

Indicates whether the decoding should fail when no content is returned or not.

","parent_name":"ResponseBodyDecodingStrategy"},"Protocols/ResponseBodyDecodingStrategy.html#/s:6Postie28ResponseBodyDecodingStrategyP8validate10statusCodeSbSi_tFZ":{"name":"validate(statusCode:)","abstract":"

Validates the HTTP status code to determine if it is within the acceptable range.

","parent_name":"ResponseBodyDecodingStrategy"},"Protocols/Request.html#/s:6Postie7RequestP8ResponseQa":{"name":"Response","abstract":"

The associated type representing the response type for the request.

","parent_name":"Request"},"Protocols/QueryItemValue.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","abstract":"

The serialized value of the query item.

","parent_name":"QueryItemValue"},"Protocols/QueryItemValue.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","abstract":"

Indicates whether the query item is a collection.

","parent_name":"QueryItemValue"},"Protocols/QueryItemValue.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","abstract":"

Iterates over the elements of the collection.

","parent_name":"QueryItemValue"},"Protocols/OptionalType.html#/s:6Postie12OptionalTypeP7WrappedQa":{"name":"Wrapped","abstract":"

The type of the wrapped value.

","parent_name":"OptionalType"},"Protocols/OptionalType.html#/s:6Postie12OptionalTypeP4nonexvpZ":{"name":"none","abstract":"

The nil value of the optional type.

","parent_name":"OptionalType"},"Protocols/RequestPathParameterValue.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","abstract":"

The serialized value of the path parameter.

","parent_name":"RequestPathParameterValue"},"Protocols/URLSessionProvider.html#/s:6Postie18URLSessionProviderP4send10urlRequest7Combine12AnyPublisherVy10Foundation4DataV4data_So13NSURLResponseC8responsetAI8URLErrorVGAI10URLRequestV_tF":{"name":"send(urlRequest:)","abstract":"

Sends a URL request using Combine and returns a publisher that emits the response.

","parent_name":"URLSessionProvider"},"Protocols/URLSessionProvider.html#/s:6Postie18URLSessionProviderP4send10urlRequest10completiony10Foundation10URLRequestV_yAG4DataVSg_So13NSURLResponseCSgs5Error_pSgtctF":{"name":"send(urlRequest:completion:)","abstract":"

Sends a URL request using a callback to handle the response.

","parent_name":"URLSessionProvider"},"Protocols/URLSessionProvider.html#/s:6Postie18URLSessionProviderP4send10urlRequest10Foundation4DataV_So13NSURLResponseCtAF10URLRequestV_tYaKF":{"name":"send(urlRequest:)","abstract":"

Sends a URL request using async-await and returns the response.

","parent_name":"URLSessionProvider"},"Protocols/RequestHeaderValue.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","abstract":"

The serialized value of the header.

","parent_name":"RequestHeaderValue"},"Protocols/XMLFormatProvider.html#/s:6Postie17XMLFormatProviderP6formatAA13APIDataFormatOvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .xml

","parent_name":"XMLFormatProvider"},"Protocols/PlainFormatProvider.html#/s:6Postie19PlainFormatProviderP6formatAA07APIDataC0OvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .plain

","parent_name":"PlainFormatProvider"},"Protocols/JSONFormatProvider.html#/s:6Postie18JSONFormatProviderP6formatAA13APIDataFormatOvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .json

","parent_name":"JSONFormatProvider"},"Protocols/FormURLEncodedFormatProvider.html#/s:6Postie28FormURLEncodedFormatProviderP6formatAA07APIDataD0OvpZ":{"name":"format","abstract":"

Format of data, default extension is set to .formURLEncoded

","parent_name":"FormURLEncodedFormatProvider"},"Protocols/XMLBodyProvider.html#/s:6Postie15XMLBodyProviderP4BodyQa":{"name":"Body","abstract":"

The associated type representing the body of the XML data.

","parent_name":"XMLBodyProvider"},"Protocols/XMLBodyProvider.html#/s:6Postie15XMLBodyProviderP4body4BodyQzvp":{"name":"body","abstract":"

The body of the XML data.

","parent_name":"XMLBodyProvider"},"Protocols/PlainBodyProvider.html#/s:6Postie17PlainBodyProviderP4bodySSvp":{"name":"body","abstract":"

The body of the plain text data.

","parent_name":"PlainBodyProvider"},"Protocols/PlainBodyProvider.html#/s:6Postie17PlainBodyProviderP8encodingSS10FoundationE8EncodingVvp":{"name":"encoding","abstract":"

The encoding used for the plain text data.

","parent_name":"PlainBodyProvider"},"Protocols/JSONBodyProvider.html#/s:6Postie16JSONBodyProviderP4BodyQa":{"name":"Body","abstract":"

The type of the body to be encoded.

","parent_name":"JSONBodyProvider"},"Protocols/JSONBodyProvider.html#/s:6Postie16JSONBodyProviderP19keyEncodingStrategy10Foundation11JSONEncoderC03KeyeF0Ovp":{"name":"keyEncodingStrategy","abstract":"

The key encoding strategy to use for JSON encoding.

","parent_name":"JSONBodyProvider"},"Protocols/JSONBodyProvider.html#/s:6Postie16JSONBodyProviderP4body4BodyQzvp":{"name":"body","abstract":"

The body to be encoded.

","parent_name":"JSONBodyProvider"},"Protocols/FormURLEncodedBodyProvider.html#/s:6Postie26FormURLEncodedBodyProviderP0D0Qa":{"name":"Body","abstract":"

The associated type representing the body of the form URL encoded data.

","parent_name":"FormURLEncodedBodyProvider"},"Protocols/FormURLEncodedBodyProvider.html#/s:6Postie26FormURLEncodedBodyProviderP4body0D0Qzvp":{"name":"body","abstract":"

The body of the form URL encoded data.

","parent_name":"FormURLEncodedBodyProvider"},"Protocols/FormURLEncodedBodyProvider.html":{"name":"FormURLEncodedBodyProvider","abstract":"

A provider for form URL encoded body data.

"},"Protocols/JSONBodyProvider.html":{"name":"JSONBodyProvider","abstract":"

A protocol that provides the body and key encoding strategy for JSON encoding.

"},"Protocols/PlainBodyProvider.html":{"name":"PlainBodyProvider","abstract":"

A provider for plain text body data.

"},"Protocols/XMLBodyProvider.html":{"name":"XMLBodyProvider","abstract":"

A provider for XML body data.

"},"Protocols/FormURLEncodedFormatProvider.html":{"name":"FormURLEncodedFormatProvider","abstract":"

A type that has a default format of form-url-encoding

"},"Protocols/JSONFormatProvider.html":{"name":"JSONFormatProvider","abstract":"

A type that has a default format of form-url-encoding

"},"Protocols/PlainFormatProvider.html":{"name":"PlainFormatProvider","abstract":"

A type that has a default format of plain text

"},"Protocols/XMLFormatProvider.html":{"name":"XMLFormatProvider","abstract":"

A type that has a default format of xml

"},"Protocols/RequestHeaderValue.html":{"name":"RequestHeaderValue","abstract":"

A type that can be used as a value for an HTTP header.

"},"Protocols/URLSessionProvider.html":{"name":"URLSessionProvider","abstract":"

A protocol that provides methods for sending URL requests using different mechanisms.

"},"Protocols/RequestPathParameterValue.html":{"name":"RequestPathParameterValue","abstract":"

A type that can be used as a value for a request path parameter.

"},"Protocols/OptionalType.html":{"name":"OptionalType","abstract":"

A type that can be used as a value for a query item.

"},"Protocols/QueryItemValue.html":{"name":"QueryItemValue","abstract":"

A type that can be used as a value for a query item.

"},"Protocols/Request.html":{"name":"Request","abstract":"

Protocol used to define a response type to a given request type.

"},"Protocols/ResponseBodyDecodingStrategy.html":{"name":"ResponseBodyDecodingStrategy","abstract":"

A protocol for defining strategies for handling response bodies.

"},"Protocols/ResponseErrorBodyDecodingStrategy.html":{"name":"ResponseErrorBodyDecodingStrategy","abstract":"

A protocol for defining strategies for handling error response bodies.

"},"Protocols/ResponseHeaderDecodingStrategy.html":{"name":"ResponseHeaderDecodingStrategy","abstract":"

A protocol for defining strategies for decoding response headers.

"},"Extensions/Range.html#/s:Sn6PostieAA14HTTPStatusCodeORszrlE2teoiySbSnyACG_SitFZ":{"name":"~=(_:_:)","abstract":"

Checks if a value is within a range of HTTP status codes.

","parent_name":"Range"},"Extensions/ResponseErrorBody/Status400.html":{"name":"Status400","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 400.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status401.html":{"name":"Status401","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 401.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status403.html":{"name":"Status403","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 403.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status404.html":{"name":"Status404","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 404.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status410.html":{"name":"Status410","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 410.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseErrorBody/Status422.html":{"name":"Status422","abstract":"

A type alias for ResponseErrorBodyWrapper with a status code validation strategy for status code 422.

","parent_name":"ResponseErrorBody"},"Extensions/ResponseBody/OptionalContent.html":{"name":"OptionalContent","abstract":"

A type alias for ResponseBodyWrapper with an optional content strategy.

","parent_name":"ResponseBody"},"Extensions/ResponseBody/Status200.html":{"name":"Status200","abstract":"

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 200.

","parent_name":"ResponseBody"},"Extensions/ResponseBody/Status201.html":{"name":"Status201","abstract":"

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 201.

","parent_name":"ResponseBody"},"Extensions/ResponseBody/Status303.html":{"name":"Status303","abstract":"

A type alias for ResponseBodyWrapper with a status code validation strategy for status code 303.

","parent_name":"ResponseBody"},"Extensions/Double.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Double"},"Extensions/Double.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Double"},"Extensions/Double.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Double"},"Extensions/Int64.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int64"},"Extensions/Int32.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int32"},"Extensions/Int16.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int16"},"Extensions/URLSession.html#/s:6Postie18URLSessionProviderP4send10urlRequest7Combine12AnyPublisherVy10Foundation4DataV4data_So13NSURLResponseC8responsetAI8URLErrorVGAI10URLRequestV_tF":{"name":"send(urlRequest:)","parent_name":"URLSession"},"Extensions/URLSession.html#/s:6Postie18URLSessionProviderP4send10urlRequest10completiony10Foundation10URLRequestV_yAG4DataVSg_So13NSURLResponseCSgs5Error_pSgtctF":{"name":"send(urlRequest:completion:)","parent_name":"URLSession"},"Extensions/URLSession.html#/s:6Postie18URLSessionProviderP4send10urlRequest10Foundation4DataV_So13NSURLResponseCtAF10URLRequestV_tYaKF":{"name":"send(urlRequest:)","parent_name":"URLSession"},"Extensions/Bool.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"Bool"},"Extensions/Bool.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Bool"},"Extensions/Bool.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Bool"},"Extensions/Bool.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Bool"},"Extensions/Int.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"Int"},"Extensions/Int.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Int"},"Extensions/Int.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Int"},"Extensions/Int.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Int"},"Extensions/Int.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Int"},"Extensions/Optional.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Optional"},"Extensions/Optional.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Optional"},"Extensions/String/Encoding.html":{"name":"Encoding","abstract":"

Extension to make String.Encoding conform to Encodable

","parent_name":"String"},"Extensions/String.html#/s:6Postie18RequestHeaderValueP010serializedcD0SSSgvp":{"name":"serializedHeaderValue","parent_name":"String"},"Extensions/String.html#/s:6Postie25RequestPathParameterValueP10serializedSSvp":{"name":"serialized","parent_name":"String"},"Extensions/String.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"String"},"Extensions/String.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"String"},"Extensions/String.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"String"},"Extensions/Set.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Set"},"Extensions/Set.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Set"},"Extensions/Set.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Set"},"Extensions/Array.html#/s:6Postie14QueryItemValueP010serializedbC0SSSgvp":{"name":"serializedQueryItem","parent_name":"Array"},"Extensions/Array.html#/s:6Postie14QueryItemValueP12isCollectionSbvp":{"name":"isCollection","parent_name":"Array"},"Extensions/Array.html#/s:6Postie14QueryItemValueP17iterateCollectionyyyAaB_pXEF":{"name":"iterateCollection(_:)","parent_name":"Array"},"Extensions/PlainDecodable.html#/s:6Postie19PlainFormatProviderP6formatAA07APIDataC0OvpZ":{"name":"format","parent_name":"PlainDecodable"},"Extensions/PlainDecodable.html":{"name":"PlainDecodable"},"Extensions/Array.html":{"name":"Array"},"Extensions/Set.html":{"name":"Set"},"Extensions/String.html":{"name":"String"},"Extensions/Optional.html":{"name":"Optional"},"Extensions/Int.html":{"name":"Int"},"Extensions/Bool.html":{"name":"Bool"},"Extensions/URLSession.html":{"name":"URLSession"},"Extensions/Int16.html":{"name":"Int16"},"Extensions/Int32.html":{"name":"Int32"},"Extensions/Int64.html":{"name":"Int64"},"Extensions/Double.html":{"name":"Double"},"Extensions/ResponseBody.html":{"name":"ResponseBody"},"Extensions/ResponseErrorBody.html":{"name":"ResponseErrorBody"},"Extensions/Range.html":{"name":"Range"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8continueyA2CmF":{"name":"continue","abstract":"

The server has received the request headers and the client should proceed to send the request body (in the","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18switchingProtocolsyA2CmF":{"name":"switchingProtocols","abstract":"

The requester has asked the server to switch protocols and the server has agreed to do so.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10processingyA2CmF":{"name":"processing","abstract":"

A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10earlyHintsyA2CmF":{"name":"earlyHints","abstract":"

Used to return some response headers before final HTTP message.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO2okyA2CmF":{"name":"ok","abstract":"

Standard response for successful HTTP requests.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO7createdyA2CmF":{"name":"created","abstract":"

The request has been fulfilled, resulting in the creation of a new resource.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8acceptedyA2CmF":{"name":"accepted","abstract":"

The request has been accepted for processing, but the processing has not been completed.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO27nonAuthoritativeInformationyA2CmF":{"name":"nonAuthoritativeInformation","abstract":"

The server is a transforming proxy (e.g.a Web accelerator) that received a 200 OK from its origin, but is returning a","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO9noContentyA2CmF":{"name":"noContent","abstract":"

The server successfully processed the request, and is not returning any content.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO12resetContentyA2CmF":{"name":"resetContent","abstract":"

The server successfully processed the request, asks that the requester reset its document view, and is not returning any content.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14partialContentyA2CmF":{"name":"partialContent","abstract":"

The server is delivering only part of the resource (byte serving) due to a range header sent by the client.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11multiStatusyA2CmF":{"name":"multiStatus","abstract":"

The message body that follows is by default an XML message and can contain a number of separate response codes,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15alreadyReportedyA2CmF":{"name":"alreadyReported","abstract":"

The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO6IMusedyA2CmF":{"name":"IMused","abstract":"

The server has fulfilled a request for the resource, and the response is a representation of the result of one or more","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15multipleChoicesyA2CmF":{"name":"multipleChoices","abstract":"

Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO16movedPermanentlyyA2CmF":{"name":"movedPermanently","abstract":"

This and all future requests should be directed to the given URI.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO5foundyA2CmF":{"name":"found","abstract":"

Tells the client to look at (browse to) another URL (Previously “Moved temporarily”)

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8seeOtheryA2CmF":{"name":"seeOther","abstract":"

The response to the request can be found under another URI using the GET method.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11notModifiedyA2CmF":{"name":"notModified","abstract":"

Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8useProxyyA2CmF":{"name":"useProxy","abstract":"

The requested resource is available only through a proxy, the address for which is provided in the response.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11switchProxyyA2CmF":{"name":"switchProxy","abstract":"

No longer used.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO17temporaryRedirectyA2CmF":{"name":"temporaryRedirect","abstract":"

In this case, the request should be repeated with another URI; however, future requests should still use the original URI.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO17permanentRedirectyA2CmF":{"name":"permanentRedirect","abstract":"

The request and all future requests should be repeated using another URI.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10badRequestyA2CmF":{"name":"badRequest","abstract":"

The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO12unauthorizedyA2CmF":{"name":"unauthorized","abstract":"

Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15paymentRequiredyA2CmF":{"name":"paymentRequired","abstract":"

Reserved for future use.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO9forbiddenyA2CmF":{"name":"forbidden","abstract":"

The request contained valid data and was understood by the server, but the server is refusing action.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8notFoundyA2CmF":{"name":"notFound","abstract":"

The requested resource could not be found but may be available in the future.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO16methodNotAllowedyA2CmF":{"name":"methodNotAllowed","abstract":"

A request method is not supported for the requested resource

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO13notAcceptableyA2CmF":{"name":"notAcceptable","abstract":"

The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO27proxyAuthenticationRequiredyA2CmF":{"name":"proxyAuthenticationRequired","abstract":"

The client must first authenticate itself with the proxy.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14requestTimeoutyA2CmF":{"name":"requestTimeout","abstract":"

The server timed out waiting for the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8conflictyA2CmF":{"name":"conflict","abstract":"

Indicates that the request could not be processed because of conflict in the current state of the resource,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO4goneyA2CmF":{"name":"gone","abstract":"

Indicates that the resource requested is no longer available and will not be available again.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14lengthRequiredyA2CmF":{"name":"lengthRequired","abstract":"

The request did not specify the length of its content, which is required by the requested resource.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18preconditionFailedyA2CmF":{"name":"preconditionFailed","abstract":"

The server does not meet one of the preconditions that the requester put on the request header fields.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15payloadTooLargeyA2CmF":{"name":"payloadTooLarge","abstract":"

The request is larger than the server is willing or able to process.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10uriTooLongyA2CmF":{"name":"uriTooLong","abstract":"

The URI provided was too long for the server to process.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO20unsupportedMediaTypeyA2CmF":{"name":"unsupportedMediaType","abstract":"

The request entity has a media type which the server or resource does not support.","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19rangeNotSatisfiableyA2CmF":{"name":"rangeNotSatisfiable","abstract":"

The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO17expectationFailedyA2CmF":{"name":"expectationFailed","abstract":"

The server cannot meet the requirements of the Expect request-header field.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO9imATeapotyA2CmF":{"name":"imATeapot","abstract":"

This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18misdirectedRequestyA2CmF":{"name":"misdirectedRequest","abstract":"

The request was directed at a server that is not able to produce a response (for example because of connection reuse).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19unprocessableEntityyA2CmF":{"name":"unprocessableEntity","abstract":"

The request was well-formed but was unable to be followed due to semantic errors.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO6lockedyA2CmF":{"name":"locked","abstract":"

The resource that is being accessed is locked.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO16failedDependencyyA2CmF":{"name":"failedDependency","abstract":"

The request failed because it depended on another request and that request failed (e.g., a PROPPATCH).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO8tooEarlyyA2CmF":{"name":"tooEarly","abstract":"

Indicates that the server is unwilling to risk processing a request that might be replayed.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15upgradeRequiredyA2CmF":{"name":"upgradeRequired","abstract":"

The client should switch to a different protocol such as TLS/1.3, given in the Upgrade header field.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO20preconditionRequiredyA2CmF":{"name":"preconditionRequired","abstract":"

The origin server requires the request to be conditional.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO15tooManyRequestsyA2CmF":{"name":"tooManyRequests","abstract":"

The user has sent too many requests in a given amount of time.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO27requestHeaderFieldsTooLargeyA2CmF":{"name":"requestHeaderFieldsTooLarge","abstract":"

The server is unwilling to process the request because either an individual header field, or all the header fields collectively,","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO26unavailableForLegalReasonsyA2CmF":{"name":"unavailableForLegalReasons","abstract":"

A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19internalServerErroryA2CmF":{"name":"internalServerError","abstract":"

A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14notImplementedyA2CmF":{"name":"notImplemented","abstract":"

The server either does not recognize the request method, or it lacks the ability to fulfil the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO10badGatewayyA2CmF":{"name":"badGateway","abstract":"

The server was acting as a gateway or proxy and received an invalid response from the upstream server.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO18serviceUnavailableyA2CmF":{"name":"serviceUnavailable","abstract":"

The server cannot handle the request (because it is overloaded or down for maintenance).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO14gatewayTimeoutyA2CmF":{"name":"gatewayTimeout","abstract":"

The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO23httpVersionNotSupportedyA2CmF":{"name":"httpVersionNotSupported","abstract":"

The server does not support the HTTP protocol version used in the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO21variantAlsoNegotiatesyA2CmF":{"name":"variantAlsoNegotiates","abstract":"

Transparent content negotiation for the request results in a circular reference.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO19insufficientStorageyA2CmF":{"name":"insufficientStorage","abstract":"

The server is unable to store the representation needed to complete the request.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO12loopDetectedyA2CmF":{"name":"loopDetected","abstract":"

The server detected an infinite loop while processing the request (sent instead of 208 Already Reported).

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO11notExtendedyA2CmF":{"name":"notExtended","abstract":"

Further extensions to the request are required for the server to fulfil it.

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:6Postie14HTTPStatusCodeO29networkAuthenticationRequiredyA2CmF":{"name":"networkAuthenticationRequired","abstract":"

The client needs to authenticate to gain network

","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SL1goiySbx_xtFZ":{"name":">(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SL2geoiySbx_xtFZ":{"name":">=(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPStatusCode.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"HTTPStatusCode"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO3getyA2CmF":{"name":"get","abstract":"

The GET method requests a representation of the specified resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO4headyA2CmF":{"name":"head","abstract":"

The HEAD method asks for a response identical to that of a GETrequest, but without the response body.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO4postyA2CmF":{"name":"post","abstract":"

The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO3putyA2CmF":{"name":"put","abstract":"

The PUT method replaces all current representations of the target resource with the request payload.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO6deleteyA2CmF":{"name":"delete","abstract":"

The DELETE method deletes the specified resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO7connectyA2CmF":{"name":"connect","abstract":"

The CONNECT method establishes a tunnel to the server identified by the target resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO7optionsyA2CmF":{"name":"options","abstract":"

The OPTIONS method is used to describe the communication options for the target resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO5traceyA2CmF":{"name":"trace","abstract":"

The TRACE method performs a message loop-back test along the path to the target resource.

","parent_name":"HTTPMethod"},"Enums/HTTPMethod.html#/s:6Postie10HTTPMethodO5patchyA2CmF":{"name":"patch","abstract":"

The PATCH method is used to apply partial modifications to a resource.

","parent_name":"HTTPMethod"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO5plainyA2CmF":{"name":"plain","abstract":"

Plain text format.

","parent_name":"APIDataFormat"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO4jsonyA2CmF":{"name":"json","abstract":"

JSON format.

","parent_name":"APIDataFormat"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO14formURLEncodedyA2CmF":{"name":"formURLEncoded","abstract":"

Form URL encoded format.

","parent_name":"APIDataFormat"},"Enums/APIDataFormat.html#/s:6Postie13APIDataFormatO3xmlyA2CmF":{"name":"xml","abstract":"

XML format.

","parent_name":"APIDataFormat"},"Enums/APIError.html#/s:6Postie8APIErrorO13responseErroryACSi_10Foundation4DataVtcACmF":{"name":"responseError(statusCode:data:)","abstract":"

Indicates a response error with a specific status code and data.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO15invalidResponseyA2CmF":{"name":"invalidResponse","abstract":"

Indicates an invalid response.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO8urlErroryAC10Foundation8URLErrorVcACmF":{"name":"urlError(_:)","abstract":"

Indicates a URL error.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO13decodingErroryACs08DecodingD0OcACmF":{"name":"decodingError(_:)","abstract":"

Indicates a decoding error.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO23failedToEncodePlainTextyACSS10FoundationE8EncodingV_tcACmF":{"name":"failedToEncodePlainText(encoding:)","abstract":"

Indicates a failure to encode plain text with a specific encoding.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO7unknownyACs5Error_p_tcACmF":{"name":"unknown(error:)","abstract":"

Indicates an unknown error.

","parent_name":"APIError"},"Enums/APIError.html#/s:6Postie8APIErrorO16errorDescriptionSSSgvp":{"name":"errorDescription","abstract":"

A localized message describing what error occurred.

","parent_name":"APIError"},"Enums/APIError.html":{"name":"APIError","abstract":"

Represents various errors that can occur when interacting with the API.

"},"Enums/APIDataFormat.html":{"name":"APIDataFormat","abstract":"

Represents the format of API data.

"},"Enums/HTTPMethod.html":{"name":"HTTPMethod","abstract":"

Common HTTP Methods

"},"Enums/HTTPStatusCode.html":{"name":"HTTPStatusCode","abstract":"

Common HTTP Status Codes

"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC7sessionAA18URLSessionProvider_pvp":{"name":"session","abstract":"

The URL session provider used for sending requests.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC3url10Foundation3URLVvp":{"name":"url","abstract":"

The base URL for the API requests.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC10pathPrefixSSSgvp":{"name":"pathPrefix","abstract":"

An optional path prefix to be appended to the base URL.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC3url10pathPrefix7sessionAC10Foundation3URLV_SSSgAA18URLSessionProvider_ptcfc":{"name":"init(url:pathPrefix:session:)","abstract":"

Initializes a new instance of HTTPAPIClient with the specified URL, path prefix, and session provider.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseQzs5Error_pGctAA7RequestRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseAA7RequestPQzs5Error_pGctAA16JSONBodyProviderRzAA010JSONFormatO0RzAaMRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request with a JSON body using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseAA7RequestPQzs5Error_pGctAA26FormURLEncodedBodyProviderRzAA0no6FormatQ0RzAaMRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request with a Form URL Encoded body using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4send_9receiveOn8callbackyx_So17OS_dispatch_queueCSgys6ResultOy8ResponseAA7RequestPQzs5Error_pGctAA17PlainBodyProviderRzAA0n6FormatP0RzAaMRzlF":{"name":"send(_:receiveOn:callback:)","abstract":"

Sends an HTTP API request with a plain text body using a callback to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseQzxYaKAA7RequestRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseAA7RequestPQzxYaKAA16JSONBodyProviderRzAA010JSONFormatG0RzAaFRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a JSON body using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseAA7RequestPQzxYaKAA26FormURLEncodedBodyProviderRzAA0fg6FormatI0RzAaFRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a Form URL Encoded body using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy8ResponseAA7RequestPQzxYaKAA17PlainBodyProviderRzAA0f6FormatH0RzAaFRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a plain text body using async-await to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseQzs5Error_pGxAA7RequestRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseAA7RequestPQzs5Error_pGxAA16JSONBodyProviderRzAA010JSONFormatK0RzAaIRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a JSON body using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseAA7RequestPQzs5Error_pGxAA26FormURLEncodedBodyProviderRzAA0jk6FormatM0RzAaIRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a Form URL Encoded body using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/HTTPAPIClient.html#/s:6Postie13HTTPAPIClientC4sendy7Combine12AnyPublisherVy8ResponseAA7RequestPQzs5Error_pGxAA17PlainBodyProviderRzAA0j6FormatL0RzAaIRzlF":{"name":"send(_:)","abstract":"

Sends an HTTP API request with a plain text body using Combine to handle the response.

","parent_name":"HTTPAPIClient"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC7baseURLAC10Foundation0E0V_tcfc":{"name":"init(baseURL:)","abstract":"

Initializes a new instance of RequestEncoder with the specified base URL.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC6encodey10Foundation10URLRequestVxKSERzlF":{"name":"encode(_:)","abstract":"

Encodes an HTTP request into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC10encodeJson7request10Foundation10URLRequestVx_tKAA16JSONBodyProviderRzAA010JSONFormatJ0RzSERzlF":{"name":"encodeJson(request:)","abstract":"

Encodes an HTTP request with a JSON body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC20encodeFormURLEncoded7request10Foundation10URLRequestVx_tKAA0eF12BodyProviderRzAA0ef6FormatK0RzSERzlF":{"name":"encodeFormURLEncoded(request:)","abstract":"

Encodes an HTTP request with a Form URL Encoded body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC11encodePlain7request10Foundation10URLRequestVx_tKAA0E12BodyProviderRzAA0e6FormatJ0RzSERzlF":{"name":"encodePlain(request:)","abstract":"

Encodes an HTTP request with a plain text body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/RequestEncoder.html#/s:6Postie14RequestEncoderC9encodeXML7request10Foundation10URLRequestVx_tKAA15XMLBodyProviderRzAA09XMLFormatJ0RzSERzlF":{"name":"encodeXML(request:)","abstract":"

Encodes an HTTP request with an XML body into a URLRequest.

","parent_name":"RequestEncoder"},"Classes/ResponseDecoder.html#/s:6Postie15ResponseDecoderC6decode_4fromxxm_10Foundation4DataV4data_So17NSHTTPURLResponseC8responsettKSeRzlF":{"name":"decode(_:from:)","abstract":"

Decodes an HTTP response into the specified type.

","parent_name":"ResponseDecoder"},"Classes/ResponseDecoder.html":{"name":"ResponseDecoder","abstract":"

A class responsible for decoding HTTP responses into specified types.

"},"Classes/RequestEncoder.html":{"name":"RequestEncoder","abstract":"

A class responsible for encoding HTTP requests into various formats.

"},"Classes/HTTPAPIClient.html":{"name":"HTTPAPIClient","abstract":"

A class responsible for sending HTTP API requests and handling responses.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"},"Typealiases.html":{"name":"Type Aliases","abstract":"

The following type aliases are available globally.

"}} \ No newline at end of file diff --git a/docs/undocumented.json b/docs/undocumented.json new file mode 100644 index 0000000..c4e01e2 --- /dev/null +++ b/docs/undocumented.json @@ -0,0 +1,4 @@ +{ + "warnings": [], + "source_directory": "/Volumes/Developer/kula/Postie" +} \ No newline at end of file