Skip to content

Commit

Permalink
Automated Spec Update (#439)
Browse files Browse the repository at this point in the history
f91238c7508770245030a449d86bd698d30ebfc3

 Change Notes:

check_api_v2_types Namespace
- Update EchoArg struct to include max_length in query arg

sharing_files Namespace
- Update FileMemberActionResult to include sckey_sha1, invitation_signature

team_log_generated Namespace
- Add AdminEmailRemindersChangedDetails, AdminEmailRemindersChangedType structs
- Add AdminEmailRemindersPolicy unions

team_policies Namespace
- Add AdminEmailRemindersChangedType struct
- Add FileProviderMigrationPolicyState unions

Co-authored-by: DropboxBot <[email protected]>
Co-authored-by: Brent Bumann <[email protected]>
  • Loading branch information
3 people authored Jul 13, 2022
1 parent f3f8729 commit 4a3c7f5
Show file tree
Hide file tree
Showing 8 changed files with 621 additions and 3 deletions.
1 change: 1 addition & 0 deletions dropbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from dropbox import file_properties
from dropbox import file_requests
from dropbox import files
from dropbox import openid
from dropbox import paper
from dropbox import secondary_emails
from dropbox import seen_state
Expand Down
1 change: 1 addition & 0 deletions dropbox/base_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from dropbox import file_properties
from dropbox import file_requests
from dropbox import files
from dropbox import openid
from dropbox import paper
from dropbox import secondary_emails
from dropbox import seen_state
Expand Down
2 changes: 1 addition & 1 deletion dropbox/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):

EchoResult_validator = bv.Struct(EchoResult)

EchoArg.query.validator = bv.String()
EchoArg.query.validator = bv.String(max_length=500)
EchoArg._all_field_names_ = set(['query'])
EchoArg._all_fields_ = [('query', EchoArg.query.validator)]

Expand Down
282 changes: 282 additions & 0 deletions dropbox/openid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# @generated
# flake8: noqa
# pylint: skip-file
from __future__ import unicode_literals
from stone.backends.python_rsrc import stone_base as bb
from stone.backends.python_rsrc import stone_validators as bv

class AuthError(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.
"""

_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_token = None
# Attribute is overwritten below the class definition
no_openid_auth = None
# Attribute is overwritten below the class definition
other = None

def is_invalid_token(self):
"""
Check if the union tag is ``invalid_token``.
:rtype: bool
"""
return self._tag == 'invalid_token'

def is_no_openid_auth(self):
"""
Check if the union tag is ``no_openid_auth``.
:rtype: bool
"""
return self._tag == 'no_openid_auth'

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

AuthError_validator = bv.Union(AuthError)

class UserInfoArgs(bb.Struct):
"""
This struct is empty. The comment here is intentionally emitted to avoid
indentation issues with Stone.
"""

__slots__ = [
]

_has_required_fields = False

def __init__(self):
pass

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

UserInfoArgs_validator = bv.Struct(UserInfoArgs)

class UserInfoError(bb.Struct):

__slots__ = [
'_err_value',
'_error_message_value',
]

_has_required_fields = False

def __init__(self,
err=None,
error_message=None):
self._err_value = bb.NOT_SET
self._error_message_value = bb.NOT_SET
if err is not None:
self.err = err
if error_message is not None:
self.error_message = error_message

# Instance attribute type: ErrUnion (validator is set below)
err = bb.Attribute("err", nullable=True, user_defined=True)

# Instance attribute type: str (validator is set below)
error_message = bb.Attribute("error_message")

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

UserInfoError_validator = bv.Struct(UserInfoError)

class UserInfoResult(bb.Struct):

__slots__ = [
'_family_name_value',
'_given_name_value',
'_email_value',
'_email_verified_value',
'_iss_value',
'_sub_value',
]

_has_required_fields = False

def __init__(self,
family_name=None,
given_name=None,
email=None,
email_verified=None,
iss=None,
sub=None):
self._family_name_value = bb.NOT_SET
self._given_name_value = bb.NOT_SET
self._email_value = bb.NOT_SET
self._email_verified_value = bb.NOT_SET
self._iss_value = bb.NOT_SET
self._sub_value = bb.NOT_SET
if family_name is not None:
self.family_name = family_name
if given_name is not None:
self.given_name = given_name
if email is not None:
self.email = email
if email_verified is not None:
self.email_verified = email_verified
if iss is not None:
self.iss = iss
if sub is not None:
self.sub = sub

# Instance attribute type: str (validator is set below)
family_name = bb.Attribute("family_name", nullable=True)

# Instance attribute type: str (validator is set below)
given_name = bb.Attribute("given_name", nullable=True)

# Instance attribute type: str (validator is set below)
email = bb.Attribute("email", nullable=True)

# Instance attribute type: bool (validator is set below)
email_verified = bb.Attribute("email_verified", nullable=True)

# Instance attribute type: str (validator is set below)
iss = bb.Attribute("iss")

# Instance attribute type: str (validator is set below)
sub = bb.Attribute("sub")

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

UserInfoResult_validator = bv.Struct(UserInfoResult)

class ErrUnion(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.
"""

_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None

@classmethod
def auth_error(cls, val):
"""
Create an instance of this class set to the ``auth_error`` tag with
value ``val``.
:param AuthError val:
:rtype: ErrUnion
"""
return cls('auth_error', val)

def is_auth_error(self):
"""
Check if the union tag is ``auth_error``.
:rtype: bool
"""
return self._tag == 'auth_error'

def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'

def get_auth_error(self):
"""
Only call this if :meth:`is_auth_error` is true.
:rtype: AuthError
"""
if not self.is_auth_error():
raise AttributeError("tag 'auth_error' not set")
return self._value

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

ErrUnion_validator = bv.Union(ErrUnion)

AuthError._invalid_token_validator = bv.Void()
AuthError._no_openid_auth_validator = bv.Void()
AuthError._other_validator = bv.Void()
AuthError._tagmap = {
'invalid_token': AuthError._invalid_token_validator,
'no_openid_auth': AuthError._no_openid_auth_validator,
'other': AuthError._other_validator,
}

AuthError.invalid_token = AuthError('invalid_token')
AuthError.no_openid_auth = AuthError('no_openid_auth')
AuthError.other = AuthError('other')

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

UserInfoError.err.validator = bv.Nullable(ErrUnion_validator)
UserInfoError.error_message.validator = bv.String()
UserInfoError._all_field_names_ = set([
'err',
'error_message',
])
UserInfoError._all_fields_ = [
('err', UserInfoError.err.validator),
('error_message', UserInfoError.error_message.validator),
]

UserInfoResult.family_name.validator = bv.Nullable(bv.String())
UserInfoResult.given_name.validator = bv.Nullable(bv.String())
UserInfoResult.email.validator = bv.Nullable(bv.String())
UserInfoResult.email_verified.validator = bv.Nullable(bv.Boolean())
UserInfoResult.iss.validator = bv.String()
UserInfoResult.sub.validator = bv.String()
UserInfoResult._all_field_names_ = set([
'family_name',
'given_name',
'email',
'email_verified',
'iss',
'sub',
])
UserInfoResult._all_fields_ = [
('family_name', UserInfoResult.family_name.validator),
('given_name', UserInfoResult.given_name.validator),
('email', UserInfoResult.email.validator),
('email_verified', UserInfoResult.email_verified.validator),
('iss', UserInfoResult.iss.validator),
('sub', UserInfoResult.sub.validator),
]

ErrUnion._auth_error_validator = AuthError_validator
ErrUnion._other_validator = bv.Void()
ErrUnion._tagmap = {
'auth_error': ErrUnion._auth_error_validator,
'other': ErrUnion._other_validator,
}

ErrUnion.other = ErrUnion('other')

UserInfoError.error_message.default = ''
UserInfoResult.iss.default = ''
UserInfoResult.sub.default = ''
ROUTES = {
}

30 changes: 29 additions & 1 deletion dropbox/sharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2349,31 +2349,53 @@ class FileMemberActionResult(bb.Struct):
:ivar sharing.FileMemberActionResult.member: One of specified input members.
:ivar sharing.FileMemberActionResult.result: The outcome of the action on
this member.
:ivar sharing.FileMemberActionResult.sckey_sha1: The SHA-1 encrypted shared
content key.
:ivar sharing.FileMemberActionResult.invitation_signature: The sharing
sender-recipient invitation signatures for the input member_id. A
member_id can be a group and thus have multiple users and multiple
invitation signatures.
"""

__slots__ = [
'_member_value',
'_result_value',
'_sckey_sha1_value',
'_invitation_signature_value',
]

_has_required_fields = True

def __init__(self,
member=None,
result=None):
result=None,
sckey_sha1=None,
invitation_signature=None):
self._member_value = bb.NOT_SET
self._result_value = bb.NOT_SET
self._sckey_sha1_value = bb.NOT_SET
self._invitation_signature_value = bb.NOT_SET
if member is not None:
self.member = member
if result is not None:
self.result = result
if sckey_sha1 is not None:
self.sckey_sha1 = sckey_sha1
if invitation_signature is not None:
self.invitation_signature = invitation_signature

# Instance attribute type: MemberSelector (validator is set below)
member = bb.Attribute("member", user_defined=True)

# Instance attribute type: FileMemberActionIndividualResult (validator is set below)
result = bb.Attribute("result", user_defined=True)

# Instance attribute type: str (validator is set below)
sckey_sha1 = bb.Attribute("sckey_sha1", nullable=True)

# Instance attribute type: list of [str] (validator is set below)
invitation_signature = bb.Attribute("invitation_signature", nullable=True)

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

Expand Down Expand Up @@ -11533,13 +11555,19 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):

FileMemberActionResult.member.validator = MemberSelector_validator
FileMemberActionResult.result.validator = FileMemberActionIndividualResult_validator
FileMemberActionResult.sckey_sha1.validator = bv.Nullable(bv.String())
FileMemberActionResult.invitation_signature.validator = bv.Nullable(bv.List(bv.String()))
FileMemberActionResult._all_field_names_ = set([
'member',
'result',
'sckey_sha1',
'invitation_signature',
])
FileMemberActionResult._all_fields_ = [
('member', FileMemberActionResult.member.validator),
('result', FileMemberActionResult.result.validator),
('sckey_sha1', FileMemberActionResult.sckey_sha1.validator),
('invitation_signature', FileMemberActionResult.invitation_signature.validator),
]

FileMemberRemoveActionResult._success_validator = MemberAccessLevelResult_validator
Expand Down
Loading

0 comments on commit 4a3c7f5

Please sign in to comment.