PCloudAPICallTaskBuilder
public struct PCloudAPICallTaskBuilder
Utility struct containing logic for building CallTask
instances for PCloudAPIMethod
s.
-
Undocumented
Declaration
Swift
public init(hostProvider: HostProvider, authenticator: Authenticator, defaultTimeoutInterval: TimeInterval? = nil, operationBuilder: @escaping (Call.Request) -> CallOperation)
-
Creates a
CallTask
instance executing a specific API method.Declaration
Swift
public func createTask<T: PCloudAPIMethod>(for method: T, hostNameOverride: String? = nil, timeoutInterval: TimeInterval? = nil) -> CallTask<T>
Parameters
method
A method for the task to execute.
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
CallTask
in suspended state.