Client configuration for Dropbox API calls.
Prefer building a client once and passing it via opts:
client = Noizu.Dropbox.Client.new(access_token: System.fetch_env!("DROPBOX_ACCESS_TOKEN"))
Noizu.Dropbox.Api.Users.get_current_account(client: client)When client is omitted, a default client is built from application config
(:noizu_dropbox).
Summary
Functions
Return a client acting as a team admin (Dropbox-API-Select-Admin).
Return a client acting as a team member (Dropbox-API-Select-User).
Default client from application config.
Build a client from keyword options merged over application env defaults.
Normalize API base URL (trailing slash).
Return a client with an updated access token.
Ensure the client has an access token.
Types
@type t() :: %Noizu.Dropbox.Client{ access_token: String.t() | nil, api_base: String.t(), app_key: String.t() | nil, app_secret: String.t() | nil, authorize_url: String.t(), content_base: String.t(), finch: atom(), notify_base: String.t(), oauth_base: String.t(), path_root: map() | String.t() | nil, pool_timeout: pos_integer(), receive_timeout: pos_integer(), refresh_token: String.t() | nil, select_admin: String.t() | nil, select_user: String.t() | nil }
Functions
Return a client acting as a team admin (Dropbox-API-Select-Admin).
Return a client acting as a team member (Dropbox-API-Select-User).
@spec default() :: t()
Default client from application config.
Build a client from keyword options merged over application env defaults.
Normalize API base URL (trailing slash).
Return a client with an updated access token.
@spec require_token(t()) :: {:ok, t()} | {:error, Noizu.Dropbox.Error.t()}
Ensure the client has an access token.
Returns {:ok, client} or {:error, %Noizu.Dropbox.Error{}}.