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.

  • AccessError.team_access_denied – Team doesn’t have permission to access.

  • AccessError.no_permission (NoPermissionError) – Caller does not have permission to access the resource.

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_no_permission()

Caller does not have permission to access the resource.

Only call this if is_no_permission() is true.

Return type:

NoPermissionError

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_no_permission()

Check if the union tag is no_permission.

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

is_team_access_denied()

Check if the union tag is team_access_denied.

Return type:

bool

classmethod no_permission(val)

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

Parameters:

val (NoPermissionError)

Return type:

AccessError

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

team_access_denied = AccessError('team_access_denied', None)
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:
  • AuthError.invalid_access_token – The access token is invalid.

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

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

  • AuthError.user_suspended – The user has been suspended.

  • 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.

  • 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:
  • InvalidAccountTypeError.endpoint – Current account type doesn’t have permission to access this route endpoint.

  • 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.NoPermissionError(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:

NoPermissionError.unauthorized_account_id_usage (UnauthorizedAccountIdUsageError) – Current caller does not have permission to access the account information for one or more of the specified account IDs.

get_unauthorized_account_id_usage()

Current caller does not have permission to access the account information for one or more of the specified account IDs.

Only call this if is_unauthorized_account_id_usage() is true.

Return type:

UnauthorizedAccountIdUsageError

is_other()

Check if the union tag is other.

Return type:

bool

is_unauthorized_account_id_usage()

Check if the union tag is unauthorized_account_id_usage.

Return type:

bool

other = NoPermissionError('other', None)
classmethod unauthorized_account_id_usage(val)

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

Parameters:

val (UnauthorizedAccountIdUsageError)

Return type:

NoPermissionError

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:
  • PaperAccessError.paper_disabled – Paper is disabled.

  • 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:
  • RateLimitError.reason – The reason why the app is being rate limited.

  • 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:
  • RateLimitReason.too_many_requests – You are making too many requests in the past few minutes.

  • 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:
  • TokenFromOAuth1Arg.oauth1_token – The supplied OAuth 1.0 access token.

  • 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:
  • TokenFromOAuth1Error.invalid_oauth1_token_info – Part or all of the OAuth 1.0 access token info is invalid.

  • 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:

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:

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

__init__(required_scope=None)
required_scope
class dropbox.auth.UnauthorizedAccountIdUsageError(unauthorized_account_ids=None)

Bases: Struct

Variables:

UnauthorizedAccountIdUsageError.unauthorized_account_ids – The account IDs that the caller does not have permission to use.

__init__(unauthorized_account_ids=None)
unauthorized_account_ids