dropbox.common – Common
- class dropbox.common.DropboxDuration(seconds=None, nanos=None)
Bases:
Struct- __init__(seconds=None, nanos=None)
- nanos
- seconds
- class dropbox.common.PathRoot(tag, value=None)
Bases:
UnionThis 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 correspondingget_*method.- Variables:
PathRoot.home – Paths are relative to the authenticating user’s home namespace, whether or not that user belongs to a team.
PathRoot.root (str) – Paths are relative to the authenticating user’s root namespace (This results in
PathRootError.invalid_rootif the user’s root namespace has changed.).PathRoot.namespace_id (str) – Paths are relative to given namespace id (This results in
PathRootError.no_permissionif you don’t have access to this namespace.).
- get_namespace_id()
Paths are relative to given namespace id (This results in
PathRootError.no_permissionif you don’t have access to this namespace.).Only call this if
is_namespace_id()is true.- Return type:
str
- get_root()
Paths are relative to the authenticating user’s root namespace (This results in
PathRootError.invalid_rootif the user’s root namespace has changed.).Only call this if
is_root()is true.- Return type:
str
- home = PathRoot('home', None)
- is_home()
Check if the union tag is
home.- Return type:
bool
- is_namespace_id()
Check if the union tag is
namespace_id.- Return type:
bool
- is_other()
Check if the union tag is
other.- Return type:
bool
- is_root()
Check if the union tag is
root.- Return type:
bool
- classmethod namespace_id(val)
Create an instance of this class set to the
namespace_idtag with valueval.- Parameters:
val (str)
- Return type:
- other = PathRoot('other', None)
- class dropbox.common.PathRootError(tag, value=None)
Bases:
UnionThis 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 correspondingget_*method.- Variables:
PathRootError.invalid_root (RootInfo) – The root namespace id in Dropbox-API-Path-Root header is not valid. The value of this error is the user’s latest root info.
PathRootError.no_permission – You don’t have permission to access the namespace id in Dropbox-API-Path-Root header.
- get_invalid_root()
The root namespace id in Dropbox-API-Path-Root header is not valid. The value of this error is the user’s latest root info.
Only call this if
is_invalid_root()is true.- Return type:
- classmethod invalid_root(val)
Create an instance of this class set to the
invalid_roottag with valueval.- Parameters:
val (RootInfo)
- Return type:
- is_invalid_root()
Check if the union tag is
invalid_root.- 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
- no_permission = PathRootError('no_permission', None)
- other = PathRootError('other', None)
- class dropbox.common.RootInfo(root_namespace_id=None, home_namespace_id=None)
Bases:
StructInformation about current user’s root.
- Variables:
RootInfo.root_namespace_id – The namespace ID for user’s root namespace. It will be the namespace ID of the shared team root if the user is member of a team with a separate team root, or the user root if user is member of a team with separate distinct roots for users. Otherwise it will be the same as
RootInfo.home_namespace_id.RootInfo.home_namespace_id – The namespace ID for user’s home namespace.
- __init__(root_namespace_id=None, home_namespace_id=None)
- home_namespace_id
- root_namespace_id
- class dropbox.common.TeamRootInfo(root_namespace_id=None, home_namespace_id=None, home_path=None)
Bases:
RootInfoRoot info when user is member of a team with a separate root namespace ID.
- Variables:
TeamRootInfo.home_path – The path for user’s home directory under the shared team root.
- __init__(root_namespace_id=None, home_namespace_id=None, home_path=None)
- home_path
- class dropbox.common.UserRootInfo(root_namespace_id=None, home_namespace_id=None, home_path=None)
Bases:
RootInfoRoot info when user is not member of a team or the user is a member of a team and the team does not have a separate root namespace.
- Variables:
UserRootInfo.home_path – The path for user’s home directory under the distinct user root.
- __init__(root_namespace_id=None, home_namespace_id=None, home_path=None)
- home_path