dropbox.common
– Common
- class dropbox.common.PathRoot(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 correspondingget_*
method.- Variables:
common.PathRoot.home – Paths are relative to the authenticating user’s home namespace, whether or not that user belongs to a team.
common.PathRoot.root (str) – Paths are relative to the authenticating user’s root namespace (This results in :field:`PathRootError.invalid_root` if the user’s root namespace has changed.).
common.PathRoot.namespace_id (str) – Paths are relative to given namespace id (This results in :field:`PathRootError.no_permission` if you don’t have access to this namespace.).
- get_namespace_id()
Paths are relative to given namespace id (This results in
PathRootError.no_permission
if 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_root
if 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_id
tag with valueval
.- Parameters:
val (str) –
- Return type:
- other = PathRoot('other', None)
- class dropbox.common.PathRootError(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 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.
common.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_root
tag 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:
Struct
Information about current user’s root.
- Variables:
common.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. Otherwise it will be same as
RootInfo.home_namespace_id
.common.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:
RootInfo
Root info when user is member of a team with a separate root namespace ID.
- Variables:
common.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