UsherAPIRequest
public class UsherAPIRequest : APIRequestType
This class conforms to APIRequestType and provides some more functionality of its own
specific to Usher Server APIs. Use this along with UsherAPITask to make calls to
Usher Server API endpoints.
-
The closure used by
responseJSON(_ completion:) -> APIRequestTyperequest completion callback.Declaration
Swift
public typealias UsherAPIRequestJSONCompletion = (_ json: JSON?, _ error: UsherErrorProtocol?) -> () -
Custom response validation closure. Default implementation exists.
Declaration
Swift
public var responseValidator: Alamofire.DataRequest.Validation? { get } -
Container to store the closures.
Declaration
Swift
public var dataCompletions: [APIRequestType.APIRequestDataCompletion] -
A unique ID for the request.
Declaration
Swift
public var id: UUID -
The executing behavior.
Declaration
Swift
public var executionBehavior: <<error type>> -
A queue to turn the completion of the request on. Default is DispatchQueue.main. Default implementation exists.
Declaration
Swift
public var completionQueue: DispatchQueue -
An Alamofire
Timelineobject for obtaining the timing metrics for the complete lifecycle of the request.Declaration
Swift
public var timeline: Timeline? -
An error that resulted from the API call execution.
Declaration
Swift
public var error: UsherErrorProtocol? -
The server to use for this request. Defaults to
ServerManager.defaultServer()Declaration
Swift
public lazy var server: Server? { get set } -
The device to use for this request. Defaults to
Device.deviceForServer(ServerManager.defaultServer())Declaration
Swift
public lazy var device: Device? { get set } -
The status of the API request execution. See
APIRequestStatusfor values.Declaration
Swift
public var status: APIRequestStatus -
The configuration of type
APIRequestConfigurationType.Declaration
Swift
public var config: APIRequestConfigurationType -
Convenience API to directly initialize for one of the predefined Usher server API endpoints.
See also
UsherAPITaskDeclaration
Swift
public convenience init(for task: UsherAPITask) -
Initialize with UsherAPIRequestConfiguration
See also
UsherAPIRequestConfigurationDeclaration
Swift
public required init(with config: UsherAPIRequestConfiguration) -
A completion callback providing JSON object generated from the server response.
See also
UsherAPIRequestJSONCompletionDeclaration
Swift
@discardableResult public func responseJSON(_ completion: @escaping UsherAPIRequestJSONCompletion) -> APIRequestType -
Undocumented
Declaration
Swift
func responseValidation() -> Alamofire.DataRequest.Validation -
Undocumented
Declaration
Swift
static func recreateSessionManager()
UsherAPIRequest Class Reference