@@ -101,6 +101,9 @@ def get_paper_access_denied(self):
101
101
raise AttributeError ("tag 'paper_access_denied' not set" )
102
102
return self ._value
103
103
104
+ def _process_custom_annotations (self , annotation_type , processor ):
105
+ super (AccessError , self )._process_custom_annotations (annotation_type , processor )
106
+
104
107
def __repr__ (self ):
105
108
return 'AccessError(%r, %r)' % (self ._tag , self ._value )
106
109
@@ -120,6 +123,7 @@ class AuthError(bb.Union):
120
123
:ivar invalid_select_admin: The user specified in 'Dropbox-API-Select-Admin'
121
124
is not a Dropbox Business team admin.
122
125
:ivar user_suspended: The user has been suspended.
126
+ :ivar expired_access_token: The access token has expired.
123
127
"""
124
128
125
129
_catch_all = 'other'
@@ -132,6 +136,8 @@ class AuthError(bb.Union):
132
136
# Attribute is overwritten below the class definition
133
137
user_suspended = None
134
138
# Attribute is overwritten below the class definition
139
+ expired_access_token = None
140
+ # Attribute is overwritten below the class definition
135
141
other = None
136
142
137
143
def is_invalid_access_token (self ):
@@ -166,6 +172,14 @@ def is_user_suspended(self):
166
172
"""
167
173
return self ._tag == 'user_suspended'
168
174
175
+ def is_expired_access_token (self ):
176
+ """
177
+ Check if the union tag is ``expired_access_token``.
178
+
179
+ :rtype: bool
180
+ """
181
+ return self ._tag == 'expired_access_token'
182
+
169
183
def is_other (self ):
170
184
"""
171
185
Check if the union tag is ``other``.
@@ -174,6 +188,9 @@ def is_other(self):
174
188
"""
175
189
return self ._tag == 'other'
176
190
191
+ def _process_custom_annotations (self , annotation_type , processor ):
192
+ super (AuthError , self )._process_custom_annotations (annotation_type , processor )
193
+
177
194
def __repr__ (self ):
178
195
return 'AuthError(%r, %r)' % (self ._tag , self ._value )
179
196
@@ -223,6 +240,9 @@ def is_other(self):
223
240
"""
224
241
return self ._tag == 'other'
225
242
243
+ def _process_custom_annotations (self , annotation_type , processor ):
244
+ super (InvalidAccountTypeError , self )._process_custom_annotations (annotation_type , processor )
245
+
226
246
def __repr__ (self ):
227
247
return 'InvalidAccountTypeError(%r, %r)' % (self ._tag , self ._value )
228
248
@@ -270,12 +290,15 @@ def is_other(self):
270
290
"""
271
291
return self ._tag == 'other'
272
292
293
+ def _process_custom_annotations (self , annotation_type , processor ):
294
+ super (PaperAccessError , self )._process_custom_annotations (annotation_type , processor )
295
+
273
296
def __repr__ (self ):
274
297
return 'PaperAccessError(%r, %r)' % (self ._tag , self ._value )
275
298
276
299
PaperAccessError_validator = bv .Union (PaperAccessError )
277
300
278
- class RateLimitError (object ):
301
+ class RateLimitError (bb . Struct ):
279
302
"""
280
303
Error occurred because the app is being rate limited.
281
304
@@ -352,6 +375,9 @@ def retry_after(self):
352
375
self ._retry_after_value = None
353
376
self ._retry_after_present = False
354
377
378
+ def _process_custom_annotations (self , annotation_type , processor ):
379
+ super (RateLimitError , self )._process_custom_annotations (annotation_type , processor )
380
+
355
381
def __repr__ (self ):
356
382
return 'RateLimitError(reason={!r}, retry_after={!r})' .format (
357
383
self ._reason_value ,
@@ -404,12 +430,15 @@ def is_other(self):
404
430
"""
405
431
return self ._tag == 'other'
406
432
433
+ def _process_custom_annotations (self , annotation_type , processor ):
434
+ super (RateLimitReason , self )._process_custom_annotations (annotation_type , processor )
435
+
407
436
def __repr__ (self ):
408
437
return 'RateLimitReason(%r, %r)' % (self ._tag , self ._value )
409
438
410
439
RateLimitReason_validator = bv .Union (RateLimitReason )
411
440
412
- class TokenFromOAuth1Arg (object ):
441
+ class TokenFromOAuth1Arg (bb . Struct ):
413
442
"""
414
443
:ivar oauth1_token: The supplied OAuth 1.0 access token.
415
444
:ivar oauth1_token_secret: The token secret associated with the supplied
@@ -483,6 +512,9 @@ def oauth1_token_secret(self):
483
512
self ._oauth1_token_secret_value = None
484
513
self ._oauth1_token_secret_present = False
485
514
515
+ def _process_custom_annotations (self , annotation_type , processor ):
516
+ super (TokenFromOAuth1Arg , self )._process_custom_annotations (annotation_type , processor )
517
+
486
518
def __repr__ (self ):
487
519
return 'TokenFromOAuth1Arg(oauth1_token={!r}, oauth1_token_secret={!r})' .format (
488
520
self ._oauth1_token_value ,
@@ -535,12 +567,15 @@ def is_other(self):
535
567
"""
536
568
return self ._tag == 'other'
537
569
570
+ def _process_custom_annotations (self , annotation_type , processor ):
571
+ super (TokenFromOAuth1Error , self )._process_custom_annotations (annotation_type , processor )
572
+
538
573
def __repr__ (self ):
539
574
return 'TokenFromOAuth1Error(%r, %r)' % (self ._tag , self ._value )
540
575
541
576
TokenFromOAuth1Error_validator = bv .Union (TokenFromOAuth1Error )
542
577
543
- class TokenFromOAuth1Result (object ):
578
+ class TokenFromOAuth1Result (bb . Struct ):
544
579
"""
545
580
:ivar oauth2_token: The OAuth 2.0 token generated from the supplied OAuth
546
581
1.0 token.
@@ -583,6 +618,9 @@ def oauth2_token(self):
583
618
self ._oauth2_token_value = None
584
619
self ._oauth2_token_present = False
585
620
621
+ def _process_custom_annotations (self , annotation_type , processor ):
622
+ super (TokenFromOAuth1Result , self )._process_custom_annotations (annotation_type , processor )
623
+
586
624
def __repr__ (self ):
587
625
return 'TokenFromOAuth1Result(oauth2_token={!r})' .format (
588
626
self ._oauth2_token_value ,
@@ -605,19 +643,22 @@ def __repr__(self):
605
643
AuthError ._invalid_select_user_validator = bv .Void ()
606
644
AuthError ._invalid_select_admin_validator = bv .Void ()
607
645
AuthError ._user_suspended_validator = bv .Void ()
646
+ AuthError ._expired_access_token_validator = bv .Void ()
608
647
AuthError ._other_validator = bv .Void ()
609
648
AuthError ._tagmap = {
610
649
'invalid_access_token' : AuthError ._invalid_access_token_validator ,
611
650
'invalid_select_user' : AuthError ._invalid_select_user_validator ,
612
651
'invalid_select_admin' : AuthError ._invalid_select_admin_validator ,
613
652
'user_suspended' : AuthError ._user_suspended_validator ,
653
+ 'expired_access_token' : AuthError ._expired_access_token_validator ,
614
654
'other' : AuthError ._other_validator ,
615
655
}
616
656
617
657
AuthError .invalid_access_token = AuthError ('invalid_access_token' )
618
658
AuthError .invalid_select_user = AuthError ('invalid_select_user' )
619
659
AuthError .invalid_select_admin = AuthError ('invalid_select_admin' )
620
660
AuthError .user_suspended = AuthError ('user_suspended' )
661
+ AuthError .expired_access_token = AuthError ('expired_access_token' )
621
662
AuthError .other = AuthError ('other' )
622
663
623
664
InvalidAccountTypeError ._endpoint_validator = bv .Void ()
0 commit comments