Skip to content

Commit

Permalink
Automated Spec Update (#267)
Browse files Browse the repository at this point in the history
21128d88b32d584c8cfd264c170cd3bd92c020d2

 Change Notes:

Files Namespace:
- Update SearchArg, SearchV2Arg, CreateFolderBatchArg structs to include limits
- Update Comments

Sharing Folders Namespace:
- Update SharePathError union to include is_family

Team Log Generated Namespace:
- Add ComputerBackupPolicyChangedDetails, ComputerBackupPolicyChangedType structs
- Update EventDetails union to include computer_backup_policy_changed_details
- Update EventType union to include computer_backup_policy_changed and computer_backup_policy_changed

Team Policies Namespace:
- Add ComputerBackupPolicyState union

Co-authored-by: rogebrd <[email protected]>
rogebrd and rogebrd authored Oct 12, 2020

Verified

This commit was signed with the committer’s verified signature.
agostbiro Agost Biro
1 parent e03567f commit fdd342b
Showing 6 changed files with 424 additions and 64 deletions.
54 changes: 14 additions & 40 deletions dropbox/base.py
Original file line number Diff line number Diff line change
@@ -807,11 +807,7 @@ def files_copy_v2(self,
Copy a file or folder to a different location in the user's Dropbox. If
the source path is a folder all its contents will be copied.
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
contents in shared folder, otherwise
``RelocationError.cant_copy_shared_folder`` will be returned if
``from_path`` contains shared folder. This field is always true for
:meth:`files_move`.
:param bool allow_shared_folder: This flag has no effect.
:param bool autorename: If there's a conflict, have the Dropbox server
try to autorename the file to avoid the conflict.
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -846,11 +842,7 @@ def files_copy(self,
Copy a file or folder to a different location in the user's Dropbox. If
the source path is a folder all its contents will be copied.
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
contents in shared folder, otherwise
``RelocationError.cant_copy_shared_folder`` will be returned if
``from_path`` contains shared folder. This field is always true for
:meth:`files_move`.
:param bool allow_shared_folder: This flag has no effect.
:param bool autorename: If there's a conflict, have the Dropbox server
try to autorename the file to avoid the conflict.
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -914,19 +906,11 @@ def files_copy_batch(self,
allow_ownership_transfer=False):
"""
Copy multiple files or folders to different locations at once in the
user's Dropbox. If ``RelocationBatchArg.allow_shared_folder`` is false,
this route is atomic. If one entry fails, the whole transaction will
abort. If ``RelocationBatchArg.allow_shared_folder`` is true, atomicity
is not guaranteed, but it allows you to copy the contents of shared
folders to new locations. This route will return job ID immediately and
do the async copy job in background. Please use
:meth:`files_copy_batch_check` to check the job status.
:param bool allow_shared_folder: If true, :meth:`files_copy_batch` will
copy contents in shared folder, otherwise
``RelocationError.cant_copy_shared_folder`` will be returned if
``RelocationPath.from_path`` contains shared folder. This field is
always true for :meth:`files_move_batch`.
user's Dropbox. This route will return job ID immediately and do the
async copy job in background. Please use :meth:`files_copy_batch_check`
to check the job status.
:param bool allow_shared_folder: This flag has no effect.
:param bool allow_ownership_transfer: Allow moves by owner even if it
would result in an ownership transfer for the content being moved.
This does not apply to copies.
@@ -2145,11 +2129,7 @@ def files_move_v2(self,
the source path is a folder all its contents will be moved. Note that we
do not currently support case-only renaming.
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
contents in shared folder, otherwise
``RelocationError.cant_copy_shared_folder`` will be returned if
``from_path`` contains shared folder. This field is always true for
:meth:`files_move`.
:param bool allow_shared_folder: This flag has no effect.
:param bool autorename: If there's a conflict, have the Dropbox server
try to autorename the file to avoid the conflict.
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -2184,11 +2164,7 @@ def files_move(self,
Move a file or folder to a different location in the user's Dropbox. If
the source path is a folder all its contents will be moved.
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
contents in shared folder, otherwise
``RelocationError.cant_copy_shared_folder`` will be returned if
``from_path`` contains shared folder. This field is always true for
:meth:`files_move`.
:param bool allow_shared_folder: This flag has no effect.
:param bool autorename: If there's a conflict, have the Dropbox server
try to autorename the file to avoid the conflict.
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -2258,11 +2234,7 @@ def files_move_batch(self,
async moving job in background. Please use
:meth:`files_move_batch_check` to check the job status.
:param bool allow_shared_folder: If true, :meth:`files_copy_batch` will
copy contents in shared folder, otherwise
``RelocationError.cant_copy_shared_folder`` will be returned if
``RelocationPath.from_path`` contains shared folder. This field is
always true for :meth:`files_move_batch`.
:param bool allow_shared_folder: This flag has no effect.
:param bool allow_ownership_transfer: Allow moves by owner even if it
would result in an ownership transfer for the content being moved.
This does not apply to copies.
@@ -2339,8 +2311,10 @@ def files_permanently_delete(self,
parent_rev=None):
"""
Permanently delete the file or folder at a given path (see
https://www.dropbox.com/en/help/40). Note: This endpoint is only
available for Dropbox Business apps.
https://www.dropbox.com/en/help/40). If the given file or folder is not
yet deleted, this route will first delete it. It is possible for this
route to successfully delete, then fail to permanently delete. Note:
This endpoint is only available for Dropbox Business apps.
:param str path: Path in the user's Dropbox to delete.
:param Nullable parent_rev: Perform delete if given "rev" matches the
30 changes: 7 additions & 23 deletions dropbox/files.py
Original file line number Diff line number Diff line change
@@ -9081,11 +9081,7 @@ def __repr__(self):

class RelocationArg(RelocationPath):
"""
:ivar files.RelocationArg.allow_shared_folder: If true,
:meth:`dropbox.dropbox.Dropbox.files_copy` will copy contents in shared
folder, otherwise ``RelocationError.cant_copy_shared_folder`` will be
returned if ``from_path`` contains shared folder. This field is always
true for :meth:`dropbox.dropbox.Dropbox.files_move`.
:ivar files.RelocationArg.allow_shared_folder: This flag has no effect.
:ivar files.RelocationArg.autorename: If there's a conflict, have the
Dropbox server try to autorename the file to avoid the conflict.
:ivar files.RelocationArg.allow_ownership_transfer: Allow moves by owner
@@ -9128,10 +9124,7 @@ def __init__(self,
@property
def allow_shared_folder(self):
"""
If true, :meth:`dropbox.dropbox.Dropbox.files_copy` will copy contents
in shared folder, otherwise ``RelocationError.cant_copy_shared_folder``
will be returned if ``from_path`` contains shared folder. This field is
always true for :meth:`dropbox.dropbox.Dropbox.files_move`.
This flag has no effect.

:rtype: bool
"""
@@ -9215,12 +9208,7 @@ def __repr__(self):

class RelocationBatchArg(RelocationBatchArgBase):
"""
:ivar files.RelocationBatchArg.allow_shared_folder: If true,
:meth:`dropbox.dropbox.Dropbox.files_copy_batch` will copy contents in
shared folder, otherwise ``RelocationError.cant_copy_shared_folder``
will be returned if ``RelocationPath.from_path`` contains shared folder.
This field is always true for
:meth:`dropbox.dropbox.Dropbox.files_move_batch`.
:ivar files.RelocationBatchArg.allow_shared_folder: This flag has no effect.
:ivar files.RelocationBatchArg.allow_ownership_transfer: Allow moves by
owner even if it would result in an ownership transfer for the content
being moved. This does not apply to copies.
@@ -9254,11 +9242,7 @@ def __init__(self,
@property
def allow_shared_folder(self):
"""
If true, :meth:`dropbox.dropbox.Dropbox.files_copy_batch` will copy
contents in shared folder, otherwise
``RelocationError.cant_copy_shared_folder`` will be returned if
``RelocationPath.from_path`` contains shared folder. This field is
always true for :meth:`dropbox.dropbox.Dropbox.files_move_batch`.
This flag has no effect.

:rtype: bool
"""
@@ -15451,7 +15435,7 @@ def __repr__(self):
('autorename', CreateFolderArg._autorename_validator),
]

CreateFolderBatchArg._paths_validator = bv.List(WritePath_validator)
CreateFolderBatchArg._paths_validator = bv.List(WritePath_validator, max_items=10000)
CreateFolderBatchArg._autorename_validator = bv.Boolean()
CreateFolderBatchArg._force_async_validator = bv.Boolean()
CreateFolderBatchArg._all_field_names_ = set([
@@ -16731,7 +16715,7 @@ def __repr__(self):
SaveUrlResult._tagmap.update(async_.LaunchResultBase._tagmap)

SearchArg._path_validator = PathROrId_validator
SearchArg._query_validator = bv.String()
SearchArg._query_validator = bv.String(max_length=1000)
SearchArg._start_validator = bv.UInt64(max_value=9999)
SearchArg._max_results_validator = bv.UInt64(min_value=1, max_value=1000)
SearchArg._mode_validator = SearchMode_validator
@@ -16853,7 +16837,7 @@ def __repr__(self):
('start', SearchResult._start_validator),
]

SearchV2Arg._query_validator = bv.String()
SearchV2Arg._query_validator = bv.String(max_length=1000)
SearchV2Arg._options_validator = bv.Nullable(SearchOptions_validator)
SearchV2Arg._match_field_options_validator = bv.Nullable(SearchMatchFieldOptions_validator)
SearchV2Arg._include_highlights_validator = bv.Boolean()
15 changes: 15 additions & 0 deletions dropbox/sharing.py
Original file line number Diff line number Diff line change
@@ -12623,6 +12623,8 @@ class SharePathError(bb.Union):
folder inside a Mac OS X package.
:ivar sharing.SharePathError.is_vault: We do not support sharing the Vault
folder.
:ivar sharing.SharePathError.is_family: We do not support sharing the Family
folder.
"""

_catch_all = 'other'
@@ -12653,6 +12655,8 @@ class SharePathError(bb.Union):
# Attribute is overwritten below the class definition
is_vault = None
# Attribute is overwritten below the class definition
is_family = None
# Attribute is overwritten below the class definition
other = None

@classmethod
@@ -12778,6 +12782,14 @@ def is_is_vault(self):
"""
return self._tag == 'is_vault'

def is_is_family(self):
"""
Check if the union tag is ``is_family``.

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

def is_other(self):
"""
Check if the union tag is ``other``.
@@ -18923,6 +18935,7 @@ def __repr__(self):
SharePathError._is_osx_package_validator = bv.Void()
SharePathError._inside_osx_package_validator = bv.Void()
SharePathError._is_vault_validator = bv.Void()
SharePathError._is_family_validator = bv.Void()
SharePathError._other_validator = bv.Void()
SharePathError._tagmap = {
'is_file': SharePathError._is_file_validator,
@@ -18939,6 +18952,7 @@ def __repr__(self):
'is_osx_package': SharePathError._is_osx_package_validator,
'inside_osx_package': SharePathError._inside_osx_package_validator,
'is_vault': SharePathError._is_vault_validator,
'is_family': SharePathError._is_family_validator,
'other': SharePathError._other_validator,
}

@@ -18955,6 +18969,7 @@ def __repr__(self):
SharePathError.is_osx_package = SharePathError('is_osx_package')
SharePathError.inside_osx_package = SharePathError('inside_osx_package')
SharePathError.is_vault = SharePathError('is_vault')
SharePathError.is_family = SharePathError('is_family')
SharePathError.other = SharePathError('other')

SharedContentLinkMetadata._audience_exceptions_validator = bv.Nullable(AudienceExceptions_validator)
Loading

0 comments on commit fdd342b

Please sign in to comment.