AliyunpanToken
public struct AliyunpanToken : Codable
extension AliyunpanToken: Hashable, Equatable
extension AliyunpanToken: CustomStringConvertible
Undocumented
-
Bearer
Declaration
Swift
public let token_type: String
-
用来获取用户信息的access_token。刷新后,旧access_token不会立即失效
Declaration
Swift
public let access_token: String
-
单次有效,用来刷新access_token,90天有效期。刷新后,返回新的refresh_token,请保存以便下一次刷新使用
Declaration
Swift
public let refresh_token: String?
-
access_token的过期时间,单位秒
Declaration
Swift
public internal(set) var expires_in: TimeInterval { get }
-
是否已过期
Declaration
Swift
public var isExpired: Bool { get }
-
Undocumented
Declaration
Swift
public init( token_type: String = "Bearer", access_token: String, refresh_token: String? = nil, expires_in: TimeInterval = .greatestFiniteMagnitude)
-
send(_:
Asynchronous) 发送请求
Throws
DecodingError
: JSON 解析错误AliyunpanAuthorizeError
: 授权错误AliyunpanServerError
: 服务端错误AliyunpanNetworkSystemError
: 网络系统错误Declaration
Swift
public func send<T>(_ command: T) async throws -> T.Response where T : AliyunpanCommand
-
发送请求
Throws
DecodingError
: JSON 解析错误AliyunpanAuthorizeError
: 授权错误AliyunpanServerError
: 服务端错误AliyunpanNetworkSystemError
: 网络系统错误Declaration
Swift
public func send<T: AliyunpanCommand>( _ command: T, completionHandle: @escaping (Result<T.Response, Error>) -> Void) where T.Response: Decodable
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var description: String { get }