DropboxClient
open class DropboxClient : DropboxBase
The client for the User API. Call routes using the namespaces inside this object (inherited from parent).
-
Initialize a client with a static accessToken string. Use this method if your access token is long-lived.
Declaration
Swift
public convenience init(accessToken: String, selectUser: String? = nil, pathRoot: Common.PathRoot? = nil)
Parameters
accessToken
Static access token string.
selectUser
Id of a team member. This allows the api client to makes call on a team member’s behalf.
pathRoot
User’s path root.
-
Initialize a client with an
AccessTokenProvider
. Use this method if your access token is short-lived. SeeShortLivedAccessTokenProvider
for a default implementation.Declaration
Swift
public convenience init( accessTokenProvider: AccessTokenProvider, selectUser: String? = nil, pathRoot: Common.PathRoot? = nil )
Parameters
accessTokenProvider
Access token provider that wraps a short-lived token and its refresh logic.
selectUser
Id of a team member. This allows the api client to makes call on a team member’s behalf.
pathRoot
User’s path root.
-
Initialize a client with an
DropboxAccessToken
.Declaration
Swift
public convenience init(accessToken: DropboxAccessToken, dropboxOauthManager: DropboxOAuthManager)
Parameters
accessToken
The token itself, could be long or short lived.
dropboxOauthManager
an oauthManager, used for creating the token provider.
-
Designated Initializer.
Declaration
Swift
public init(transportClient: DropboxTransportClient)
Parameters
transportClient
The underlying DropboxTransportClient to make API calls.
-
Creates a new DropboxClient instance with the given path root.
Declaration
Swift
open func withPathRoot(_ pathRoot: Common.PathRoot) -> DropboxClient
Parameters
pathRoot
User’s path root.
Return Value
A new DropboxClient instance for the same user but with an updated path root.