Skip to content

Commit

Permalink
Updated API specification.
Browse files Browse the repository at this point in the history
Auth namespace:
- Added user_suspended to AuthError.

Files namespace:
- Added PathRootError.
- Added invalid_path_root to LookupError.
- Added autorename to CreateFolderArg.
- Added DeleteBatchArg, DeleteBatchResultEntry, DeleteResult,
  DeleteBatchResult, DeleteBatchError and DeleteBatchJobStatus.
- Added delete_batch and delete_batch/check routes.
- Added RelocationPath.
- Added to allow_shared_folder and autorename to RelocationArg.
- Added RelocationBatchArg, RelocationBatchResult, RelocationBatchJobStatus.
  RelocationResult and RelocationBatchError.
- Added copy_batch and copy_batch/check routes.
- Added move_batch and move_batch/check routes.

Sharing namespace:
- Changed PathOrId validation pattern.
- Changed path in ShareFolderArg from type files.Path to files.WritePath.
- Added contains_app_folder, contains_team_folder and invalid_path_root to
  ShareFolderArg.

Stone Cfg namespace:
- Changed validation pattern for owner in Route.

Team namespace:
- Added team_license_limit to MembersRecoverError.
- Removed beta_group attribute from members/recover.
  • Loading branch information
braincore committed Sep 29, 2016
1 parent 350e6e2 commit 56f2f33
Show file tree
Hide file tree
Showing 8 changed files with 1,668 additions and 109 deletions.
14 changes: 14 additions & 0 deletions dropbox/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class AuthError(bb.Union):
is no longer on the team.
:ivar invalid_select_admin: The user specified in 'Dropbox-API-Select-Admin'
is not a Dropbox Business team admin.
:ivar user_suspended: The user has been suspended.
"""

_catch_all = 'other'
Expand All @@ -32,6 +33,8 @@ class AuthError(bb.Union):
# Attribute is overwritten below the class definition
invalid_select_admin = None
# Attribute is overwritten below the class definition
user_suspended = None
# Attribute is overwritten below the class definition
other = None

def is_invalid_access_token(self):
Expand All @@ -58,6 +61,14 @@ def is_invalid_select_admin(self):
"""
return self._tag == 'invalid_select_admin'

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

def is_other(self):
"""
Check if the union tag is ``other``.
Expand Down Expand Up @@ -208,17 +219,20 @@ def __repr__(self):
AuthError._invalid_access_token_validator = bv.Void()
AuthError._invalid_select_user_validator = bv.Void()
AuthError._invalid_select_admin_validator = bv.Void()
AuthError._user_suspended_validator = bv.Void()
AuthError._other_validator = bv.Void()
AuthError._tagmap = {
'invalid_access_token': AuthError._invalid_access_token_validator,
'invalid_select_user': AuthError._invalid_select_user_validator,
'invalid_select_admin': AuthError._invalid_select_admin_validator,
'user_suspended': AuthError._user_suspended_validator,
'other': AuthError._other_validator,
}

AuthError.invalid_access_token = AuthError('invalid_access_token')
AuthError.invalid_select_user = AuthError('invalid_select_user')
AuthError.invalid_select_admin = AuthError('invalid_select_admin')
AuthError.user_suspended = AuthError('user_suspended')
AuthError.other = AuthError('other')

RateLimitError._reason_validator = RateLimitReason_validator
Expand Down
Loading

0 comments on commit 56f2f33

Please sign in to comment.