Exemplo n.º 1
0
    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,
            self._home_namespace_id_value,
        )


UserRootInfo_validator = bv.Struct(UserRootInfo)

Date_validator = bv.Timestamp(u'%Y-%m-%d')
DisplayName_validator = bv.String(min_length=1, pattern=u'[^/:?*<>"|]*')
DisplayNameLegacy_validator = bv.String()
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}$"
)
# A ISO639-1 code.
LanguageCode_validator = bv.String(min_length=2)
NamePart_validator = bv.String(min_length=1,
                               max_length=100,
                               pattern=u'[^/:?*<>"|]*')
NamespaceId_validator = bv.String(pattern=u'[-_0-9a-zA-Z:]+')
OptionalNamePart_validator = bv.String(max_length=100, pattern=u'[^/:?*<>"|]*')
SessionId_validator = bv.String()
SharedFolderId_validator = NamespaceId_validator
Exemplo n.º 2
0
    @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,
        )


TeamSpaceAllocation_validator = bv.Struct(TeamSpaceAllocation)

AccountId_validator = bv.String(min_length=40, max_length=40)
GetAccountBatchResult_validator = bv.List(BasicAccount_validator)
Account._account_id_validator = AccountId_validator
Account._name_validator = Name_validator
Account._email_validator = bv.String()
Account._email_verified_validator = bv.Boolean()
Account._profile_photo_url_validator = bv.Nullable(bv.String())
Account._disabled_validator = bv.Boolean()
Account._all_field_names_ = set([
    'account_id',
    'name',
    'email',
    'email_verified',
    'profile_photo_url',
    'disabled',
])
Exemplo n.º 3
0
    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, processor):
        super(UpdateFileRequestError,
              self)._process_custom_annotations(annotation_type, processor)

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


UpdateFileRequestError_validator = bv.Union(UpdateFileRequestError)

FileRequestId_validator = bv.String(min_length=1, pattern=u'[-_0-9a-zA-Z]+')
FileRequestValidationError_validator = bv.Nullable(bv.String())
CreateFileRequestArgs._title_validator = bv.String(min_length=1)
CreateFileRequestArgs._destination_validator = files.Path_validator
CreateFileRequestArgs._deadline_validator = bv.Nullable(
    FileRequestDeadline_validator)
CreateFileRequestArgs._open_validator = bv.Boolean()
CreateFileRequestArgs._all_field_names_ = set([
    'title',
    'destination',
    'deadline',
    'open',
])
CreateFileRequestArgs._all_fields_ = [
    ('title', CreateFileRequestArgs._title_validator),
    ('destination', CreateFileRequestArgs._destination_validator),
Exemplo n.º 4
0
        return self._tag == 'string'

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

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

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

PropertyType_validator = bv.Union(PropertyType)

TemplateId_validator = bv.String(min_length=1, pattern=u'(/|ptid:).*')
GetPropertyTemplateArg._template_id_validator = TemplateId_validator
GetPropertyTemplateArg._all_field_names_ = set(['template_id'])
GetPropertyTemplateArg._all_fields_ = [('template_id', GetPropertyTemplateArg._template_id_validator)]

PropertyGroupTemplate._name_validator = bv.String()
PropertyGroupTemplate._description_validator = bv.String()
PropertyGroupTemplate._fields_validator = bv.List(PropertyFieldTemplate_validator)
PropertyGroupTemplate._all_field_names_ = set([
    'name',
    'description',
    'fields',
])
PropertyGroupTemplate._all_fields_ = [
    ('name', PropertyGroupTemplate._name_validator),
    ('description', PropertyGroupTemplate._description_validator),
Exemplo n.º 5
0
    @end_time.deleter
    def end_time(self):
        self._end_time_value = None
        self._end_time_present = False

    def __repr__(self):
        return 'TimeRange(start_time={!r}, end_time={!r})'.format(
            self._start_time_value,
            self._end_time_value,
        )


TimeRange_validator = bv.Struct(TimeRange)

GroupExternalId_validator = bv.String()
GroupId_validator = bv.String()
MemberExternalId_validator = bv.String(max_length=64)
ResellerId_validator = bv.String()
TeamMemberId_validator = bv.String()
GroupManagementType._user_managed_validator = bv.Void()
GroupManagementType._company_managed_validator = bv.Void()
GroupManagementType._system_managed_validator = bv.Void()
GroupManagementType._other_validator = bv.Void()
GroupManagementType._tagmap = {
    'user_managed': GroupManagementType._user_managed_validator,
    'company_managed': GroupManagementType._company_managed_validator,
    'system_managed': GroupManagementType._system_managed_validator,
    'other': GroupManagementType._other_validator,
}
Exemplo n.º 6
0
]

RateLimitReason._too_many_requests_validator = bv.Void()
RateLimitReason._too_many_write_operations_validator = bv.Void()
RateLimitReason._other_validator = bv.Void()
RateLimitReason._tagmap = {
    'too_many_requests': RateLimitReason._too_many_requests_validator,
    'too_many_write_operations': RateLimitReason._too_many_write_operations_validator,
    'other': RateLimitReason._other_validator,
}

RateLimitReason.too_many_requests = RateLimitReason('too_many_requests')
RateLimitReason.too_many_write_operations = RateLimitReason('too_many_write_operations')
RateLimitReason.other = RateLimitReason('other')

TokenFromOAuth1Arg._oauth1_token_validator = bv.String(min_length=1)
TokenFromOAuth1Arg._oauth1_token_secret_validator = bv.String(min_length=1)
TokenFromOAuth1Arg._all_field_names_ = set([
    'oauth1_token',
    'oauth1_token_secret',
])
TokenFromOAuth1Arg._all_fields_ = [
    ('oauth1_token', TokenFromOAuth1Arg._oauth1_token_validator),
    ('oauth1_token_secret', TokenFromOAuth1Arg._oauth1_token_secret_validator),
]

TokenFromOAuth1Error._invalid_oauth1_token_info_validator = bv.Void()
TokenFromOAuth1Error._app_id_mismatch_validator = bv.Void()
TokenFromOAuth1Error._other_validator = bv.Void()
TokenFromOAuth1Error._tagmap = {
    'invalid_oauth1_token_info': TokenFromOAuth1Error._invalid_oauth1_token_info_validator,
Exemplo n.º 7
0
        self._profile_photo_url_present = False

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

    def __repr__(self):
        return 'SetProfilePhotoResult(profile_photo_url={!r})'.format(
            self._profile_photo_url_value, )


SetProfilePhotoResult_validator = bv.Struct(SetProfilePhotoResult)

PhotoSourceArg._base64_data_validator = bv.String()
PhotoSourceArg._other_validator = bv.Void()
PhotoSourceArg._tagmap = {
    'base64_data': PhotoSourceArg._base64_data_validator,
    'other': PhotoSourceArg._other_validator,
}

PhotoSourceArg.other = PhotoSourceArg('other')

SetProfilePhotoArg._photo_validator = PhotoSourceArg_validator
SetProfilePhotoArg._all_field_names_ = set(['photo'])
SetProfilePhotoArg._all_fields_ = [('photo',
                                    SetProfilePhotoArg._photo_validator)]

SetProfilePhotoError._file_type_error_validator = bv.Void()
SetProfilePhotoError._file_size_error_validator = bv.Void()
Exemplo n.º 8
0
        """
        Check if the union tag is ``other``.

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

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

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

PollError_validator = bv.Union(PollError)

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'])
Exemplo n.º 9
0
    def __repr__(self):
        return 'ResultAddress(firstLine={!r}, secondLine={!r}, floor={!r}, apartment={!r}, zone={!r}, district={!r}, geoLocation={!r}, city={!r})'.format(
            self._stone_firstLine_value,
            self._stone_secondLine_value,
            self._stone_floor_value,
            self._stone_apartment_value,
            self._stone_zone_value,
            self._stone_district_value,
            self._stone_geoLocation_value,
            self._stone_city_value,
        )


ResultAddress_validator = bv.Struct(ResultAddress)

BaseAddress._stone_firstLine_validator = bv.String()
BaseAddress._stone_secondLine_validator = bv.Nullable(bv.String())
BaseAddress._stone_floor_validator = bv.Nullable(bv.Int32())
BaseAddress._stone_apartment_validator = bv.Nullable(bv.Int32())
BaseAddress._stone_zone_validator = bv.Nullable(bv.String())
BaseAddress._stone_district_validator = bv.Nullable(bv.String())
BaseAddress._all_field_names_ = set([
    'firstLine',
    'secondLine',
    'floor',
    'apartment',
    'zone',
    'district',
])
BaseAddress._all_fields_ = [
    ('firstLine', BaseAddress._stone_firstLine_validator),
Exemplo n.º 10
0
RateLimitReason._too_many_requests_validator = bv.Void()
RateLimitReason._too_many_write_operations_validator = bv.Void()
RateLimitReason._other_validator = bv.Void()
RateLimitReason._tagmap = {
    'too_many_requests': RateLimitReason._too_many_requests_validator,
    'too_many_write_operations':
    RateLimitReason._too_many_write_operations_validator,
    'other': RateLimitReason._other_validator,
}

RateLimitReason.too_many_requests = RateLimitReason('too_many_requests')
RateLimitReason.too_many_write_operations = RateLimitReason(
    'too_many_write_operations')
RateLimitReason.other = RateLimitReason('other')

TokenFromOAuth1Arg._oauth1_token_validator = bv.String(min_length=1)
TokenFromOAuth1Arg._oauth1_token_secret_validator = bv.String(min_length=1)
TokenFromOAuth1Arg._all_field_names_ = set([
    'oauth1_token',
    'oauth1_token_secret',
])
TokenFromOAuth1Arg._all_fields_ = [
    ('oauth1_token', TokenFromOAuth1Arg._oauth1_token_validator),
    ('oauth1_token_secret', TokenFromOAuth1Arg._oauth1_token_secret_validator),
]

TokenFromOAuth1Error._invalid_oauth1_token_info_validator = bv.Void()
TokenFromOAuth1Error._app_id_mismatch_validator = bv.Void()
TokenFromOAuth1Error._other_validator = bv.Void()
TokenFromOAuth1Error._tagmap = {
    'invalid_oauth1_token_info':
Exemplo n.º 11
0
        """
        return self._tag == 'business'

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

    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')

ROUTES = {}
Exemplo n.º 12
0
        return self._tag == 'user_managed'

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

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

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

GroupType_validator = bv.Union(GroupType)

GroupId_validator = bv.String()
GroupSummary._group_name_validator = bv.String()
GroupSummary._group_id_validator = GroupId_validator
GroupSummary._group_external_id_validator = bv.Nullable(bv.String())
GroupSummary._member_count_validator = bv.Nullable(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),
Exemplo n.º 13
0
        self._stone_message_present = True

    @message.deleter
    def message(self):
        self._stone_message_value = None
        self._stone_message_present = False

    def __repr__(self):
        return 'UpdateSubAccountResult(_id={!r}, message={!r})'.format(
            self._stone__id_value,
            self._stone_message_value,
        )

UpdateSubAccountResult_validator = bv.Struct(UpdateSubAccountResult)

CreateSubAccountArg._stone_name_validator = bv.String()
CreateSubAccountArg._stone_phone_validator = bv.String()
CreateSubAccountArg._stone_address_validator = common.Address_validator
CreateSubAccountArg._all_field_names_ = set([
    'name',
    'phone',
    'address',
])
CreateSubAccountArg._all_fields_ = [
    ('name', CreateSubAccountArg._stone_name_validator),
    ('phone', CreateSubAccountArg._stone_phone_validator),
    ('address', CreateSubAccountArg._stone_address_validator),
]

CreateSubAccountResult._stone__id_validator = bv.String()
CreateSubAccountResult._stone_message_validator = bv.String()
Exemplo n.º 14
0
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
try:
    from . import stone_validators as bv
    from . import stone_base as bb
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 stone_validators as bv
    import stone_base as bb

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:]+')
ROUTES = {
}

Exemplo n.º 15
0
        self._stone_data_value = val
        self._stone_data_present = True

    @data.deleter
    def data(self):
        self._stone_data_value = None
        self._stone_data_present = False

    def __repr__(self):
        return 'GetAirWaybillResult(data={!r})'.format(
            self._stone_data_value,
        )

GetAirWaybillResult_validator = bv.Struct(GetAirWaybillResult)

GetAirWaybillArg._stone__id_validator = bv.String()
GetAirWaybillArg._all_field_names_ = set(['_id'])
GetAirWaybillArg._all_fields_ = [('_id', GetAirWaybillArg._stone__id_validator)]

GetAirWaybillResult._stone_data_validator = bv.String()
GetAirWaybillResult._all_field_names_ = set(['data'])
GetAirWaybillResult._all_fields_ = [('data', GetAirWaybillResult._stone_data_validator)]

get = bb.Route(
    'get',
    False,
    GetAirWaybillArg_validator,
    GetAirWaybillResult_validator,
    common.RequestError_validator,
    {'url_param': '_id',
     'query_params': None,