Protocols

The following protocols are available globally.

  • APIAuthorization defines all the properties and methods a class must contain to be used as an authorization for an APIRequest.

    See more

    Declaration

    Swift

    public protocol APIAuthorization
  • Defines the methods required for an object to be returned by an APIService

    See more

    Declaration

    Swift

    public protocol APIReturnable
  • APIService defines all the properties and methods a class must contain to be used as a service in an APIRequest.

    A class that conforms to APIService should also define all the endpoints relevent to that service.

    An endpoint might look like:

    open class func getUser(byId id: String) -> APIRequest<ReturnType> {
        return APIRequest<ReturnType>(endpoint: "/users", params: nil, body: ["id": id], method: .GET)
    }
    
    See more

    Declaration

    Swift

    public protocol APIService