dropbox.auth – Auth

class dropbox.auth.AccessError(tag, value=None)

Bases: Union

Error occurred because the account doesn’t have permission to access the resource.

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
  • AccessError.invalid_account_type (InvalidAccountTypeError) – Current account type cannot access the resource.

  • AccessError.paper_access_denied (PaperAccessError) – Current account cannot access Paper.

get_invalid_account_type()

Current account type cannot access the resource.

Only call this if is_invalid_account_type() is true.

Return type:

InvalidAccountTypeError

get_paper_access_denied()

Current account cannot access Paper.

Only call this if is_paper_access_denied() is true.

Return type:

PaperAccessError

classmethod invalid_account_type(val)

Create an instance of this class set to the invalid_account_type tag with value val.

Parameters:

val (InvalidAccountTypeError) –

Return type:

AccessError

is_invalid_account_type()

Check if the union tag is invalid_account_type.

Return type:

bool

is_other()

Check if the union tag is other.

Return type:

bool

is_paper_access_denied()

Check if the union tag is paper_access_denied.

Return type:

bool

other = AccessError('other', None)
classmethod paper_access_denied(val)

Create an instance of this class set to the paper_access_denied tag with value val.

Parameters:

val (PaperAccessError) –

Return type:

AccessError

class dropbox.auth.AuthError(tag, value=None)

Bases: Union

Errors occurred during authentication.

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
  • auth.AuthError.invalid_access_token – The access token is invalid.

  • auth.AuthError.invalid_select_user – The user specified in ‘Dropbox-API-Select-User’ is no longer on the team.

  • auth.AuthError.invalid_select_admin – The user specified in ‘Dropbox-API-Select-Admin’ is not a Dropbox Business team admin.

  • auth.AuthError.user_suspended – The user has been suspended.

  • auth.AuthError.expired_access_token – The access token has expired.

  • AuthError.missing_scope (TokenScopeError) – The access token does not have the required scope to access the route.

  • auth.AuthError.route_access_denied – The route is not available to public.

expired_access_token = AuthError('expired_access_token', None)
get_missing_scope()

The access token does not have the required scope to access the route.

Only call this if is_missing_scope() is true.

Return type:

TokenScopeError

invalid_access_token = AuthError('invalid_access_token', None)
invalid_select_admin = AuthError('invalid_select_admin', None)
invalid_select_user = AuthError('invalid_select_user', None)
is_expired_access_token()

Check if the union tag is expired_access_token.

Return type:

bool

is_invalid_access_token()

Check if the union tag is invalid_access_token.

Return type:

bool

is_invalid_select_admin()

Check if the union tag is invalid_select_admin.

Return type:

bool

is_invalid_select_user()

Check if the union tag is invalid_select_user.

Return type:

bool

is_missing_scope()

Check if the union tag is missing_scope.

Return type:

bool

is_other()

Check if the union tag is other.

Return type:

bool

is_route_access_denied()

Check if the union tag is route_access_denied.

Return type:

bool

is_user_suspended()

Check if the union tag is user_suspended.

Return type:

bool

classmethod missing_scope(val)

Create an instance of this class set to the missing_scope tag with value val.

Parameters:

val (TokenScopeError) –

Return type:

AuthError

other = AuthError('other', None)
route_access_denied = AuthError('route_access_denied', None)
user_suspended = AuthError('user_suspended', None)
class dropbox.auth.InvalidAccountTypeError(tag, value=None)

Bases: Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
  • auth.InvalidAccountTypeError.endpoint – Current account type doesn’t have permission to access this route endpoint.

  • auth.InvalidAccountTypeError.feature – Current account type doesn’t have permission to access this feature.

endpoint = InvalidAccountTypeError('endpoint', None)
feature = InvalidAccountTypeError('feature', None)
is_endpoint()

Check if the union tag is endpoint.

Return type:

bool

is_feature()

Check if the union tag is feature.

Return type:

bool

is_other()

Check if the union tag is other.

Return type:

bool

other = InvalidAccountTypeError('other', None)
class dropbox.auth.PaperAccessError(tag, value=None)

Bases: Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
  • auth.PaperAccessError.paper_disabled – Paper is disabled.

  • auth.PaperAccessError.not_paper_user – The provided user has not used Paper yet.

is_not_paper_user()

Check if the union tag is not_paper_user.

Return type:

bool

is_other()

Check if the union tag is other.

Return type:

bool

is_paper_disabled()

Check if the union tag is paper_disabled.

Return type:

bool

not_paper_user = PaperAccessError('not_paper_user', None)
other = PaperAccessError('other', None)
paper_disabled = PaperAccessError('paper_disabled', None)
class dropbox.auth.RateLimitError(reason=None, retry_after=None)

Bases: Struct

Error occurred because the app is being rate limited.

Variables:
  • auth.RateLimitError.reason – The reason why the app is being rate limited.

  • auth.RateLimitError.retry_after – The number of seconds that the app should wait before making another request.

__init__(reason=None, retry_after=None)
reason
retry_after
class dropbox.auth.RateLimitReason(tag, value=None)

Bases: Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
  • auth.RateLimitReason.too_many_requests – You are making too many requests in the past few minutes.

  • auth.RateLimitReason.too_many_write_operations – There are currently too many write operations happening in the user’s Dropbox.

is_other()

Check if the union tag is other.

Return type:

bool

is_too_many_requests()

Check if the union tag is too_many_requests.

Return type:

bool

is_too_many_write_operations()

Check if the union tag is too_many_write_operations.

Return type:

bool

other = RateLimitReason('other', None)
too_many_requests = RateLimitReason('too_many_requests', None)
too_many_write_operations = RateLimitReason('too_many_write_operations', None)
class dropbox.auth.TokenFromOAuth1Arg(oauth1_token=None, oauth1_token_secret=None)

Bases: Struct

Variables:
  • auth.TokenFromOAuth1Arg.oauth1_token – The supplied OAuth 1.0 access token.

  • auth.TokenFromOAuth1Arg.oauth1_token_secret – The token secret associated with the supplied access token.

__init__(oauth1_token=None, oauth1_token_secret=None)
oauth1_token
oauth1_token_secret
class dropbox.auth.TokenFromOAuth1Error(tag, value=None)

Bases: Union

This class acts as a tagged union. Only one of the is_* methods will return true. To get the associated value of a tag (if one exists), use the corresponding get_* method.

Variables:
  • auth.TokenFromOAuth1Error.invalid_oauth1_token_info – Part or all of the OAuth 1.0 access token info is invalid.

  • auth.TokenFromOAuth1Error.app_id_mismatch – The authorized app does not match the app associated with the supplied access token.

app_id_mismatch = TokenFromOAuth1Error('app_id_mismatch', None)
invalid_oauth1_token_info = TokenFromOAuth1Error('invalid_oauth1_token_info', None)
is_app_id_mismatch()

Check if the union tag is app_id_mismatch.

Return type:

bool

is_invalid_oauth1_token_info()

Check if the union tag is invalid_oauth1_token_info.

Return type:

bool

is_other()

Check if the union tag is other.

Return type:

bool

other = TokenFromOAuth1Error('other', None)
class dropbox.auth.TokenFromOAuth1Result(oauth2_token=None)

Bases: Struct

Variables:

auth.TokenFromOAuth1Result.oauth2_token – The OAuth 2.0 token generated from the supplied OAuth 1.0 token.

__init__(oauth2_token=None)
oauth2_token
class dropbox.auth.TokenScopeError(required_scope=None)

Bases: Struct

Variables:

auth.TokenScopeError.required_scope – The required scope to access the route.

__init__(required_scope=None)
required_scope