Пример #1
0
    def is_other(self):
        """
        Check if the union tag is ``other``.

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

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


GroupManagementType_validator = bv.Union(GroupManagementType)


class GroupSummary(bb.Struct):
    """
    Information about a group.

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

    __slots__ = [
Пример #2
0
        Only call this if :meth:`is_base64_data` is true.

        :rtype: str
        """
        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)


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',
    ]

    _has_required_fields = True

    def __init__(self, photo=None):
        Only call this if :meth:`is_contacts_not_found` is true.

        :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, field_path,
                                    processor):
        super(DeleteManualContactsError,
              self)._process_custom_annotations(annotation_type, field_path,
                                                processor)


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,
Пример #4
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 _process_custom_annotations(self, annotation_type, field_path, processor):
        super(AccessError, self)._process_custom_annotations(annotation_type, field_path, processor)

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 auth.AuthError.invalid_access_token: The access token is invalid.
    :ivar auth.AuthError.invalid_select_user: The user specified in
        'Dropbox-API-Select-User' is no longer on the team.
    :ivar auth.AuthError.invalid_select_admin: The user specified in
        'Dropbox-API-Select-Admin' is not a Dropbox Business team admin.
    :ivar auth.AuthError.user_suspended: The user has been suspended.
Пример #5
0
        :rtype: bool
        """
        return self._tag == 'disabled_for_team'

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

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

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

GeneralFileRequestsError_validator = bv.Union(GeneralFileRequestsError)

class CountFileRequestsError(GeneralFileRequestsError):
    """
    There was an error counting the file requests.

    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.
    """

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

CountFileRequestsError_validator = bv.Union(CountFileRequestsError)
Пример #6
0
        Only call this if :meth:`is_enabled` is true.

        :rtype: bool
        """
        if not self.is_enabled():
            raise AttributeError("tag 'enabled' not set")
        return self._value

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


FileLockingValue_validator = bv.Union(FileLockingValue)


class FullAccount(Account):
    """
    Detailed information about the current user's account.

    :ivar users.FullAccount.country: The user's two-letter country code, if
        available. Country codes are based on `ISO 3166-1
        <http://en.wikipedia.org/wiki/ISO_3166-1>`_.
    :ivar users.FullAccount.locale: The language that the user specified. Locale
        tags will be `IETF language tags
        <http://en.wikipedia.org/wiki/IETF_language_tag>`_.
    :ivar users.FullAccount.referral_link: The user's `referral link
        <https://www.dropbox.com/referrals>`_.
    :ivar users.FullAccount.team: If this account is a member of a team,