示例#1
0
        """
        Property template does not exist for given identifier.

        Only call this if :meth:`is_template_not_found` is true.

        :rtype: str
        """
        if not self.is_template_not_found():
            raise AttributeError("tag 'template_not_found' not set")
        return self._value

    def __repr__(self):
        return 'PropertyTemplateError(%r, %r)' % (self._tag, self._value)


PropertyTemplateError_validator = bv.Union(PropertyTemplateError)


class ModifyPropertyTemplateError(PropertyTemplateError):
    """
    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 conflicting_property_names: A property field name already exists in
        the template.
    :ivar too_many_properties: There are too many properties in the changed
        template. The maximum number of properties per template is 32.
    :ivar too_many_templates: There are too many templates for the team.
    :ivar template_attribute_too_large: The template name, description or field
        names is too large.
        ``PathRootError.no_permission`` if you don't have access to this
        namespace.).

        Only call this if :meth:`is_namespace_id` is true.

        :rtype: str
        """
        if not self.is_namespace_id():
            raise AttributeError("tag 'namespace_id' not set")
        return self._value

    def __repr__(self):
        return 'PathRoot(%r, %r)' % (self._tag, self._value)


PathRoot_validator = bv.Union(PathRoot)


class PathRootError(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 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
        Dropbox-API-Path-Root  header.
    """

    _catch_all = 'other'
示例#3
0
        """
        return self._tag == 'disabled_for_team'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'GeneralFileRequestsError(%r, %r)' % (self._tag, self._value)


GeneralFileRequestsError_validator = bv.Union(GeneralFileRequestsError)


class FileRequestError(GeneralFileRequestsError):
    """
    There is an error with the file request.

    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 not_found: This file request ID was not found.
    :ivar not_a_folder: The specified path is not a folder.
    :ivar app_lacks_access: This file request is not accessible to this app.
        Apps with the app folder permission can only access file requests in
        their app folder.
示例#4
0
        This response indicates that the processing is asynchronous. The string
        is an id that can be used to obtain the status of the asynchronous job.

        Only call this if :meth:`is_async_job_id` is true.

        :rtype: str
        """
        if not self.is_async_job_id():
            raise AttributeError("tag 'async_job_id' not set")
        return self._value

    def __repr__(self):
        return 'LaunchResultBase(%r, %r)' % (self._tag, self._value)


LaunchResultBase_validator = bv.Union(LaunchResultBase)


class LaunchEmptyResult(LaunchResultBase):
    """
    Result returned by methods that may either launch an asynchronous job or
    complete synchronously. Upon synchronous completion of the job, no
    additional information is returned.

    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 complete: The job finished synchronously and successfully.
    """
        :rtype: bool
        """
        return self._tag == 'required'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'EmmState(%r, %r)' % (self._tag, self._value)

EmmState_validator = bv.Union(EmmState)

class OfficeAddInPolicy(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 disabled: Office Add-In is disabled.
    :ivar enabled: Office Add-In is enabled.
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    disabled = None
    # Attribute is overwritten below the class definition
示例#6
0
        """
        return self._tag == 'required'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'EmmState(%r, %r)' % (self._tag, self._value)


EmmState_validator = bv.Union(EmmState)


class SharedFolderJoinPolicy(bb.Union):
    """
    Policy governing which shared folders a team member can join.

    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 from_team_only: Team members can only join folders shared by
        teammates.
    :ivar from_anyone: Team members can join any shared folder, including those
        shared by users outside the team.
    """
示例#7
0
        """
        return self._tag == 'system_managed'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'GroupManagementType(%r, %r)' % (self._tag, self._value)


GroupManagementType_validator = bv.Union(GroupManagementType)


class GroupSummary(object):
    """
    Information about a group.

    :ivar group_external_id: External ID of group. This is an arbitrary ID that
        an admin can attach to a group.
    :ivar member_count: The number of members in the group.
    :ivar group_management_type: Who is allowed to manage the group.
    """

    __slots__ = [
        '_group_name_value',
        '_group_name_present',
        """
        return self._tag == 'pro'

    def is_business(self):
        """
        Check if the union tag is ``business``.

        :rtype: bool
        """
        return self._tag == 'business'

    def __repr__(self):
        return 'AccountType(%r, %r)' % (self._tag, self._value)


AccountType_validator = bv.Union(AccountType)

AccountId_validator = bv.String(min_length=40, max_length=40)
AccountType._basic_validator = bv.Void()
AccountType._pro_validator = bv.Void()
AccountType._business_validator = bv.Void()
AccountType._tagmap = {
    'basic': AccountType._basic_validator,
    'pro': AccountType._pro_validator,
    'business': AccountType._business_validator,
}

AccountType.basic = AccountType('basic')
AccountType.pro = AccountType('pro')
AccountType.business = AccountType('business')
示例#9
0
        :rtype: bool
        """
        return self._tag == 'invalid_select_admin'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'AuthError(%r, %r)' % (self._tag, self._value)

AuthError_validator = bv.Union(AuthError)

class RateLimitError(object):
    """
    Error occurred because the app is being rate limited.

    :ivar reason: The reason why the app is being rate limited.
    :ivar retry_after: The number of seconds that the app should wait before
        making another request.
    """

    __slots__ = [
        '_reason_value',
        '_reason_present',
        '_retry_after_value',
        '_retry_after_present',
示例#10
0
    def get_paper_access_denied(self):
        """
        Current account cannot access Paper.

        Only call this if :meth:`is_paper_access_denied` is true.

        :rtype: PaperAccessError
        """
        if not self.is_paper_access_denied():
            raise AttributeError("tag 'paper_access_denied' not set")
        return self._value

    def __repr__(self):
        return 'AccessError(%r, %r)' % (self._tag, self._value)

AccessError_validator = bv.Union(AccessError)

class AuthError(bb.Union):
    """
    Errors occurred during authentication.

    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 invalid_access_token: The access token is invalid.
    :ivar invalid_select_user: The user specified in 'Dropbox-API-Select-User'
        is no longer on the team.
    :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.
示例#11
0
        :rtype: bool
        """
        return self._tag == 'other'

    def _process_custom_annotations(self, annotation_type, field_path,
                                    processor):
        super(PlatformType,
              self)._process_custom_annotations(annotation_type, field_path,
                                                processor)

    def __repr__(self):
        return 'PlatformType(%r, %r)' % (self._tag, self._value)


PlatformType_validator = bv.Union(PlatformType)

PlatformType._web_validator = bv.Void()
PlatformType._desktop_validator = bv.Void()
PlatformType._mobile_ios_validator = bv.Void()
PlatformType._mobile_android_validator = bv.Void()
PlatformType._api_validator = bv.Void()
PlatformType._unknown_validator = bv.Void()
PlatformType._mobile_validator = bv.Void()
PlatformType._other_validator = bv.Void()
PlatformType._tagmap = {
    'web': PlatformType._web_validator,
    'desktop': PlatformType._desktop_validator,
    'mobile_ios': PlatformType._mobile_ios_validator,
    'mobile_android': PlatformType._mobile_android_validator,
    'api': PlatformType._api_validator,
示例#12
0
        """
        return self._tag == 'invalid_select_user'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'AuthError(%r, %r)' % (self._tag, self._value)


AuthError_validator = bv.Union(AuthError)

AuthError._invalid_access_token_validator = bv.Void()
AuthError._invalid_select_user_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,
    'other': AuthError._other_validator,
}

AuthError.invalid_access_token = AuthError('invalid_access_token')
AuthError.invalid_select_user = AuthError('invalid_select_user')
AuthError.other = AuthError('other')

token_revoke = bb.Route(
        :rtype: bool
        """
        return self._tag == 'required'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'EmmState(%r, %r)' % (self._tag, self._value)

EmmState_validator = bv.Union(EmmState)

class GroupCreation(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 admins_and_members: Team admins and members can create groups.
    :ivar admins_only: Only team admins can create groups.
    """

    _catch_all = None
    # Attribute is overwritten below the class definition
    admins_and_members = None
    # Attribute is overwritten below the class definition
示例#14
0
        """
        if not self.is_base64_data():
            raise AttributeError("tag 'base64_data' not set")
        return self._value

    def _process_custom_annotations(self, annotation_type, field_path,
                                    processor):
        super(PhotoSourceArg,
              self)._process_custom_annotations(annotation_type, field_path,
                                                processor)

    def __repr__(self):
        return 'PhotoSourceArg(%r, %r)' % (self._tag, self._value)


PhotoSourceArg_validator = bv.Union(PhotoSourceArg)


class SetProfilePhotoArg(bb.Struct):
    """
    :ivar account.SetProfilePhotoArg.photo: Image to set as the user's new
        profile photo.
    """

    __slots__ = [
        '_photo_value',
        '_photo_present',
    ]

    _has_required_fields = True
        """
        return self._tag == 'system_managed'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def __repr__(self):
        return 'GroupManagementType(%r, %r)' % (self._tag, self._value)


GroupManagementType_validator = bv.Union(GroupManagementType)


class GroupSummary(object):
    """
    Information about a group.

    :ivar group_external_id: External ID of group. This is an arbitrary ID that
        an admin can attach to a group.
    :ivar member_count: The number of members in the group.
    :ivar group_management_type: Who is allowed to manage the group.
    """

    __slots__ = [
        '_group_name_value',
        '_group_name_present',
示例#16
0
        """
        return self._tag == 'pro'

    def is_business(self):
        """
        Check if the union tag is ``business``.

        :rtype: bool
        """
        return self._tag == 'business'

    def __repr__(self):
        return 'AccountType(%r, %r)' % (self._tag, self._value)


AccountType_validator = bv.Union(AccountType)


class BasicAccount(Account):
    """
    Basic information about any account.

    :ivar is_teammate: Whether this user is a teammate of the current user. If
        this account is the current user's account, then this will be ``True``.
    :ivar team_member_id: The user's unique team member id. This field will only
        be present if the user is part of a team and ``is_teammate`` is
        ``True``.
    """

    __slots__ = [
        '_is_teammate_value',
示例#17
0
        :rtype: list of [str]
        """
        if not self.is_contacts_not_found():
            raise AttributeError("tag 'contacts_not_found' not set")
        return self._value

    def _process_custom_annotations(self, annotation_type, processor):
        super(DeleteManualContactsError,
              self)._process_custom_annotations(annotation_type, processor)

    def __repr__(self):
        return 'DeleteManualContactsError(%r, %r)' % (self._tag, self._value)


DeleteManualContactsError_validator = bv.Union(DeleteManualContactsError)

DeleteManualContactsArg._email_addresses_validator = bv.List(
    common.EmailAddress_validator)
DeleteManualContactsArg._all_field_names_ = set(['email_addresses'])
DeleteManualContactsArg._all_fields_ = [
    ('email_addresses', DeleteManualContactsArg._email_addresses_validator)
]

DeleteManualContactsError._contacts_not_found_validator = bv.List(
    common.EmailAddress_validator)
DeleteManualContactsError._other_validator = bv.Void()
DeleteManualContactsError._tagmap = {
    'contacts_not_found':
    DeleteManualContactsError._contacts_not_found_validator,
    'other': DeleteManualContactsError._other_validator,
示例#18
0
        :rtype: bool
        """
        return self._tag == 'other'

    def _process_custom_annotations(self, annotation_type, field_path,
                                    processor):
        super(MixedInternalOnlyEnum,
              self)._process_custom_annotations(annotation_type, field_path,
                                                processor)

    def __repr__(self):
        return 'MixedInternalOnlyEnum(%r, %r)' % (self._tag, self._value)


MixedInternalOnlyEnum_validator = bv.Union(MixedInternalOnlyEnum)

EmptyContainer._all_field_names_ = set([])
EmptyContainer._all_fields_ = []

MixedInternalOnlyContainer._public_value_validator = bv.Int32()
MixedInternalOnlyContainer._all_field_names_ = set(['public_value'])
MixedInternalOnlyContainer._all_fields_ = [
    ('public_value', MixedInternalOnlyContainer._public_value_validator)
]

MixedInternalOnlyEnum._public_validator = bv.Void()
MixedInternalOnlyEnum._other_validator = bv.Void()
MixedInternalOnlyEnum._tagmap = {
    'public': MixedInternalOnlyEnum._public_validator,
    'other': MixedInternalOnlyEnum._other_validator,