Commit 1ad157eb authored by Michael Fladischer's avatar Michael Fladischer

Update upstream source from tag 'upstream/8.6.0'

Update to upstream version '8.6.0'
with Debian dir 3e9f12d17575976cca6393923fdba0f61c45b6f9
parents 7320629e 9c62545e
Metadata-Version: 1.1
Name: dropbox
Version: 8.5.1
Version: 8.6.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.5.1
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.6.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.5.1
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.6.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.5.1
Version: 8.6.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.5.1
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.6.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
......
......@@ -6,7 +6,7 @@ __all__ = [
# This should always be 0.0.0 in master. Only update this after tagging
# before release.
__version__ = '8.5.1'
__version__ = '8.6.0'
import contextlib
import json
......@@ -493,22 +493,50 @@ class DropboxTeam(_DropboxTransport, DropboxTeamBase):
token. Methods of this class are meant to act on the team, but there is
also an :meth:`as_user` method for assuming a team member's identity.
"""
def as_admin(self, team_member_id):
"""
Allows a team credential to assume the identity of an administrator on the team
and perform operations on any team-owned content.
:param str team_member_id: team member id of administrator to perform actions with
:return: A :class:`Dropbox` object that can be used to query on behalf
of this admin of the team.
:rtype: Dropbox
"""
return self._get_dropbox_client_with_select_header('Dropbox-API-Select-Admin',
team_member_id)
def as_user(self, team_member_id):
"""
Allows a team credential to assume the identity of a member of the
team.
:param str team_member_id: team member id of team member to perform actions with
:return: A :class:`Dropbox` object that can be used to query on behalf
of this member of the team.
:rtype: Dropbox
"""
return self._get_dropbox_client_with_select_header('Dropbox-API-Select-User',
team_member_id)
def _get_dropbox_client_with_select_header(self, select_header_name, team_member_id):
"""
Get Dropbox client with modified headers
:param str select_header_name: Header name used to select users
:param str team_member_id: team member id of team member to perform actions with
:return: A :class:`Dropbox` object that can be used to query on behalf
of a member or admin of the team
:rtype: Dropbox
"""
new_headers = self._headers.copy() if self._headers else {}
new_headers['Dropbox-API-Select-User'] = team_member_id
new_headers[select_header_name] = team_member_id
return Dropbox(
self._oauth2_access_token,
max_retries_on_error=self._max_retries_on_error,
max_retries_on_rate_limit=self._max_retries_on_rate_limit,
timeout=self._timeout,
user_agent=self._raw_user_agent,
session=self._session,
headers=new_headers,
......
......@@ -10123,6 +10123,8 @@ class MembersRemoveError(MembersDeactivateError):
should be set to False.
:ivar email_address_too_long_to_be_disabled: The email address of the user
is too long to be disabled.
:ivar cannot_keep_invited_user_account: Cannot keep account of an invited
user.
"""
# Attribute is overwritten below the class definition
......@@ -10149,6 +10151,8 @@ class MembersRemoveError(MembersDeactivateError):
cannot_keep_account_and_delete_data = None
# Attribute is overwritten below the class definition
email_address_too_long_to_be_disabled = None
# Attribute is overwritten below the class definition
cannot_keep_invited_user_account = None
def is_remove_last_admin(self):
"""
......@@ -10246,6 +10250,14 @@ class MembersRemoveError(MembersDeactivateError):
"""
return self._tag == 'email_address_too_long_to_be_disabled'
def is_cannot_keep_invited_user_account(self):
"""
Check if the union tag is ``cannot_keep_invited_user_account``.
:rtype: bool
"""
return self._tag == 'cannot_keep_invited_user_account'
def __repr__(self):
return 'MembersRemoveError(%r, %r)' % (self._tag, self._value)
......@@ -11291,8 +11303,8 @@ class NamespaceMetadata(object):
:ivar name: The name of this namespace.
:ivar namespace_id: The ID of this namespace.
:ivar namespace_type: The type of this namespace.
:ivar team_member_id: If this is a team member folder, the ID of the team
member. Otherwise, this field is not present.
:ivar team_member_id: If this is a team member or app folder, the ID of the
owning team member. Otherwise, this field is not present.
"""
__slots__ = [
......@@ -11402,8 +11414,8 @@ class NamespaceMetadata(object):
@property
def team_member_id(self):
"""
If this is a team member folder, the ID of the team member. Otherwise,
this field is not present.
If this is a team member or app folder, the ID of the owning team
member. Otherwise, this field is not present.
:rtype: str
"""
......@@ -16454,6 +16466,7 @@ MembersRemoveError._transfer_admin_is_not_admin_validator = bv.Void()
MembersRemoveError._cannot_keep_account_and_transfer_validator = bv.Void()
MembersRemoveError._cannot_keep_account_and_delete_data_validator = bv.Void()
MembersRemoveError._email_address_too_long_to_be_disabled_validator = bv.Void()
MembersRemoveError._cannot_keep_invited_user_account_validator = bv.Void()
MembersRemoveError._tagmap = {
'remove_last_admin': MembersRemoveError._remove_last_admin_validator,
'removed_and_transfer_dest_should_differ': MembersRemoveError._removed_and_transfer_dest_should_differ_validator,
......@@ -16467,6 +16480,7 @@ MembersRemoveError._tagmap = {
'cannot_keep_account_and_transfer': MembersRemoveError._cannot_keep_account_and_transfer_validator,
'cannot_keep_account_and_delete_data': MembersRemoveError._cannot_keep_account_and_delete_data_validator,
'email_address_too_long_to_be_disabled': MembersRemoveError._email_address_too_long_to_be_disabled_validator,
'cannot_keep_invited_user_account': MembersRemoveError._cannot_keep_invited_user_account_validator,
}
MembersRemoveError._tagmap.update(MembersDeactivateError._tagmap)
......@@ -16482,6 +16496,7 @@ MembersRemoveError.transfer_admin_is_not_admin = MembersRemoveError('transfer_ad
MembersRemoveError.cannot_keep_account_and_transfer = MembersRemoveError('cannot_keep_account_and_transfer')
MembersRemoveError.cannot_keep_account_and_delete_data = MembersRemoveError('cannot_keep_account_and_delete_data')
MembersRemoveError.email_address_too_long_to_be_disabled = MembersRemoveError('email_address_too_long_to_be_disabled')
MembersRemoveError.cannot_keep_invited_user_account = MembersRemoveError('cannot_keep_invited_user_account')
MembersSendWelcomeError._other_validator = bv.Void()
MembersSendWelcomeError._tagmap = {
......
......@@ -310,6 +310,68 @@ class GroupType(bb.Union):
GroupType_validator = bv.Union(GroupType)
class MemberSpaceLimitType(bb.Union):
"""
The type of the space limit imposed on a team member.
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 off: The team member does not have imposed space limit.
:ivar alert_only: The team member has soft imposed space limit - the limit
is used for display and for notifications.
:ivar stop_sync: The team member has hard imposed space limit - Dropbox file
sync will stop after the limit is reached.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
off = None
# Attribute is overwritten below the class definition
alert_only = None
# Attribute is overwritten below the class definition
stop_sync = None
# Attribute is overwritten below the class definition
other = None
def is_off(self):
"""
Check if the union tag is ``off``.
:rtype: bool
"""
return self._tag == 'off'
def is_alert_only(self):
"""
Check if the union tag is ``alert_only``.
:rtype: bool
"""
return self._tag == 'alert_only'
def is_stop_sync(self):
"""
Check if the union tag is ``stop_sync``.
:rtype: bool
"""
return self._tag == 'stop_sync'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def __repr__(self):
return 'MemberSpaceLimitType(%r, %r)' % (self._tag, self._value)
MemberSpaceLimitType_validator = bv.Union(MemberSpaceLimitType)
class TimeRange(object):
"""
Time range.
......@@ -453,6 +515,22 @@ GroupType.team = GroupType('team')
GroupType.user_managed = GroupType('user_managed')
GroupType.other = GroupType('other')
MemberSpaceLimitType._off_validator = bv.Void()
MemberSpaceLimitType._alert_only_validator = bv.Void()
MemberSpaceLimitType._stop_sync_validator = bv.Void()
MemberSpaceLimitType._other_validator = bv.Void()
MemberSpaceLimitType._tagmap = {
'off': MemberSpaceLimitType._off_validator,
'alert_only': MemberSpaceLimitType._alert_only_validator,
'stop_sync': MemberSpaceLimitType._stop_sync_validator,
'other': MemberSpaceLimitType._other_validator,
}
MemberSpaceLimitType.off = MemberSpaceLimitType('off')
MemberSpaceLimitType.alert_only = MemberSpaceLimitType('alert_only')
MemberSpaceLimitType.stop_sync = MemberSpaceLimitType('stop_sync')
MemberSpaceLimitType.other = MemberSpaceLimitType('other')
TimeRange._start_time_validator = bv.Nullable(common.DropboxTimestamp_validator)
TimeRange._end_time_validator = bv.Nullable(common.DropboxTimestamp_validator)
TimeRange._all_field_names_ = set([
......
This diff is collapsed.
......@@ -19,11 +19,13 @@ except (ImportError, SystemError, ValueError):
try:
from . import (
common,
team_common,
team_policies,
users_common,
)
except (ImportError, SystemError, ValueError):
import common
import team_common
import team_policies
import users_common
......@@ -1455,6 +1457,11 @@ class TeamSpaceAllocation(object):
"""
:ivar used: The total space currently used by the user's team (bytes).
:ivar allocated: The total space allocated to the user's team (bytes).
:ivar user_within_team_space_allocated: The total space allocated to the
user within its team allocated space (0 means that no restriction is
imposed on the user's quota within its team).
:ivar user_within_team_space_limit_type: The type of the space limit imposed
on the team member (off, alert_only, stop_sync).
"""
__slots__ = [
......@@ -1462,21 +1469,35 @@ class TeamSpaceAllocation(object):
'_used_present',
'_allocated_value',
'_allocated_present',
'_user_within_team_space_allocated_value',
'_user_within_team_space_allocated_present',
'_user_within_team_space_limit_type_value',
'_user_within_team_space_limit_type_present',
]
_has_required_fields = True
def __init__(self,
used=None,
allocated=None):
allocated=None,
user_within_team_space_allocated=None,
user_within_team_space_limit_type=None):
self._used_value = None
self._used_present = False
self._allocated_value = None
self._allocated_present = False
self._user_within_team_space_allocated_value = None
self._user_within_team_space_allocated_present = False
self._user_within_team_space_limit_type_value = None
self._user_within_team_space_limit_type_present = False
if used is not None:
self.used = used
if allocated is not None:
self.allocated = allocated
if user_within_team_space_allocated is not None:
self.user_within_team_space_allocated = user_within_team_space_allocated
if user_within_team_space_limit_type is not None:
self.user_within_team_space_limit_type = user_within_team_space_limit_type
@property
def used(self):
......@@ -1524,10 +1545,61 @@ class TeamSpaceAllocation(object):
self._allocated_value = None
self._allocated_present = False
@property
def user_within_team_space_allocated(self):
"""
The total space allocated to the user within its team allocated space (0
means that no restriction is imposed on the user's quota within its
team).
:rtype: long
"""
if self._user_within_team_space_allocated_present:
return self._user_within_team_space_allocated_value
else:
raise AttributeError("missing required field 'user_within_team_space_allocated'")
@user_within_team_space_allocated.setter
def user_within_team_space_allocated(self, val):
val = self._user_within_team_space_allocated_validator.validate(val)
self._user_within_team_space_allocated_value = val
self._user_within_team_space_allocated_present = True
@user_within_team_space_allocated.deleter
def user_within_team_space_allocated(self):
self._user_within_team_space_allocated_value = None
self._user_within_team_space_allocated_present = False
@property
def user_within_team_space_limit_type(self):
"""
The type of the space limit imposed on the team member (off, alert_only,
stop_sync).
:rtype: team_common.MemberSpaceLimitType_validator
"""
if self._user_within_team_space_limit_type_present:
return self._user_within_team_space_limit_type_value
else:
raise AttributeError("missing required field 'user_within_team_space_limit_type'")
@user_within_team_space_limit_type.setter
def user_within_team_space_limit_type(self, val):
self._user_within_team_space_limit_type_validator.validate_type_only(val)
self._user_within_team_space_limit_type_value = val
self._user_within_team_space_limit_type_present = True
@user_within_team_space_limit_type.deleter
def user_within_team_space_limit_type(self):
self._user_within_team_space_limit_type_value = None
self._user_within_team_space_limit_type_present = False
def __repr__(self):
return 'TeamSpaceAllocation(used={!r}, allocated={!r})'.format(
return 'TeamSpaceAllocation(used={!r}, allocated={!r}, user_within_team_space_allocated={!r}, user_within_team_space_limit_type={!r})'.format(
self._used_value,
self._allocated_value,
self._user_within_team_space_allocated_value,
self._user_within_team_space_limit_type_value,
)
TeamSpaceAllocation_validator = bv.Struct(TeamSpaceAllocation)
......@@ -1693,13 +1765,19 @@ SpaceUsage._all_fields_ = [
TeamSpaceAllocation._used_validator = bv.UInt64()
TeamSpaceAllocation._allocated_validator = bv.UInt64()
TeamSpaceAllocation._user_within_team_space_allocated_validator = bv.UInt64()
TeamSpaceAllocation._user_within_team_space_limit_type_validator = team_common.MemberSpaceLimitType_validator
TeamSpaceAllocation._all_field_names_ = set([
'used',
'allocated',
'user_within_team_space_allocated',
'user_within_team_space_limit_type',
])
TeamSpaceAllocation._all_fields_ = [
('used', TeamSpaceAllocation._used_validator),
('allocated', TeamSpaceAllocation._allocated_validator),
('user_within_team_space_allocated', TeamSpaceAllocation._user_within_team_space_allocated_validator),
('user_within_team_space_limit_type', TeamSpaceAllocation._user_within_team_space_limit_type_validator),
]
get_account = bb.Route(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment