Skip to content

Commit fdd342b

Browse files
authored
Automated Spec Update (#267)
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 <rogebrd@users.noreply.github.com>
1 parent e03567f commit fdd342b

File tree

6 files changed

+424
-64
lines changed

6 files changed

+424
-64
lines changed

dropbox/base.py

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,7 @@ def files_copy_v2(self,
807807
Copy a file or folder to a different location in the user's Dropbox. If
808808
the source path is a folder all its contents will be copied.
809809
810-
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
811-
contents in shared folder, otherwise
812-
``RelocationError.cant_copy_shared_folder`` will be returned if
813-
``from_path`` contains shared folder. This field is always true for
814-
:meth:`files_move`.
810+
:param bool allow_shared_folder: This flag has no effect.
815811
:param bool autorename: If there's a conflict, have the Dropbox server
816812
try to autorename the file to avoid the conflict.
817813
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -846,11 +842,7 @@ def files_copy(self,
846842
Copy a file or folder to a different location in the user's Dropbox. If
847843
the source path is a folder all its contents will be copied.
848844
849-
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
850-
contents in shared folder, otherwise
851-
``RelocationError.cant_copy_shared_folder`` will be returned if
852-
``from_path`` contains shared folder. This field is always true for
853-
:meth:`files_move`.
845+
:param bool allow_shared_folder: This flag has no effect.
854846
:param bool autorename: If there's a conflict, have the Dropbox server
855847
try to autorename the file to avoid the conflict.
856848
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -914,19 +906,11 @@ def files_copy_batch(self,
914906
allow_ownership_transfer=False):
915907
"""
916908
Copy multiple files or folders to different locations at once in the
917-
user's Dropbox. If ``RelocationBatchArg.allow_shared_folder`` is false,
918-
this route is atomic. If one entry fails, the whole transaction will
919-
abort. If ``RelocationBatchArg.allow_shared_folder`` is true, atomicity
920-
is not guaranteed, but it allows you to copy the contents of shared
921-
folders to new locations. This route will return job ID immediately and
922-
do the async copy job in background. Please use
923-
:meth:`files_copy_batch_check` to check the job status.
924-
925-
:param bool allow_shared_folder: If true, :meth:`files_copy_batch` will
926-
copy contents in shared folder, otherwise
927-
``RelocationError.cant_copy_shared_folder`` will be returned if
928-
``RelocationPath.from_path`` contains shared folder. This field is
929-
always true for :meth:`files_move_batch`.
909+
user's Dropbox. This route will return job ID immediately and do the
910+
async copy job in background. Please use :meth:`files_copy_batch_check`
911+
to check the job status.
912+
913+
:param bool allow_shared_folder: This flag has no effect.
930914
:param bool allow_ownership_transfer: Allow moves by owner even if it
931915
would result in an ownership transfer for the content being moved.
932916
This does not apply to copies.
@@ -2145,11 +2129,7 @@ def files_move_v2(self,
21452129
the source path is a folder all its contents will be moved. Note that we
21462130
do not currently support case-only renaming.
21472131
2148-
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
2149-
contents in shared folder, otherwise
2150-
``RelocationError.cant_copy_shared_folder`` will be returned if
2151-
``from_path`` contains shared folder. This field is always true for
2152-
:meth:`files_move`.
2132+
:param bool allow_shared_folder: This flag has no effect.
21532133
:param bool autorename: If there's a conflict, have the Dropbox server
21542134
try to autorename the file to avoid the conflict.
21552135
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -2184,11 +2164,7 @@ def files_move(self,
21842164
Move a file or folder to a different location in the user's Dropbox. If
21852165
the source path is a folder all its contents will be moved.
21862166
2187-
:param bool allow_shared_folder: If true, :meth:`files_copy` will copy
2188-
contents in shared folder, otherwise
2189-
``RelocationError.cant_copy_shared_folder`` will be returned if
2190-
``from_path`` contains shared folder. This field is always true for
2191-
:meth:`files_move`.
2167+
:param bool allow_shared_folder: This flag has no effect.
21922168
:param bool autorename: If there's a conflict, have the Dropbox server
21932169
try to autorename the file to avoid the conflict.
21942170
:param bool allow_ownership_transfer: Allow moves by owner even if it
@@ -2258,11 +2234,7 @@ def files_move_batch(self,
22582234
async moving job in background. Please use
22592235
:meth:`files_move_batch_check` to check the job status.
22602236
2261-
:param bool allow_shared_folder: If true, :meth:`files_copy_batch` will
2262-
copy contents in shared folder, otherwise
2263-
``RelocationError.cant_copy_shared_folder`` will be returned if
2264-
``RelocationPath.from_path`` contains shared folder. This field is
2265-
always true for :meth:`files_move_batch`.
2237+
:param bool allow_shared_folder: This flag has no effect.
22662238
:param bool allow_ownership_transfer: Allow moves by owner even if it
22672239
would result in an ownership transfer for the content being moved.
22682240
This does not apply to copies.
@@ -2339,8 +2311,10 @@ def files_permanently_delete(self,
23392311
parent_rev=None):
23402312
"""
23412313
Permanently delete the file or folder at a given path (see
2342-
https://www.dropbox.com/en/help/40). Note: This endpoint is only
2343-
available for Dropbox Business apps.
2314+
https://www.dropbox.com/en/help/40). If the given file or folder is not
2315+
yet deleted, this route will first delete it. It is possible for this
2316+
route to successfully delete, then fail to permanently delete. Note:
2317+
This endpoint is only available for Dropbox Business apps.
23442318
23452319
:param str path: Path in the user's Dropbox to delete.
23462320
:param Nullable parent_rev: Perform delete if given "rev" matches the

dropbox/files.py

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9081,11 +9081,7 @@ def __repr__(self):
90819081

90829082
class RelocationArg(RelocationPath):
90839083
"""
9084-
:ivar files.RelocationArg.allow_shared_folder: If true,
9085-
:meth:`dropbox.dropbox.Dropbox.files_copy` will copy contents in shared
9086-
folder, otherwise ``RelocationError.cant_copy_shared_folder`` will be
9087-
returned if ``from_path`` contains shared folder. This field is always
9088-
true for :meth:`dropbox.dropbox.Dropbox.files_move`.
9084+
:ivar files.RelocationArg.allow_shared_folder: This flag has no effect.
90899085
:ivar files.RelocationArg.autorename: If there's a conflict, have the
90909086
Dropbox server try to autorename the file to avoid the conflict.
90919087
:ivar files.RelocationArg.allow_ownership_transfer: Allow moves by owner
@@ -9128,10 +9124,7 @@ def __init__(self,
91289124
@property
91299125
def allow_shared_folder(self):
91309126
"""
9131-
If true, :meth:`dropbox.dropbox.Dropbox.files_copy` will copy contents
9132-
in shared folder, otherwise ``RelocationError.cant_copy_shared_folder``
9133-
will be returned if ``from_path`` contains shared folder. This field is
9134-
always true for :meth:`dropbox.dropbox.Dropbox.files_move`.
9127+
This flag has no effect.
91359128

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

92169209
class RelocationBatchArg(RelocationBatchArgBase):
92179210
"""
9218-
:ivar files.RelocationBatchArg.allow_shared_folder: If true,
9219-
:meth:`dropbox.dropbox.Dropbox.files_copy_batch` will copy contents in
9220-
shared folder, otherwise ``RelocationError.cant_copy_shared_folder``
9221-
will be returned if ``RelocationPath.from_path`` contains shared folder.
9222-
This field is always true for
9223-
:meth:`dropbox.dropbox.Dropbox.files_move_batch`.
9211+
:ivar files.RelocationBatchArg.allow_shared_folder: This flag has no effect.
92249212
:ivar files.RelocationBatchArg.allow_ownership_transfer: Allow moves by
92259213
owner even if it would result in an ownership transfer for the content
92269214
being moved. This does not apply to copies.
@@ -9254,11 +9242,7 @@ def __init__(self,
92549242
@property
92559243
def allow_shared_folder(self):
92569244
"""
9257-
If true, :meth:`dropbox.dropbox.Dropbox.files_copy_batch` will copy
9258-
contents in shared folder, otherwise
9259-
``RelocationError.cant_copy_shared_folder`` will be returned if
9260-
``RelocationPath.from_path`` contains shared folder. This field is
9261-
always true for :meth:`dropbox.dropbox.Dropbox.files_move_batch`.
9245+
This flag has no effect.
92629246

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

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

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

16856-
SearchV2Arg._query_validator = bv.String()
16840+
SearchV2Arg._query_validator = bv.String(max_length=1000)
1685716841
SearchV2Arg._options_validator = bv.Nullable(SearchOptions_validator)
1685816842
SearchV2Arg._match_field_options_validator = bv.Nullable(SearchMatchFieldOptions_validator)
1685916843
SearchV2Arg._include_highlights_validator = bv.Boolean()

dropbox/sharing.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12623,6 +12623,8 @@ class SharePathError(bb.Union):
1262312623
folder inside a Mac OS X package.
1262412624
:ivar sharing.SharePathError.is_vault: We do not support sharing the Vault
1262512625
folder.
12626+
:ivar sharing.SharePathError.is_family: We do not support sharing the Family
12627+
folder.
1262612628
"""
1262712629

1262812630
_catch_all = 'other'
@@ -12653,6 +12655,8 @@ class SharePathError(bb.Union):
1265312655
# Attribute is overwritten below the class definition
1265412656
is_vault = None
1265512657
# Attribute is overwritten below the class definition
12658+
is_family = None
12659+
# Attribute is overwritten below the class definition
1265612660
other = None
1265712661

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

12785+
def is_is_family(self):
12786+
"""
12787+
Check if the union tag is ``is_family``.
12788+
12789+
:rtype: bool
12790+
"""
12791+
return self._tag == 'is_family'
12792+
1278112793
def is_other(self):
1278212794
"""
1278312795
Check if the union tag is ``other``.
@@ -18923,6 +18935,7 @@ def __repr__(self):
1892318935
SharePathError._is_osx_package_validator = bv.Void()
1892418936
SharePathError._inside_osx_package_validator = bv.Void()
1892518937
SharePathError._is_vault_validator = bv.Void()
18938+
SharePathError._is_family_validator = bv.Void()
1892618939
SharePathError._other_validator = bv.Void()
1892718940
SharePathError._tagmap = {
1892818941
'is_file': SharePathError._is_file_validator,
@@ -18939,6 +18952,7 @@ def __repr__(self):
1893918952
'is_osx_package': SharePathError._is_osx_package_validator,
1894018953
'inside_osx_package': SharePathError._inside_osx_package_validator,
1894118954
'is_vault': SharePathError._is_vault_validator,
18955+
'is_family': SharePathError._is_family_validator,
1894218956
'other': SharePathError._other_validator,
1894318957
}
1894418958

@@ -18955,6 +18969,7 @@ def __repr__(self):
1895518969
SharePathError.is_osx_package = SharePathError('is_osx_package')
1895618970
SharePathError.inside_osx_package = SharePathError('inside_osx_package')
1895718971
SharePathError.is_vault = SharePathError('is_vault')
18972+
SharePathError.is_family = SharePathError('is_family')
1895818973
SharePathError.other = SharePathError('other')
1895918974

1896018975
SharedContentLinkMetadata._audience_exceptions_validator = bv.Nullable(AudienceExceptions_validator)

0 commit comments

Comments
 (0)