PCloudAPIUploadTaskBuilder
public struct PCloudAPIUploadTaskBuilder
Utility struct containing logic for building UploadTask
instances for PCloudAPIMethod
s.
-
Undocumented
Declaration
Swift
public init(hostProvider: HostProvider, authenticator: Authenticator, defaultTimeoutInterval: TimeInterval? = nil, operationBuilder: @escaping (Upload.Request) -> UploadOperation)
-
Creates an
UploadTask
instance executing a specific API method.Declaration
Swift
public func createTask<T: PCloudAPIMethod>(for method: T, with body: Upload.Request.Body, hostNameOverride: String? = nil, timeoutInterval: TimeInterval? = nil) -> UploadTask<T>
Parameters
method
A method for the task to execute.
body
The data to upload.
hostNameOverride
If non-
nil
, this will override the default host name from the host provider.timeoutInterval
The timeout interval for this call task. If
nil
, the default timeout interval will be used.Return Value
An instance of
UploadTask
in suspended state.