예제 #1
0
        val = self._allocated_validator.validate(val)
        self._allocated_value = val
        self._allocated_present = True

    @allocated.deleter
    def allocated(self):
        self._allocated_value = None
        self._allocated_present = False

    def __repr__(self):
        return 'TeamSpaceAllocation(used={!r}, allocated={!r})'.format(
            self._used_value,
            self._allocated_value,
        )

Account._account_id_validator = bv.String(min_length=40, max_length=40)
Account._name_validator = bv.Struct(Name)
Account._email_validator = bv.String()
Account._email_verified_validator = bv.Boolean()
Account._profile_photo_url_validator = bv.Nullable(bv.String())
Account._all_field_names_ = set([
    'account_id',
    'name',
    'email',
    'email_verified',
    'profile_photo_url',
])
Account._all_fields_ = [
    ('account_id', Account._account_id_validator),
    ('name', Account._name_validator),
    ('email', Account._email_validator),
예제 #2
0
    @member_count.deleter
    def member_count(self):
        self._member_count_value = None
        self._member_count_present = False

    def __repr__(self):
        return 'GroupSummary(group_name={!r}, group_id={!r}, member_count={!r}, group_external_id={!r})'.format(
            self._group_name_value,
            self._group_id_value,
            self._member_count_value,
            self._group_external_id_value,
        )


GroupSummary._group_name_validator = bv.String()
GroupSummary._group_id_validator = bv.String()
GroupSummary._group_external_id_validator = bv.Nullable(bv.String())
GroupSummary._member_count_validator = bv.UInt32()
GroupSummary._all_field_names_ = set([
    'group_name',
    'group_id',
    'group_external_id',
    'member_count',
])
GroupSummary._all_fields_ = [
    ('group_name', GroupSummary._group_name_validator),
    ('group_id', GroupSummary._group_id_validator),
    ('group_external_id', GroupSummary._group_external_id_validator),
    ('member_count', GroupSummary._member_count_validator),
]
예제 #3
0
        """
        return self._tag == 'internal_error'

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

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

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


LaunchResultBase._async_job_id_validator = bv.String(min_length=1)
LaunchResultBase._tagmap = {
    'async_job_id': LaunchResultBase._async_job_id_validator,
}

LaunchEmptyResult._complete_validator = bv.Void()
LaunchEmptyResult._tagmap = {
    'complete': LaunchEmptyResult._complete_validator,
}
LaunchEmptyResult._tagmap.update(LaunchResultBase._tagmap)

LaunchEmptyResult.complete = LaunchEmptyResult('complete')

PollArg._async_job_id_validator = bv.String(min_length=1)
PollArg._all_field_names_ = set(['async_job_id'])
PollArg._all_fields_ = [('async_job_id', PollArg._async_job_id_validator)]
예제 #4
0
# -*- coding: utf-8 -*-
# Auto-generated by BabelAPI, do not modify.
try:
    from . import babel_validators as bv
except (SystemError, ValueError):
    # Catch errors raised when importing a relative module when not in a package.
    # This makes testing this file directly (outside of a package) easier.
    import babel_validators as bv

Date_validator = bv.Timestamp(u'%Y-%m-%d')
DisplayName_validator = bv.String(min_length=1, pattern=u'[^/:?*<>"|]*')
DropboxTimestamp_validator = bv.Timestamp(u'%Y-%m-%dT%H:%M:%SZ')
EmailAddress_validator = bv.String(
    max_length=255,
    pattern=u"^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$")
NamePart_validator = bv.String(min_length=1,
                               max_length=100,
                               pattern=u'[^/:?*<>"|]*')
SharedFolderId_validator = bv.String(pattern=u'[-_0-9a-zA-Z:]+')
예제 #5
0
        The value is an account ID specified in
        ``GetAccountBatchArg.account_ids`` that does not exist.

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

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

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


GetAccountArg._account_id_validator = bv.String(min_length=40, max_length=40)
GetAccountArg._all_field_names_ = set(['account_id'])
GetAccountArg._all_fields_ = [('account_id',
                               GetAccountArg._account_id_validator)]

GetAccountError._no_account_validator = bv.Void()
GetAccountError._unknown_validator = bv.Void()
GetAccountError._tagmap = {
    'no_account': GetAccountError._no_account_validator,
    'unknown': GetAccountError._unknown_validator,
}

GetAccountError.no_account = GetAccountError('no_account')
GetAccountError.unknown = GetAccountError('unknown')

AccountType._basic_validator = bv.Void()
예제 #6
0
        self._allocated_value = val
        self._allocated_present = True

    @allocated.deleter
    def allocated(self):
        self._allocated_value = None
        self._allocated_present = False

    def __repr__(self):
        return 'TeamSpaceAllocation(used={!r}, allocated={!r})'.format(
            self._used_value,
            self._allocated_value,
        )


AccountId_validator = bv.String(min_length=40, max_length=40)
GetAccountBatchResult_validator = bv.List(bv.Struct(BasicAccount))
Account._account_id_validator = AccountId_validator
Account._name_validator = bv.Struct(Name)
Account._email_validator = bv.String()
Account._email_verified_validator = bv.Boolean()
Account._profile_photo_url_validator = bv.Nullable(bv.String())
Account._all_field_names_ = set([
    'account_id',
    'name',
    'email',
    'email_verified',
    'profile_photo_url',
])
Account._all_fields_ = [
    ('account_id', Account._account_id_validator),
예제 #7
0
        :rtype: bool
        """
        return self._tag == 'internal_error'

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

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

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

AsyncJobId_validator = bv.String(min_length=1)
LaunchResultBase._async_job_id_validator = AsyncJobId_validator
LaunchResultBase._tagmap = {
    'async_job_id': LaunchResultBase._async_job_id_validator,
}

LaunchEmptyResult._complete_validator = bv.Void()
LaunchEmptyResult._tagmap = {
    'complete': LaunchEmptyResult._complete_validator,
}
LaunchEmptyResult._tagmap.update(LaunchResultBase._tagmap)

LaunchEmptyResult.complete = LaunchEmptyResult('complete')

PollArg._async_job_id_validator = AsyncJobId_validator
PollArg._all_field_names_ = set(['async_job_id'])