Skip to content

Commit 414895c

Browse files
author
rob
committed
Updated spec
1 parent b9c1bdd commit 414895c

File tree

4 files changed

+184
-68
lines changed

4 files changed

+184
-68
lines changed

dropbox/base.py

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,13 +1260,13 @@ def files_get_thumbnail_batch(self,
12601260

12611261
def files_list_folder(self,
12621262
path,
1263-
shared_link=None,
12641263
recursive=False,
12651264
include_media_info=False,
12661265
include_deleted=False,
12671266
include_has_explicit_shared_members=False,
12681267
include_mounted_folders=True,
1269-
limit=None):
1268+
limit=None,
1269+
shared_link=None):
12701270
"""
12711271
Starts returning the contents of a folder. If the result's
12721272
``ListFolderResult.has_more`` field is ``True``, call
@@ -1294,10 +1294,6 @@ def files_list_folder(self,
12941294
until the previous request finishes.
12951295
12961296
:param str path: A unique identifier for the file.
1297-
:param Nullable shared_link: A shared link to list the contents of, if
1298-
the link is protected provide the password. if this field is
1299-
present, ``ListFolderArg.path`` will be relative to root of the
1300-
shared link. Only non-recursive mode is supported for shared link.
13011297
:param bool recursive: If true, the list folder operation will be
13021298
applied recursively to all subfolders and the response will contain
13031299
contents of all subfolders.
@@ -1314,20 +1310,25 @@ def files_list_folder(self,
13141310
:param Nullable limit: The maximum number of results to return per
13151311
request. Note: This is an approximate number and there can be
13161312
slightly more entries returned in some cases.
1313+
:param Nullable shared_link: A shared link to list the contents of. If
1314+
the link is password-protected, the password must be provided. If
1315+
this field is present, ``ListFolderArg.path`` will be relative to
1316+
root of the shared link. Only non-recursive mode is supported for
1317+
shared link.
13171318
:rtype: :class:`dropbox.files.ListFolderResult`
13181319
:raises: :class:`dropbox.exceptions.ApiError`
13191320
13201321
If this raises, ApiError.reason is of type:
13211322
:class:`dropbox.files.ListFolderError`
13221323
"""
13231324
arg = files.ListFolderArg(path,
1324-
shared_link,
13251325
recursive,
13261326
include_media_info,
13271327
include_deleted,
13281328
include_has_explicit_shared_members,
13291329
include_mounted_folders,
1330-
limit)
1330+
limit,
1331+
shared_link)
13311332
r = self.request(
13321333
files.list_folder,
13331334
'files',
@@ -1362,13 +1363,13 @@ def files_list_folder_continue(self,
13621363

13631364
def files_list_folder_get_latest_cursor(self,
13641365
path,
1365-
shared_link=None,
13661366
recursive=False,
13671367
include_media_info=False,
13681368
include_deleted=False,
13691369
include_has_explicit_shared_members=False,
13701370
include_mounted_folders=True,
1371-
limit=None):
1371+
limit=None,
1372+
shared_link=None):
13721373
"""
13731374
A way to quickly get a cursor for the folder's state. Unlike
13741375
:meth:`files_list_folder`, :meth:`files_list_folder_get_latest_cursor`
@@ -1377,10 +1378,6 @@ def files_list_folder_get_latest_cursor(self,
13771378
files that already exist in Dropbox.
13781379
13791380
:param str path: A unique identifier for the file.
1380-
:param Nullable shared_link: A shared link to list the contents of, if
1381-
the link is protected provide the password. if this field is
1382-
present, ``ListFolderArg.path`` will be relative to root of the
1383-
shared link. Only non-recursive mode is supported for shared link.
13841381
:param bool recursive: If true, the list folder operation will be
13851382
applied recursively to all subfolders and the response will contain
13861383
contents of all subfolders.
@@ -1397,20 +1394,25 @@ def files_list_folder_get_latest_cursor(self,
13971394
:param Nullable limit: The maximum number of results to return per
13981395
request. Note: This is an approximate number and there can be
13991396
slightly more entries returned in some cases.
1397+
:param Nullable shared_link: A shared link to list the contents of. If
1398+
the link is password-protected, the password must be provided. If
1399+
this field is present, ``ListFolderArg.path`` will be relative to
1400+
root of the shared link. Only non-recursive mode is supported for
1401+
shared link.
14001402
:rtype: :class:`dropbox.files.ListFolderGetLatestCursorResult`
14011403
:raises: :class:`dropbox.exceptions.ApiError`
14021404
14031405
If this raises, ApiError.reason is of type:
14041406
:class:`dropbox.files.ListFolderError`
14051407
"""
14061408
arg = files.ListFolderArg(path,
1407-
shared_link,
14081409
recursive,
14091410
include_media_info,
14101411
include_deleted,
14111412
include_has_explicit_shared_members,
14121413
include_mounted_folders,
1413-
limit)
1414+
limit,
1415+
shared_link)
14141416
r = self.request(
14151417
files.list_folder_get_latest_cursor,
14161418
'files',
@@ -1457,11 +1459,23 @@ def files_list_folder_longpoll(self,
14571459

14581460
def files_list_revisions(self,
14591461
path,
1462+
mode=files.ListRevisionsMode.path,
14601463
limit=10):
14611464
"""
1462-
Return revisions of a file.
1465+
Returns revisions for files based on a file path or a file id. The file
1466+
path or file id is identified from the latest file entry at the given
1467+
file path or id. This end point allows your app to query either by file
1468+
path or file id by setting the mode parameter appropriately. In the
1469+
``ListRevisionsMode.path`` (default) mode, all revisions at the same
1470+
file path as the latest file entry are returned. If revisions with the
1471+
same file id are desired, then mode must be set to
1472+
``ListRevisionsMode.id``. The ``ListRevisionsMode.id`` mode is useful to
1473+
retrieve revisions for a given file across moves or renames.
14631474
14641475
:param str path: The path to the file you want to see the revisions of.
1476+
:param mode: Determines the behavior of the API in listing the revisions
1477+
for a given file path or id.
1478+
:type mode: :class:`dropbox.files.ListRevisionsMode`
14651479
:param long limit: The maximum number of revision entries returned.
14661480
:rtype: :class:`dropbox.files.ListRevisionsResult`
14671481
:raises: :class:`dropbox.exceptions.ApiError`
@@ -1470,6 +1484,7 @@ def files_list_revisions(self,
14701484
:class:`dropbox.files.ListRevisionsError`
14711485
"""
14721486
arg = files.ListRevisionsArg(path,
1487+
mode,
14731488
limit)
14741489
r = self.request(
14751490
files.list_revisions,

0 commit comments

Comments
 (0)