Commit 3c9e03b3 authored by Michael Fladischer's avatar Michael Fladischer

New upstream version 9.1.0

parent a1a31bc3
Dropbox for Python
==================
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v9.0.0
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v9.1.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
......
......@@ -63,6 +63,9 @@ class LaunchResultBase(bb.Union):
raise AttributeError("tag 'async_job_id' not set")
return self._value
def _process_custom_annotations(self, annotation_type, processor):
super(LaunchResultBase, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'LaunchResultBase(%r, %r)' % (self._tag, self._value)
......@@ -92,12 +95,15 @@ class LaunchEmptyResult(LaunchResultBase):
"""
return self._tag == 'complete'
def _process_custom_annotations(self, annotation_type, processor):
super(LaunchEmptyResult, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'LaunchEmptyResult(%r, %r)' % (self._tag, self._value)
LaunchEmptyResult_validator = bv.Union(LaunchEmptyResult)
class PollArg(object):
class PollArg(bb.Struct):
"""
Arguments for methods that poll the status of an asynchronous job.
......@@ -143,6 +149,9 @@ class PollArg(object):
self._async_job_id_value = None
self._async_job_id_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(PollArg, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PollArg(async_job_id={!r})'.format(
self._async_job_id_value,
......@@ -176,6 +185,9 @@ class PollResultBase(bb.Union):
"""
return self._tag == 'in_progress'
def _process_custom_annotations(self, annotation_type, processor):
super(PollResultBase, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PollResultBase(%r, %r)' % (self._tag, self._value)
......@@ -204,6 +216,9 @@ class PollEmptyResult(PollResultBase):
"""
return self._tag == 'complete'
def _process_custom_annotations(self, annotation_type, processor):
super(PollEmptyResult, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PollEmptyResult(%r, %r)' % (self._tag, self._value)
......@@ -255,6 +270,9 @@ class PollError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(PollError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PollError(%r, %r)' % (self._tag, self._value)
......
......@@ -101,6 +101,9 @@ class AccessError(bb.Union):
raise AttributeError("tag 'paper_access_denied' not set")
return self._value
def _process_custom_annotations(self, annotation_type, processor):
super(AccessError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'AccessError(%r, %r)' % (self._tag, self._value)
......@@ -120,6 +123,7 @@ class AuthError(bb.Union):
:ivar invalid_select_admin: The user specified in 'Dropbox-API-Select-Admin'
is not a Dropbox Business team admin.
:ivar user_suspended: The user has been suspended.
:ivar expired_access_token: The access token has expired.
"""
_catch_all = 'other'
......@@ -132,6 +136,8 @@ class AuthError(bb.Union):
# Attribute is overwritten below the class definition
user_suspended = None
# Attribute is overwritten below the class definition
expired_access_token = None
# Attribute is overwritten below the class definition
other = None
def is_invalid_access_token(self):
......@@ -166,6 +172,14 @@ class AuthError(bb.Union):
"""
return self._tag == 'user_suspended'
def is_expired_access_token(self):
"""
Check if the union tag is ``expired_access_token``.
:rtype: bool
"""
return self._tag == 'expired_access_token'
def is_other(self):
"""
Check if the union tag is ``other``.
......@@ -174,6 +188,9 @@ class AuthError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(AuthError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'AuthError(%r, %r)' % (self._tag, self._value)
......@@ -223,6 +240,9 @@ class InvalidAccountTypeError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(InvalidAccountTypeError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'InvalidAccountTypeError(%r, %r)' % (self._tag, self._value)
......@@ -270,12 +290,15 @@ class PaperAccessError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(PaperAccessError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PaperAccessError(%r, %r)' % (self._tag, self._value)
PaperAccessError_validator = bv.Union(PaperAccessError)
class RateLimitError(object):
class RateLimitError(bb.Struct):
"""
Error occurred because the app is being rate limited.
......@@ -352,6 +375,9 @@ class RateLimitError(object):
self._retry_after_value = None
self._retry_after_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(RateLimitError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'RateLimitError(reason={!r}, retry_after={!r})'.format(
self._reason_value,
......@@ -404,12 +430,15 @@ class RateLimitReason(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(RateLimitReason, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'RateLimitReason(%r, %r)' % (self._tag, self._value)
RateLimitReason_validator = bv.Union(RateLimitReason)
class TokenFromOAuth1Arg(object):
class TokenFromOAuth1Arg(bb.Struct):
"""
:ivar oauth1_token: The supplied OAuth 1.0 access token.
:ivar oauth1_token_secret: The token secret associated with the supplied
......@@ -483,6 +512,9 @@ class TokenFromOAuth1Arg(object):
self._oauth1_token_secret_value = None
self._oauth1_token_secret_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(TokenFromOAuth1Arg, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'TokenFromOAuth1Arg(oauth1_token={!r}, oauth1_token_secret={!r})'.format(
self._oauth1_token_value,
......@@ -535,12 +567,15 @@ class TokenFromOAuth1Error(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(TokenFromOAuth1Error, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'TokenFromOAuth1Error(%r, %r)' % (self._tag, self._value)
TokenFromOAuth1Error_validator = bv.Union(TokenFromOAuth1Error)
class TokenFromOAuth1Result(object):
class TokenFromOAuth1Result(bb.Struct):
"""
:ivar oauth2_token: The OAuth 2.0 token generated from the supplied OAuth
1.0 token.
......@@ -583,6 +618,9 @@ class TokenFromOAuth1Result(object):
self._oauth2_token_value = None
self._oauth2_token_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(TokenFromOAuth1Result, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'TokenFromOAuth1Result(oauth2_token={!r})'.format(
self._oauth2_token_value,
......@@ -605,12 +643,14 @@ AuthError._invalid_access_token_validator = bv.Void()
AuthError._invalid_select_user_validator = bv.Void()
AuthError._invalid_select_admin_validator = bv.Void()
AuthError._user_suspended_validator = bv.Void()
AuthError._expired_access_token_validator = bv.Void()
AuthError._other_validator = bv.Void()
AuthError._tagmap = {
'invalid_access_token': AuthError._invalid_access_token_validator,
'invalid_select_user': AuthError._invalid_select_user_validator,
'invalid_select_admin': AuthError._invalid_select_admin_validator,
'user_suspended': AuthError._user_suspended_validator,
'expired_access_token': AuthError._expired_access_token_validator,
'other': AuthError._other_validator,
}
......@@ -618,6 +658,7 @@ AuthError.invalid_access_token = AuthError('invalid_access_token')
AuthError.invalid_select_user = AuthError('invalid_select_user')
AuthError.invalid_select_admin = AuthError('invalid_select_admin')
AuthError.user_suspended = AuthError('user_suspended')
AuthError.expired_access_token = AuthError('expired_access_token')
AuthError.other = AuthError('other')
InvalidAccountTypeError._endpoint_validator = bv.Void()
......
This diff is collapsed.
......@@ -960,6 +960,64 @@ class DropboxTeamBase(object):
)
return r
def team_members_move_former_member_files(self,
user,
transfer_dest_id,
transfer_admin_id):
"""
Moves removed member's files to a different member. This endpoint
initiates an asynchronous job. To obtain the final result of the job,
the client should periodically poll
:meth:`team_members_move_former_member_files_job_status_check`.
Permission : Team member management.
:param transfer_dest_id: Files from the deleted member account will be
transferred to this user.
:type transfer_dest_id: :class:`dropbox.team.UserSelectorArg`
:param transfer_admin_id: Errors during the transfer process will be
sent via email to this user.
:type transfer_admin_id: :class:`dropbox.team.UserSelectorArg`
:rtype: :class:`dropbox.team.LaunchEmptyResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.MembersTransferFormerMembersFilesError`
"""
arg = team.MembersDataTransferArg(user,
transfer_dest_id,
transfer_admin_id)
r = self.request(
team.members_move_former_member_files,
'team',
arg,
None,
)
return r
def team_members_move_former_member_files_job_status_check(self,
async_job_id):
"""
Once an async_job_id is returned from
:meth:`team_members_move_former_member_files` , use this to poll the
status of the asynchronous request. Permission : Team member management.
:param str async_job_id: Id of the asynchronous job. This is the value
of a response returned from the method that launched the job.
:rtype: :class:`dropbox.team.PollEmptyResult`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.PollError`
"""
arg = async_.PollArg(async_job_id)
r = self.request(
team.members_move_former_member_files_job_status_check,
'team',
arg,
None,
)
return r
def team_members_recover(self,
user):
"""
......@@ -1161,8 +1219,6 @@ class DropboxTeamBase(object):
Exactly one of team_member_id, email, or external_id must be provided to
identify the user account.
:param user: Identity of user to remove/suspend.
:type user: :class:`dropbox.team.UserSelectorArg`
:param bool wipe_data: If provided, controls if the user's data will be
deleted on their linked devices.
:rtype: None
......@@ -1703,7 +1759,11 @@ class DropboxTeamBase(object):
</developers/documentation/http/teams#team-features-get_values>`_ to
check for this feature. Permission : Team Auditing.
:param long limit: Number of results to return per call.
:param long limit: The maximal number of results to return per call.
Note that some calls may not return ``limit`` number of events, and
may even return no events, even with `has_more` set to true. In this
case, callers should fetch again using
:meth:`team_log_get_events_continue`.
:param Nullable account_id: Filter the events by account ID. Return ony
events with this account_id as either Actor, Context, or
Participants.
......
......@@ -116,6 +116,9 @@ class PathRoot(bb.Union):
raise AttributeError("tag 'namespace_id' not set")
return self._value
def _process_custom_annotations(self, annotation_type, processor):
super(PathRoot, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PathRoot(%r, %r)' % (self._tag, self._value)
......@@ -187,12 +190,15 @@ class PathRootError(bb.Union):
raise AttributeError("tag 'invalid_root' not set")
return self._value
def _process_custom_annotations(self, annotation_type, processor):
super(PathRootError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PathRootError(%r, %r)' % (self._tag, self._value)
PathRootError_validator = bv.Union(PathRootError)
class RootInfo(object):
class RootInfo(bb.Struct):
"""
Information about current user's root.
......@@ -272,6 +278,9 @@ class RootInfo(object):
self._home_namespace_id_value = None
self._home_namespace_id_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(RootInfo, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'RootInfo(root_namespace_id={!r}, home_namespace_id={!r})'.format(
self._root_namespace_id_value,
......@@ -329,6 +338,9 @@ class TeamRootInfo(RootInfo):
self._home_path_value = None
self._home_path_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(TeamRootInfo, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'TeamRootInfo(root_namespace_id={!r}, home_namespace_id={!r}, home_path={!r})'.format(
self._root_namespace_id_value,
......@@ -355,6 +367,9 @@ class UserRootInfo(RootInfo):
super(UserRootInfo, self).__init__(root_namespace_id,
home_namespace_id)
def _process_custom_annotations(self, annotation_type, processor):
super(UserRootInfo, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'UserRootInfo(root_namespace_id={!r}, home_namespace_id={!r})'.format(
self._root_namespace_id_value,
......
......@@ -6,7 +6,7 @@ __all__ = [
# This should always be 0.0.0 in master. Only update this after tagging
# before release.
__version__ = '9.0.0'
__version__ = '9.1.0'
import contextlib
import json
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ except (ImportError, SystemError, ValueError):
import common
import files
class CreateFileRequestArgs(object):
class CreateFileRequestArgs(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.file_requests_create`.
......@@ -175,6 +175,9 @@ class CreateFileRequestArgs(object):
self._open_value = None
self._open_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(CreateFileRequestArgs, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'CreateFileRequestArgs(title={!r}, destination={!r}, deadline={!r}, open={!r})'.format(
self._title_value,
......@@ -219,6 +222,9 @@ class GeneralFileRequestsError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(GeneralFileRequestsError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'GeneralFileRequestsError(%r, %r)' % (self._tag, self._value)
......@@ -309,6 +315,9 @@ class FileRequestError(GeneralFileRequestsError):
"""
return self._tag == 'validation_error'
def _process_custom_annotations(self, annotation_type, processor):
super(FileRequestError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'FileRequestError(%r, %r)' % (self._tag, self._value)
......@@ -349,12 +358,15 @@ class CreateFileRequestError(FileRequestError):
"""
return self._tag == 'rate_limit'
def _process_custom_annotations(self, annotation_type, processor):
super(CreateFileRequestError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'CreateFileRequestError(%r, %r)' % (self._tag, self._value)
CreateFileRequestError_validator = bv.Union(CreateFileRequestError)
class FileRequest(object):
class FileRequest(bb.Struct):
"""
A `file request <https://www.dropbox.com/help/9090>`_ for receiving files
into the user's Dropbox account.
......@@ -631,6 +643,9 @@ class FileRequest(object):
self._file_count_value = None
self._file_count_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(FileRequest, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'FileRequest(id={!r}, url={!r}, title={!r}, created={!r}, is_open={!r}, file_count={!r}, destination={!r}, deadline={!r})'.format(
self._id_value,
......@@ -645,7 +660,7 @@ class FileRequest(object):
FileRequest_validator = bv.Struct(FileRequest)
class FileRequestDeadline(object):
class FileRequestDeadline(bb.Struct):
"""
:ivar deadline: The deadline for this file request.
:ivar allow_late_uploads: If set, allow uploads after the deadline has
......@@ -723,6 +738,9 @@ class FileRequestDeadline(object):
self._allow_late_uploads_value = None
self._allow_late_uploads_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(FileRequestDeadline, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'FileRequestDeadline(deadline={!r}, allow_late_uploads={!r})'.format(
self._deadline_value,
......@@ -731,7 +749,7 @@ class FileRequestDeadline(object):
FileRequestDeadline_validator = bv.Struct(FileRequestDeadline)
class GetFileRequestArgs(object):
class GetFileRequestArgs(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.file_requests_get`.
......@@ -775,6 +793,9 @@ class GetFileRequestArgs(object):
self._id_value = None
self._id_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(GetFileRequestArgs, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'GetFileRequestArgs(id={!r})'.format(
self._id_value,
......@@ -791,6 +812,9 @@ class GetFileRequestError(FileRequestError):
corresponding ``get_*`` method.
"""
def _process_custom_annotations(self, annotation_type, processor):
super(GetFileRequestError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'GetFileRequestError(%r, %r)' % (self._tag, self._value)
......@@ -865,6 +889,9 @@ class GracePeriod(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(GracePeriod, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'GracePeriod(%r, %r)' % (self._tag, self._value)
......@@ -879,12 +906,15 @@ class ListFileRequestsError(GeneralFileRequestsError):
corresponding ``get_*`` method.
"""
def _process_custom_annotations(self, annotation_type, processor):
super(ListFileRequestsError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'ListFileRequestsError(%r, %r)' % (self._tag, self._value)
ListFileRequestsError_validator = bv.Union(ListFileRequestsError)
class ListFileRequestsResult(object):
class ListFileRequestsResult(bb.Struct):
"""
Result for :meth:`dropbox.dropbox.Dropbox.file_requests_list`.
......@@ -930,6 +960,9 @@ class ListFileRequestsResult(object):
self._file_requests_value = None
self._file_requests_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(ListFileRequestsResult, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'ListFileRequestsResult(file_requests={!r})'.format(
self._file_requests_value,
......@@ -937,7 +970,7 @@ class ListFileRequestsResult(object):
ListFileRequestsResult_validator = bv.Struct(ListFileRequestsResult)
class UpdateFileRequestArgs(object):
class UpdateFileRequestArgs(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.file_requests_update`.
......@@ -1118,6 +1151,9 @@ class UpdateFileRequestArgs(object):
self._open_value = None
self._open_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(UpdateFileRequestArgs, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'UpdateFileRequestArgs(id={!r}, title={!r}, destination={!r}, deadline={!r}, open={!r})'.format(
self._id_value,
......@@ -1193,6 +1229,9 @@ class UpdateFileRequestDeadline(bb.Union):
raise AttributeError("tag 'update' not set")
return self._value
def _process_custom_annotations(self, annotation_type, processor):
super(UpdateFileRequestDeadline, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'UpdateFileRequestDeadline(%r, %r)' % (self._tag, self._value)
......@@ -1207,6 +1246,9 @@ class UpdateFileRequestError(FileRequestError):
corresponding ``get_*`` method.
"""
def _process_custom_annotations(self, annotation_type, processor):
super(UpdateFileRequestError, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'UpdateFileRequestError(%r, %r)' % (self._tag, self._value)
......
This diff is collapsed.
This diff is collapsed.
......@@ -78,6 +78,9 @@ class PlatformType(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(PlatformType, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'PlatformType(%r, %r)' % (self._tag, self._value)
......
This diff is collapsed.
......@@ -8,6 +8,8 @@ than being added to a project.
from __future__ import absolute_import, unicode_literals
import functools
try:
from . import stone_validators as bv
except (ImportError, SystemError, ValueError):
......@@ -19,6 +21,19 @@ _MYPY = False
if _MYPY:
import typing # noqa: F401 # pylint: disable=import-error,unused-import,useless-suppression
class AnnotationType(object):
# This is a base class for all annotation types.
pass
if _MYPY:
T = typing.TypeVar('T', bound=AnnotationType)
U = typing.TypeVar('U')
class Struct(object):
# This is a base class for all classes representing Stone structs.
def _process_custom_annotations(self, annotation_type, processor):
# type: (typing.Type[T], typing.Callable[[T, U], U]) -> None
pass
class Union(object):
# TODO(kelkabany): Possible optimization is to remove _value if a
......@@ -58,6 +73,10 @@ class Union(object):
def __hash__(self):
return hash((self._tag, self._value))
def _process_custom_annotations(self, annotation_type, processor):
# type: (typing.Type[T], typing.Callable[[T, U], U]) -> None
pass
@classmethod
def _is_tag_present(cls, tag, caller_permissions):
assert tag, 'tag value should not be None'
......@@ -104,3 +123,30 @@ class Route(object):
self.result_type,
self.error_type,
self.attrs)
# helper functions used when constructing custom annotation processors
# put this here so that every other file doesn't need to import functools
partially_apply = functools.partial
def make_struct_annotation_processor(annotation_type, processor):
def g(struct):
if struct is None:
return struct
struct._process_custom_annotations(annotation_type, processor)
return struct
return g
def make_list_annotation_processor(processor):
def g(list_):
if list_ is None:
return list_
return [processor(x) for x in list_]
return g
def make_map_value_annotation_processor(processor):
def g(map_):
if map_ is None:
return map_
return {k: processor(v) for k, v in map_.items()}
return g
......@@ -122,11 +122,12 @@ class StoneSerializerBase(StoneEncoderInterface):
delegate encoding of sub-values. Arguments have the same semantics
as with the ``encode`` method.
"""
if isinstance(validator, bv.List):
# Because Lists are mutable, we always validate them during
# serialization
validate_f = validator.validate
encode_f = self.encode_list
validate_f = validator.validate # type: typing.Callable[[typing.Any], None]
encode_f = self.encode_list # type: typing.Callable[[typing.Any, typing.Any], typing.Any] # noqa: E501
elif isinstance(validator, bv.Map):
# Also validate maps during serialization because they are also mutable
validate_f = validator.validate
......
This diff is collapsed.
......@@ -74,12 +74,15 @@ class GroupManagementType(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(GroupManagementType, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'GroupManagementType(%r, %r)' % (self._tag, self._value)
GroupManagementType_validator = bv.Union(GroupManagementType)
class GroupSummary(object):
class GroupSummary(bb.Struct):
"""
Information about a group.
......@@ -249,6 +252,9 @@ class GroupSummary(object):
self._group_management_type_value = None
self._group_management_type_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(GroupSummary, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'GroupSummary(group_name={!r}, group_id={!r}, group_management_type={!r}, group_external_id={!r}, member_count={!r})'.format(
self._group_name_value,
......@@ -305,6 +311,9 @@ class GroupType(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(GroupType, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'GroupType(%r, %r)' % (self._tag, self._value)
......@@ -367,12 +376,15 @@ class MemberSpaceLimitType(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(MemberSpaceLimitType, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'MemberSpaceLimitType(%r, %r)' % (self._tag, self._value)
MemberSpaceLimitType_validator = bv.Union(MemberSpaceLimitType)
class TimeRange(object):
class TimeRange(bb.Struct):
"""
Time range.
......@@ -453,6 +465,9 @@ class TimeRange(object):
self._end_time_value = None
self._end_time_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(TimeRange, self)._process_custom_annotations(annotation_type, processor)
def __repr__(self):
return 'TimeRange(start_time={!r}, end_time={!r})'.format(
self._start_time_value,
......
This diff is collapsed.
This diff is collapsed.
......@@ -29,7 +29,7 @@ except (ImportError, SystemError, ValueError):
import team_policies
import users_common
class Account(object):
class Account(