Commit c25bfcb5 authored by Michael Fladischer's avatar Michael Fladischer

Update upstream source from tag 'upstream/8.5.0'

Update to upstream version '8.5.0'
with Debian dir 3b2433ef8f1eee4980388c5abb1211d1fbfc0eb4
parents 56543680 b50124a7
Metadata-Version: 1.1
Name: dropbox
Version: 8.4.1
Version: 8.5.0
Summary: Official Dropbox API Client
Home-page: http://www.dropbox.com/developers
Author: Dropbox
......@@ -9,7 +9,7 @@ License: MIT License
Description: Dropbox for Python
==================
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.4.1
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.5.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
......
Dropbox for Python
==================
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.4.1
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.5.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
......
Metadata-Version: 1.1
Name: dropbox
Version: 8.4.1
Version: 8.5.0
Summary: Official Dropbox API Client
Home-page: http://www.dropbox.com/developers
Author: Dropbox
......@@ -9,7 +9,7 @@ License: MIT License
Description: Dropbox for Python
==================
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.4.1
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.5.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
......
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# @generated
# flake8: noqa
# pylint: skip-file
try:
......
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# @generated
# flake8: noqa
# pylint: skip-file
try:
......
......@@ -139,8 +139,8 @@ class DropboxBase(object):
path,
property_template_ids):
"""
Remove the specified property group from the file. To remove specific
property field key value pairs, see
Permanently removes the specified property group from the file. To
remove specific property field key value pairs, see
:meth:`file_properties_properties_update`. To update a template, see
:meth:`file_properties_templates_update_for_user` or
:meth:`file_properties_templates_update_for_team`. Templates can't be
......@@ -192,6 +192,31 @@ class DropboxBase(object):
)
return r
def file_properties_properties_search_continue(self,
cursor):
"""
Once a cursor has been retrieved from
:meth:`file_properties_properties_search`, use this to paginate through
all search results.
:param str cursor: The cursor returned by your last call to
:meth:`file_properties_properties_search` or
:meth:`file_properties_properties_search_continue`.
:rtype: :class:`dropbox.file_properties.PropertiesSearchResult`
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.file_properties.PropertiesSearchContinueError`
"""
arg = file_properties.PropertiesSearchContinueArg(cursor)
r = self.request(
file_properties.properties_search_continue,
'file_properties',
arg,
None,
)
return r
def file_properties_properties_update(self,
path,
update_property_groups):
......@@ -230,7 +255,7 @@ class DropboxBase(object):
"""
Add a template associated with a team. See
:meth:`file_properties_properties_add` to add properties to a file or
folder.
folder. Note: this endpoint will create team-owned templates.
:rtype: :class:`dropbox.file_properties.AddTemplateResult`
:raises: :class:`dropbox.exceptions.ApiError`
......@@ -363,6 +388,58 @@ class DropboxBase(object):
)
return r
def file_properties_templates_remove_for_team(self,
template_id):
"""
Permanently removes the specified template created from
:meth:`file_properties_templates_add_for_user`. All properties
associated with the template will also be removed. This action cannot be
undone.
:param str template_id: An identifier for a template created by
:meth:`file_properties_templates_add_for_user` or
:meth:`file_properties_templates_add_for_team`.
:rtype: None
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.file_properties.TemplateError`
"""
arg = file_properties.RemoveTemplateArg(template_id)
r = self.request(
file_properties.templates_remove_for_team,
'file_properties',
arg,
None,
)
return None
def file_properties_templates_remove_for_user(self,
template_id):
"""
Permanently removes the specified template created from
:meth:`file_properties_templates_add_for_user`. All properties
associated with the template will also be removed. This action cannot be
undone.
:param str template_id: An identifier for a template created by
:meth:`file_properties_templates_add_for_user` or
:meth:`file_properties_templates_add_for_team`.
:rtype: None
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.file_properties.TemplateError`
"""
arg = file_properties.RemoveTemplateArg(template_id)
r = self.request(
file_properties.templates_remove_for_user,
'file_properties',
arg,
None,
)
return None
def file_properties_templates_update_for_team(self,
template_id,
name=None,
......@@ -554,6 +631,7 @@ class DropboxBase(object):
include_media_info=False,
include_deleted=False,
include_has_explicit_shared_members=False,
include_property_groups=None,
include_property_templates=None):
"""
Returns the metadata for a file or folder. This is an alpha endpoint
......@@ -569,10 +647,15 @@ class DropboxBase(object):
If this raises, ApiError.reason is of type:
:class:`dropbox.files.AlphaGetMetadataError`
"""
warnings.warn(
'alpha/get_metadata is deprecated. Use get_metadata.',
DeprecationWarning,
)
arg = files.AlphaGetMetadataArg(path,
include_media_info,
include_deleted,
include_has_explicit_shared_members,
include_property_groups,
include_property_templates)
r = self.request(
files.alpha_get_metadata,
......@@ -598,14 +681,16 @@ class DropboxBase(object):
:meth:`files_upload_session_start`.
:param bytes f: Contents to upload.
:param Nullable property_groups: List of custom properties to add to
file.
:rtype: :class:`dropbox.files.FileMetadata`
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.files.UploadErrorWithProperties`
"""
warnings.warn(
'alpha/upload is deprecated. Use alpha/upload.',
DeprecationWarning,
)
arg = files.CommitInfoWithProperties(path,
mode,
autorename,
......@@ -1032,7 +1117,8 @@ class DropboxBase(object):
path,
include_media_info=False,
include_deleted=False,
include_has_explicit_shared_members=False):
include_has_explicit_shared_members=False,
include_property_groups=None):
"""
Returns the metadata for a file or folder. Note: Metadata for the root
folder is unsupported.
......@@ -1047,6 +1133,10 @@ class DropboxBase(object):
:param bool include_has_explicit_shared_members: If true, the results
will include a flag for each file indicating whether or not that
file has any explicit members.
:param Nullable include_property_groups: If set to a valid list of
template IDs, ``FileMetadata.property_groups`` is set if there
exists property data associated with the file and each of the listed
templates.
:rtype: :class:`dropbox.files.Metadata`
:raises: :class:`dropbox.exceptions.ApiError`
......@@ -1056,7 +1146,8 @@ class DropboxBase(object):
arg = files.GetMetadataArg(path,
include_media_info,
include_deleted,
include_has_explicit_shared_members)
include_has_explicit_shared_members,
include_property_groups)
r = self.request(
files.get_metadata,
'files',
......@@ -1266,7 +1357,8 @@ class DropboxBase(object):
include_has_explicit_shared_members=False,
include_mounted_folders=True,
limit=None,
shared_link=None):
shared_link=None,
include_property_groups=None):
"""
Starts returning the contents of a folder. If the result's
``ListFolderResult.has_more`` field is ``True``, call
......@@ -1315,6 +1407,10 @@ class DropboxBase(object):
this field is present, ``ListFolderArg.path`` will be relative to
root of the shared link. Only non-recursive mode is supported for
shared link.
:param Nullable include_property_groups: If set to a valid list of
template IDs, ``FileMetadata.property_groups`` is set if there
exists property data associated with the file and each of the listed
templates.
:rtype: :class:`dropbox.files.ListFolderResult`
:raises: :class:`dropbox.exceptions.ApiError`
......@@ -1328,7 +1424,8 @@ class DropboxBase(object):
include_has_explicit_shared_members,
include_mounted_folders,
limit,
shared_link)
shared_link,
include_property_groups)
r = self.request(
files.list_folder,
'files',
......@@ -1369,7 +1466,8 @@ class DropboxBase(object):
include_has_explicit_shared_members=False,
include_mounted_folders=True,
limit=None,
shared_link=None):
shared_link=None,
include_property_groups=None):
"""
A way to quickly get a cursor for the folder's state. Unlike
:meth:`files_list_folder`, :meth:`files_list_folder_get_latest_cursor`
......@@ -1399,6 +1497,10 @@ class DropboxBase(object):
this field is present, ``ListFolderArg.path`` will be relative to
root of the shared link. Only non-recursive mode is supported for
shared link.
:param Nullable include_property_groups: If set to a valid list of
template IDs, ``FileMetadata.property_groups`` is set if there
exists property data associated with the file and each of the listed
templates.
:rtype: :class:`dropbox.files.ListFolderGetLatestCursorResult`
:raises: :class:`dropbox.exceptions.ApiError`
......@@ -1412,7 +1514,8 @@ class DropboxBase(object):
include_has_explicit_shared_members,
include_mounted_folders,
limit,
shared_link)
shared_link,
include_property_groups)
r = self.request(
files.list_folder_get_latest_cursor,
'files',
......@@ -1928,7 +2031,8 @@ class DropboxBase(object):
mode=files.WriteMode.add,
autorename=False,
client_modified=None,
mute=False):
mute=False,
property_groups=None):
"""
Create a new file with the contents provided in the request. Do not use
this to upload a file larger than 150 MB. Instead, create an upload
......@@ -1951,6 +2055,8 @@ class DropboxBase(object):
modifications in their Dropbox account via notifications in the
client software. If ``True``, this tells the clients that this
modification shouldn't result in a user notification.
:param Nullable property_groups: List of custom properties to add to
file.
:rtype: :class:`dropbox.files.FileMetadata`
:raises: :class:`dropbox.exceptions.ApiError`
......@@ -1961,7 +2067,8 @@ class DropboxBase(object):
mode,
autorename,
client_modified,
mute)
mute,
property_groups)
r = self.request(
files.upload,
'files',
......
......@@ -681,6 +681,91 @@ class DropboxTeamBase(object):
)
return r
def team_member_space_limits_excluded_users_add(self,
users=None):
"""
Add users to member space limits excluded users list.
:param Nullable users: List of users to be added/removed.
:rtype: :class:`dropbox.team.ExcludedUsersUpdateResult`
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.team.ExcludedUsersUpdateError`
"""
arg = team.ExcludedUsersUpdateArg(users)
r = self.request(
team.member_space_limits_excluded_users_add,
'team',
arg,
None,
)
return r
def team_member_space_limits_excluded_users_list(self,
limit=1000):
"""
List member space limits excluded users.
:param long limit: Number of results to return per call.
:rtype: :class:`dropbox.team.ExcludedUsersListResult`
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.team.ExcludedUsersListError`
"""
arg = team.ExcludedUsersListArg(limit)
r = self.request(
team.member_space_limits_excluded_users_list,
'team',
arg,
None,
)
return r
def team_member_space_limits_excluded_users_list_continue(self,
cursor):
"""
Continue listing member space limits excluded users.
:param str cursor: Indicates from what point to get the next set of
users.
:rtype: :class:`dropbox.team.ExcludedUsersListResult`
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.team.ExcludedUsersListContinueError`
"""
arg = team.ExcludedUsersListContinueArg(cursor)
r = self.request(
team.member_space_limits_excluded_users_list_continue,
'team',
arg,
None,
)
return r
def team_member_space_limits_excluded_users_remove(self,
users=None):
"""
Remove users from member space limits excluded users list.
:param Nullable users: List of users to be added/removed.
:rtype: :class:`dropbox.team.ExcludedUsersUpdateResult`
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.team.ExcludedUsersUpdateError`
"""
arg = team.ExcludedUsersUpdateArg(users)
r = self.request(
team.member_space_limits_excluded_users_remove,
'team',
arg,
None,
)
return r
def team_member_space_limits_get_custom_quota(self,
users):
"""
......@@ -728,7 +813,7 @@ class DropboxTeamBase(object):
def team_member_space_limits_set_custom_quota(self,
users_and_quotas):
"""
Set users custom quota. Custom quota has to be at least 25GB. A maximum
Set users custom quota. Custom quota has to be at least 15GB. A maximum
of 1000 members can be specified in a single call.
:param list users_and_quotas: List of users and their custom quotas.
......@@ -736,7 +821,7 @@ class DropboxTeamBase(object):
:raises: :class:`dropbox.exceptions.ApiError`
If this raises, ApiError.reason is of type:
:class:`dropbox.team.CustomQuotaError`
:class:`dropbox.team.SetCustomQuotaError`
"""
arg = team.SetCustomQuotaArg(users_and_quotas)
r = self.request(
......
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# @generated
# flake8: noqa
# pylint: skip-file
try:
......@@ -11,75 +12,17 @@ except (SystemError, ValueError):
import stone_validators as bv
import stone_base as bb
class InvalidPathRootError(object):
"""
:ivar path_root: The latest path root id for user's team if the user is
still in a team.
"""
__slots__ = [
'_path_root_value',
'_path_root_present',
]
_has_required_fields = False
def __init__(self,
path_root=None):
self._path_root_value = None
self._path_root_present = False
if path_root is not None:
self.path_root = path_root
@property
def path_root(self):
"""
The latest path root id for user's team if the user is still in a team.
:rtype: str
"""
if self._path_root_present:
return self._path_root_value
else:
return None
@path_root.setter
def path_root(self, val):
if val is None:
del self.path_root
return
val = self._path_root_validator.validate(val)
self._path_root_value = val
self._path_root_present = True
@path_root.deleter
def path_root(self):
self._path_root_value = None
self._path_root_present = False
def __repr__(self):
return 'InvalidPathRootError(path_root={!r})'.format(
self._path_root_value,
)
InvalidPathRootError_validator = bv.Struct(InvalidPathRootError)
class PathRoot(bb.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.
:ivar home: Paths are relative to the authenticating user's home directory,
:ivar home: Paths are relative to the authenticating user's home namespace,
whether or not that user belongs to a team.
:ivar member_home: Paths are relative to the authenticating team member's
home directory. (This results in ``PathRootError.invalid`` if the user
does not belong to a team.).
:ivar str team: Paths are relative to the given team directory. (This
results in :field:`PathRootError.invalid` if the user is not a member of
the team associated with that path root id.).
:ivar user_home: Paths are relative to the user's home directory. (This
results in ``PathRootError.invalid`` if the belongs to a team.).
:ivar str root: 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.).
:ivar str namespace_id: Paths are relative to given namespace id (This
results in :field:`PathRootError.no_permission` if you don't have access
to this namespace.).
......@@ -89,22 +32,18 @@ class PathRoot(bb.Union):
# Attribute is overwritten below the class definition
home = None
# Attribute is overwritten below the class definition
member_home = None
# Attribute is overwritten below the class definition
user_home = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def team(cls, val):
def root(cls, val):
"""
Create an instance of this class set to the ``team`` tag with value
Create an instance of this class set to the ``root`` tag with value
``val``.
:param str val:
:rtype: PathRoot
"""
return cls('team', val)
return cls('root', val)
@classmethod
def namespace_id(cls, val):
......@@ -125,29 +64,13 @@ class PathRoot(bb.Union):
"""
return self._tag == 'home'
def is_member_home(self):
"""
Check if the union tag is ``member_home``.
:rtype: bool
"""
return self._tag == 'member_home'
def is_team(self):
def is_root(self):
"""
Check if the union tag is ``team``.
Check if the union tag is ``root``.
:rtype: bool
"""
return self._tag == 'team'
def is_user_home(self):
"""
Check if the union tag is ``user_home``.
:rtype: bool
"""
return self._tag == 'user_home'
return self._tag == 'root'
def is_namespace_id(self):
"""
......@@ -165,18 +88,18 @@ class PathRoot(bb.Union):
"""
return self._tag == 'other'
def get_team(self):
def get_root(self):
"""
Paths are relative to the given team directory. (This results in
``PathRootError.invalid`` if the user is not a member of the team
associated with that path root id.).
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 :meth:`is_team` is true.
Only call this if :meth:`is_root` is true.
:rtype: str
"""
if not self.is_team():
raise AttributeError("tag 'team' not set")
if not self.is_root():
raise AttributeError("tag 'root' not set")
return self._value
def get_namespace_id(self):
......@@ -204,9 +127,9 @@ class PathRootError(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar InvalidPathRootError invalid: The path root id value in
Dropbox-API-Path-Root header is no longer valid.
:ivar no_permission: You don't have permission to access the path root id in
:ivar RootInfo invalid_root: The root namespace id in Dropbox-API-Path-Root
header is not valid. The value of this error is use's latest root info.
:ivar no_permission: You don't have permission to access the namespace id in
Dropbox-API-Path-Root header.
"""
......@@ -217,23 +140,23 @@ class PathRootError(bb.Union):
other = None
@classmethod
def invalid(cls, val):
def invalid_root(cls, val):
"""
Create an instance of this class set to the ``invalid`` tag with value
``val``.
Create an instance of this class set to the ``invalid_root`` tag with
value ``val``.
:param InvalidPathRootError val:
:param RootInfo val:
:rtype: PathRootError
"""
return cls('invalid', val)
return cls('invalid_root', val)
def is_invalid(self):
def is_invalid_root(self):
"""
Check if the union tag is ``invalid``.
Check if the union tag is ``invalid_root``.
:rtype: bool
"""
return self._tag == 'invalid'
return self._tag == 'invalid_root'
def is_no_permission(self):
"""
......@@ -251,17 +174,17 @@ class PathRootError(bb.Union):
"""
return self._tag == 'other'
def get_invalid(self):
def get_invalid_root(self):
"""
The path root id value in Dropbox-API-Path-Root header is no longer
valid.
The root namespace id in Dropbox-API-Path-Root header is not valid. The
value of this error is use's latest root info.
Only call this if :meth:`is_invalid` is true.
Only call this if :meth:`is_invalid_root` is true.
:rtype: InvalidPathRootError
:rtype: RootInfo
"""
if not self.is_invalid():
raise AttributeError("tag 'invalid' not set")
if not self.is_invalid_root():
raise AttributeError("tag 'invalid_root' not set")
return self._value
def __repr__(self):
......@@ -269,6 +192,175 @@ class PathRootError(bb.Union):
PathRootError_validator = bv.Union(PathRootError)
class RootInfo(object):
"""
Information about current user's root.
:ivar 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
CDM team. Otherwise it will be same as ``RootInfo.home_namespace_id``.
:ivar home_namespace_id: The namespace id for user's home namespace.
"""
__slots__ = [
'_root_namespace_id_value',
'_root_namespace_id_present',
'_home_namespace_id_value',
'_home_namespace_id_present',
]
_has_required_fields = True
def __init__(self,
root_namespace_id=None,
home_namespace_id=None):
self._root_namespace_id_value = None
self._root_namespace_id_present = False
self._home_namespace_id_value = None
self._home_namespace_id_present = False
if root_namespace_id is not None:
self.root_namespace_id = root_namespace_id
if home_namespace_id is not None:
self.home_namespace_id = home_namespace_id
@property
def root_namespace_id(self):
"""
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 CDM team. Otherwise
it will be same as ``RootInfo.home_namespace_id``.
:rtype: str
"""
if self._root_namespace_id_present:
return self._root_namespace_id_value
else:
raise AttributeError("missing required field 'root_namespace_id'")
@root_namespace_id.setter
def root_namespace_id(self, val):
val = self._root_namespace_id_validator.validate(val)
self._root_namespace_id_value = val
self._root_namespace_id_present = True
@root_namespace_id.deleter
def root_namespace_id(self):
self._root_namespace_id_value = None
self._root_namespace_id_present = False
@property
def home_namespace_id(self):
"""
The namespace id for user's home namespace.
:rtype: str
"""
if self._home_namespace_id_present:
return self._home_namespace_id_value
else:
raise AttributeError("missing required field 'home_namespace_id'")
@home_namespace_id.setter
def home_namespace_id(self, val):
val = self._home_namespace_id_validator.validate(val)
self._home_namespace_id_value = val
self._home_namespace_id_present = True
@home_namespace_id.deleter
def home_namespace_id(self):
self._home_namespace_id_value = None
self._home_namespace_id_present = False
def __repr__(self):
return 'RootInfo(root_namespace_id={!r}, home_namespace_id={!r})'.format(
self._root_namespace_id_value,
self._home_namespace_id_value,
)
RootInfo_validator = bv.StructTree(RootInfo)