Skip to content

Commit 4a3c7f5

Browse files
DropboxBotBrent Bumann
and
Brent Bumann
authored
Automated Spec Update (dropbox#439)
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]>
1 parent f3f8729 commit 4a3c7f5

File tree

8 files changed

+621
-3
lines changed

8 files changed

+621
-3
lines changed

dropbox/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from dropbox import file_properties
1616
from dropbox import file_requests
1717
from dropbox import files
18+
from dropbox import openid
1819
from dropbox import paper
1920
from dropbox import secondary_emails
2021
from dropbox import seen_state

dropbox/base_team.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from dropbox import file_properties
1616
from dropbox import file_requests
1717
from dropbox import files
18+
from dropbox import openid
1819
from dropbox import paper
1920
from dropbox import secondary_emails
2021
from dropbox import seen_state

dropbox/check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
6363

6464
EchoResult_validator = bv.Struct(EchoResult)
6565

66-
EchoArg.query.validator = bv.String()
66+
EchoArg.query.validator = bv.String(max_length=500)
6767
EchoArg._all_field_names_ = set(['query'])
6868
EchoArg._all_fields_ = [('query', EchoArg.query.validator)]
6969

dropbox/openid.py

+282
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
# -*- coding: utf-8 -*-
2+
# Auto-generated by Stone, do not modify.
3+
# @generated
4+
# flake8: noqa
5+
# pylint: skip-file
6+
from __future__ import unicode_literals
7+
from stone.backends.python_rsrc import stone_base as bb
8+
from stone.backends.python_rsrc import stone_validators as bv
9+
10+
class AuthError(bb.Union):
11+
"""
12+
This class acts as a tagged union. Only one of the ``is_*`` methods will
13+
return true. To get the associated value of a tag (if one exists), use the
14+
corresponding ``get_*`` method.
15+
"""
16+
17+
_catch_all = 'other'
18+
# Attribute is overwritten below the class definition
19+
invalid_token = None
20+
# Attribute is overwritten below the class definition
21+
no_openid_auth = None
22+
# Attribute is overwritten below the class definition
23+
other = None
24+
25+
def is_invalid_token(self):
26+
"""
27+
Check if the union tag is ``invalid_token``.
28+
29+
:rtype: bool
30+
"""
31+
return self._tag == 'invalid_token'
32+
33+
def is_no_openid_auth(self):
34+
"""
35+
Check if the union tag is ``no_openid_auth``.
36+
37+
:rtype: bool
38+
"""
39+
return self._tag == 'no_openid_auth'
40+
41+
def is_other(self):
42+
"""
43+
Check if the union tag is ``other``.
44+
45+
:rtype: bool
46+
"""
47+
return self._tag == 'other'
48+
49+
def _process_custom_annotations(self, annotation_type, field_path, processor):
50+
super(AuthError, self)._process_custom_annotations(annotation_type, field_path, processor)
51+
52+
AuthError_validator = bv.Union(AuthError)
53+
54+
class UserInfoArgs(bb.Struct):
55+
"""
56+
This struct is empty. The comment here is intentionally emitted to avoid
57+
indentation issues with Stone.
58+
"""
59+
60+
__slots__ = [
61+
]
62+
63+
_has_required_fields = False
64+
65+
def __init__(self):
66+
pass
67+
68+
def _process_custom_annotations(self, annotation_type, field_path, processor):
69+
super(UserInfoArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
70+
71+
UserInfoArgs_validator = bv.Struct(UserInfoArgs)
72+
73+
class UserInfoError(bb.Struct):
74+
75+
__slots__ = [
76+
'_err_value',
77+
'_error_message_value',
78+
]
79+
80+
_has_required_fields = False
81+
82+
def __init__(self,
83+
err=None,
84+
error_message=None):
85+
self._err_value = bb.NOT_SET
86+
self._error_message_value = bb.NOT_SET
87+
if err is not None:
88+
self.err = err
89+
if error_message is not None:
90+
self.error_message = error_message
91+
92+
# Instance attribute type: ErrUnion (validator is set below)
93+
err = bb.Attribute("err", nullable=True, user_defined=True)
94+
95+
# Instance attribute type: str (validator is set below)
96+
error_message = bb.Attribute("error_message")
97+
98+
def _process_custom_annotations(self, annotation_type, field_path, processor):
99+
super(UserInfoError, self)._process_custom_annotations(annotation_type, field_path, processor)
100+
101+
UserInfoError_validator = bv.Struct(UserInfoError)
102+
103+
class UserInfoResult(bb.Struct):
104+
105+
__slots__ = [
106+
'_family_name_value',
107+
'_given_name_value',
108+
'_email_value',
109+
'_email_verified_value',
110+
'_iss_value',
111+
'_sub_value',
112+
]
113+
114+
_has_required_fields = False
115+
116+
def __init__(self,
117+
family_name=None,
118+
given_name=None,
119+
email=None,
120+
email_verified=None,
121+
iss=None,
122+
sub=None):
123+
self._family_name_value = bb.NOT_SET
124+
self._given_name_value = bb.NOT_SET
125+
self._email_value = bb.NOT_SET
126+
self._email_verified_value = bb.NOT_SET
127+
self._iss_value = bb.NOT_SET
128+
self._sub_value = bb.NOT_SET
129+
if family_name is not None:
130+
self.family_name = family_name
131+
if given_name is not None:
132+
self.given_name = given_name
133+
if email is not None:
134+
self.email = email
135+
if email_verified is not None:
136+
self.email_verified = email_verified
137+
if iss is not None:
138+
self.iss = iss
139+
if sub is not None:
140+
self.sub = sub
141+
142+
# Instance attribute type: str (validator is set below)
143+
family_name = bb.Attribute("family_name", nullable=True)
144+
145+
# Instance attribute type: str (validator is set below)
146+
given_name = bb.Attribute("given_name", nullable=True)
147+
148+
# Instance attribute type: str (validator is set below)
149+
email = bb.Attribute("email", nullable=True)
150+
151+
# Instance attribute type: bool (validator is set below)
152+
email_verified = bb.Attribute("email_verified", nullable=True)
153+
154+
# Instance attribute type: str (validator is set below)
155+
iss = bb.Attribute("iss")
156+
157+
# Instance attribute type: str (validator is set below)
158+
sub = bb.Attribute("sub")
159+
160+
def _process_custom_annotations(self, annotation_type, field_path, processor):
161+
super(UserInfoResult, self)._process_custom_annotations(annotation_type, field_path, processor)
162+
163+
UserInfoResult_validator = bv.Struct(UserInfoResult)
164+
165+
class ErrUnion(bb.Union):
166+
"""
167+
This class acts as a tagged union. Only one of the ``is_*`` methods will
168+
return true. To get the associated value of a tag (if one exists), use the
169+
corresponding ``get_*`` method.
170+
"""
171+
172+
_catch_all = 'other'
173+
# Attribute is overwritten below the class definition
174+
other = None
175+
176+
@classmethod
177+
def auth_error(cls, val):
178+
"""
179+
Create an instance of this class set to the ``auth_error`` tag with
180+
value ``val``.
181+
182+
:param AuthError val:
183+
:rtype: ErrUnion
184+
"""
185+
return cls('auth_error', val)
186+
187+
def is_auth_error(self):
188+
"""
189+
Check if the union tag is ``auth_error``.
190+
191+
:rtype: bool
192+
"""
193+
return self._tag == 'auth_error'
194+
195+
def is_other(self):
196+
"""
197+
Check if the union tag is ``other``.
198+
199+
:rtype: bool
200+
"""
201+
return self._tag == 'other'
202+
203+
def get_auth_error(self):
204+
"""
205+
Only call this if :meth:`is_auth_error` is true.
206+
207+
:rtype: AuthError
208+
"""
209+
if not self.is_auth_error():
210+
raise AttributeError("tag 'auth_error' not set")
211+
return self._value
212+
213+
def _process_custom_annotations(self, annotation_type, field_path, processor):
214+
super(ErrUnion, self)._process_custom_annotations(annotation_type, field_path, processor)
215+
216+
ErrUnion_validator = bv.Union(ErrUnion)
217+
218+
AuthError._invalid_token_validator = bv.Void()
219+
AuthError._no_openid_auth_validator = bv.Void()
220+
AuthError._other_validator = bv.Void()
221+
AuthError._tagmap = {
222+
'invalid_token': AuthError._invalid_token_validator,
223+
'no_openid_auth': AuthError._no_openid_auth_validator,
224+
'other': AuthError._other_validator,
225+
}
226+
227+
AuthError.invalid_token = AuthError('invalid_token')
228+
AuthError.no_openid_auth = AuthError('no_openid_auth')
229+
AuthError.other = AuthError('other')
230+
231+
UserInfoArgs._all_field_names_ = set([])
232+
UserInfoArgs._all_fields_ = []
233+
234+
UserInfoError.err.validator = bv.Nullable(ErrUnion_validator)
235+
UserInfoError.error_message.validator = bv.String()
236+
UserInfoError._all_field_names_ = set([
237+
'err',
238+
'error_message',
239+
])
240+
UserInfoError._all_fields_ = [
241+
('err', UserInfoError.err.validator),
242+
('error_message', UserInfoError.error_message.validator),
243+
]
244+
245+
UserInfoResult.family_name.validator = bv.Nullable(bv.String())
246+
UserInfoResult.given_name.validator = bv.Nullable(bv.String())
247+
UserInfoResult.email.validator = bv.Nullable(bv.String())
248+
UserInfoResult.email_verified.validator = bv.Nullable(bv.Boolean())
249+
UserInfoResult.iss.validator = bv.String()
250+
UserInfoResult.sub.validator = bv.String()
251+
UserInfoResult._all_field_names_ = set([
252+
'family_name',
253+
'given_name',
254+
'email',
255+
'email_verified',
256+
'iss',
257+
'sub',
258+
])
259+
UserInfoResult._all_fields_ = [
260+
('family_name', UserInfoResult.family_name.validator),
261+
('given_name', UserInfoResult.given_name.validator),
262+
('email', UserInfoResult.email.validator),
263+
('email_verified', UserInfoResult.email_verified.validator),
264+
('iss', UserInfoResult.iss.validator),
265+
('sub', UserInfoResult.sub.validator),
266+
]
267+
268+
ErrUnion._auth_error_validator = AuthError_validator
269+
ErrUnion._other_validator = bv.Void()
270+
ErrUnion._tagmap = {
271+
'auth_error': ErrUnion._auth_error_validator,
272+
'other': ErrUnion._other_validator,
273+
}
274+
275+
ErrUnion.other = ErrUnion('other')
276+
277+
UserInfoError.error_message.default = ''
278+
UserInfoResult.iss.default = ''
279+
UserInfoResult.sub.default = ''
280+
ROUTES = {
281+
}
282+

dropbox/sharing.py

+29-1
Original file line numberDiff line numberDiff line change
@@ -2349,31 +2349,53 @@ class FileMemberActionResult(bb.Struct):
23492349
:ivar sharing.FileMemberActionResult.member: One of specified input members.
23502350
:ivar sharing.FileMemberActionResult.result: The outcome of the action on
23512351
this member.
2352+
:ivar sharing.FileMemberActionResult.sckey_sha1: The SHA-1 encrypted shared
2353+
content key.
2354+
:ivar sharing.FileMemberActionResult.invitation_signature: The sharing
2355+
sender-recipient invitation signatures for the input member_id. A
2356+
member_id can be a group and thus have multiple users and multiple
2357+
invitation signatures.
23522358
"""
23532359

23542360
__slots__ = [
23552361
'_member_value',
23562362
'_result_value',
2363+
'_sckey_sha1_value',
2364+
'_invitation_signature_value',
23572365
]
23582366

23592367
_has_required_fields = True
23602368

23612369
def __init__(self,
23622370
member=None,
2363-
result=None):
2371+
result=None,
2372+
sckey_sha1=None,
2373+
invitation_signature=None):
23642374
self._member_value = bb.NOT_SET
23652375
self._result_value = bb.NOT_SET
2376+
self._sckey_sha1_value = bb.NOT_SET
2377+
self._invitation_signature_value = bb.NOT_SET
23662378
if member is not None:
23672379
self.member = member
23682380
if result is not None:
23692381
self.result = result
2382+
if sckey_sha1 is not None:
2383+
self.sckey_sha1 = sckey_sha1
2384+
if invitation_signature is not None:
2385+
self.invitation_signature = invitation_signature
23702386

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

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

2393+
# Instance attribute type: str (validator is set below)
2394+
sckey_sha1 = bb.Attribute("sckey_sha1", nullable=True)
2395+
2396+
# Instance attribute type: list of [str] (validator is set below)
2397+
invitation_signature = bb.Attribute("invitation_signature", nullable=True)
2398+
23772399
def _process_custom_annotations(self, annotation_type, field_path, processor):
23782400
super(FileMemberActionResult, self)._process_custom_annotations(annotation_type, field_path, processor)
23792401

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

1153411556
FileMemberActionResult.member.validator = MemberSelector_validator
1153511557
FileMemberActionResult.result.validator = FileMemberActionIndividualResult_validator
11558+
FileMemberActionResult.sckey_sha1.validator = bv.Nullable(bv.String())
11559+
FileMemberActionResult.invitation_signature.validator = bv.Nullable(bv.List(bv.String()))
1153611560
FileMemberActionResult._all_field_names_ = set([
1153711561
'member',
1153811562
'result',
11563+
'sckey_sha1',
11564+
'invitation_signature',
1153911565
])
1154011566
FileMemberActionResult._all_fields_ = [
1154111567
('member', FileMemberActionResult.member.validator),
1154211568
('result', FileMemberActionResult.result.validator),
11569+
('sckey_sha1', FileMemberActionResult.sckey_sha1.validator),
11570+
('invitation_signature', FileMemberActionResult.invitation_signature.validator),
1154311571
]
1154411572

1154511573
FileMemberRemoveActionResult._success_validator = MemberAccessLevelResult_validator

0 commit comments

Comments
 (0)