Magpie.Users (Magpie v0.1.0)

Copy Markdown View Source

This namespace contains endpoints and data types for user management.

Summary

Functions

Get the current user's account.

Same as current_account/1 but returns {:ok, %Magpie.Account{}}.

Get a list of feature values that may be configured for the current account, e.g. [%{".tag" => "paper_as_files"}].

Get user account by account_id.

Get user accounts in batch by their account ids.

Same as get_account/2 but returns {:ok, %Magpie.Account{}}.

Get the current user's space usage.

Same as get_space_usage/1 but returns {:ok, %Magpie.SpaceUsage{}}.

Functions

current_account(client)

@spec current_account(Magpie.Client.t()) :: Magpie.response()

Get the current user's account.

Example

Magpie.Users.current_account client

More info at: https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account

current_account_to_struct(client)

@spec current_account_to_struct(Magpie.Client.t()) ::
  {:ok, Magpie.Account.t()} | {:error, Magpie.Error.t()}

Same as current_account/1 but returns {:ok, %Magpie.Account{}}.

features_get_values(client, features)

Get a list of feature values that may be configured for the current account, e.g. [%{".tag" => "paper_as_files"}].

More info at: https://www.dropbox.com/developers/documentation/http/documentation#users-features-get_values

get_account(client, id)

@spec get_account(Magpie.Client.t(), binary()) :: Magpie.response()

Get user account by account_id.

Example

Magpie.Users.get_account client, "dbid:..."

More info at: https://www.dropbox.com/developers/documentation/http/documentation#users-get_account

get_account_batch(client, account_ids)

@spec get_account_batch(Magpie.Client.t(), [binary()]) :: Magpie.response()

Get user accounts in batch by their account ids.

Example

Magpie.Users.get_account_batch client, ["dbid:1", "dbid:2"]

More info at: https://www.dropbox.com/developers/documentation/http/documentation#users-get_account_batch

get_account_to_struct(client, id)

@spec get_account_to_struct(Magpie.Client.t(), binary()) ::
  {:ok, Magpie.Account.t()} | {:error, Magpie.Error.t()}

Same as get_account/2 but returns {:ok, %Magpie.Account{}}.

get_space_usage(client)

@spec get_space_usage(Magpie.Client.t()) :: Magpie.response()

Get the current user's space usage.

Example

Magpie.Users.get_space_usage client

More info at: https://www.dropbox.com/developers/documentation/http/documentation#users-get_space_usage

get_space_usage_to_struct(client)

@spec get_space_usage_to_struct(Magpie.Client.t()) ::
  {:ok, Magpie.SpaceUsage.t()} | {:error, Magpie.Error.t()}

Same as get_space_usage/1 but returns {:ok, %Magpie.SpaceUsage{}}.