Skip to content

Commit b9c1bdd

Browse files
author
rob
committed
Updated spec
1 parent cc1fbfa commit b9c1bdd

File tree

11 files changed

+937
-277
lines changed

11 files changed

+937
-277
lines changed

dropbox/base.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def file_properties_properties_remove(self,
140140
property_template_ids):
141141
"""
142142
Remove the specified property group from the file. To remove specific
143-
property field key value pairs, see route
143+
property field key value pairs, see
144144
:meth:`file_properties_properties_update`. To update a template, see
145145
:meth:`file_properties_templates_update_for_user` or
146146
:meth:`file_properties_templates_update_for_team`. Templates can't be
@@ -228,7 +228,7 @@ def file_properties_templates_add_for_team(self,
228228
description,
229229
fields):
230230
"""
231-
Add a template associated with a team. See route
231+
Add a template associated with a team. See
232232
:meth:`file_properties_properties_add` to add properties to a file or
233233
folder.
234234
@@ -254,8 +254,9 @@ def file_properties_templates_add_for_user(self,
254254
description,
255255
fields):
256256
"""
257-
Add a template associated with a user. See route
258-
:meth:`file_properties_properties_add` to add properties to a file.
257+
Add a template associated with a user. See
258+
:meth:`file_properties_properties_add` to add properties to a file. This
259+
endpoint can't be called on a team member or admin's behalf.
259260
260261
:rtype: :class:`dropbox.file_properties.AddTemplateResult`
261262
:raises: :class:`dropbox.exceptions.ApiError`
@@ -300,7 +301,8 @@ def file_properties_templates_get_for_team(self,
300301
def file_properties_templates_get_for_user(self,
301302
template_id):
302303
"""
303-
Get the schema for a specified template.
304+
Get the schema for a specified template. This endpoint can't be called
305+
on a team member or admin's behalf.
304306
305307
:param str template_id: An identifier for template added by route See
306308
:meth:`file_properties_templates_add_for_user` or
@@ -343,7 +345,8 @@ def file_properties_templates_list_for_team(self):
343345
def file_properties_templates_list_for_user(self):
344346
"""
345347
Get the template identifiers for a team. To get the schema of each
346-
template use :meth:`file_properties_templates_get_for_user`.
348+
template use :meth:`file_properties_templates_get_for_user`. This
349+
endpoint can't be called on a team member or admin's behalf.
347350
348351
:rtype: :class:`dropbox.file_properties.ListTemplateResult`
349352
:raises: :class:`dropbox.exceptions.ApiError`
@@ -406,7 +409,8 @@ def file_properties_templates_update_for_user(self,
406409
"""
407410
Update a template associated with a user. This route can update the
408411
template name, the template description and add optional properties to
409-
templates.
412+
templates. This endpoint can't be called on a team member or admin's
413+
behalf.
410414
411415
:param str template_id: An identifier for template added by See
412416
:meth:`file_properties_templates_add_for_user` or
@@ -1256,6 +1260,7 @@ def files_get_thumbnail_batch(self,
12561260

12571261
def files_list_folder(self,
12581262
path,
1263+
shared_link=None,
12591264
recursive=False,
12601265
include_media_info=False,
12611266
include_deleted=False,
@@ -1289,6 +1294,10 @@ def files_list_folder(self,
12891294
until the previous request finishes.
12901295
12911296
: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.
12921301
:param bool recursive: If true, the list folder operation will be
12931302
applied recursively to all subfolders and the response will contain
12941303
contents of all subfolders.
@@ -1312,6 +1321,7 @@ def files_list_folder(self,
13121321
:class:`dropbox.files.ListFolderError`
13131322
"""
13141323
arg = files.ListFolderArg(path,
1324+
shared_link,
13151325
recursive,
13161326
include_media_info,
13171327
include_deleted,
@@ -1352,6 +1362,7 @@ def files_list_folder_continue(self,
13521362

13531363
def files_list_folder_get_latest_cursor(self,
13541364
path,
1365+
shared_link=None,
13551366
recursive=False,
13561367
include_media_info=False,
13571368
include_deleted=False,
@@ -1366,6 +1377,10 @@ def files_list_folder_get_latest_cursor(self,
13661377
files that already exist in Dropbox.
13671378
13681379
: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.
13691384
:param bool recursive: If true, the list folder operation will be
13701385
applied recursively to all subfolders and the response will contain
13711386
contents of all subfolders.
@@ -1389,6 +1404,7 @@ def files_list_folder_get_latest_cursor(self,
13891404
:class:`dropbox.files.ListFolderError`
13901405
"""
13911406
arg = files.ListFolderArg(path,
1407+
shared_link,
13921408
recursive,
13931409
include_media_info,
13941410
include_deleted,

dropbox/base_team.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,8 @@ def team_team_folder_archive_check(self,
14181418
def team_team_folder_create(self,
14191419
name):
14201420
"""
1421-
Creates a new, active, team folder. Permission : Team member file
1422-
access.
1421+
Creates a new, active, team folder with no members. Permission : Team
1422+
member file access.
14231423
14241424
:param str name: Name for the new team folder.
14251425
:rtype: :class:`dropbox.team.TeamFolderMetadata`

dropbox/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ def __repr__(self):
274274
DisplayNameLegacy_validator = bv.String(min_length=1)
275275
DropboxTimestamp_validator = bv.Timestamp(u'%Y-%m-%dT%H:%M:%SZ')
276276
EmailAddress_validator = bv.String(max_length=255, pattern=u"^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$")
277+
# A ISO639-1 code.
278+
LanguageCode_validator = bv.String(min_length=2)
277279
NamePart_validator = bv.String(min_length=1, max_length=100, pattern=u'[^/:?*<>"|]*')
278280
NamespaceId_validator = bv.String(pattern=u'[-_0-9a-zA-Z:]+')
279281
OptionalNamePart_validator = bv.String(max_length=100, pattern=u'[^/:?*<>"|]*')

dropbox/file_properties.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ class PropertiesError(TemplateError):
183183
return true. To get the associated value of a tag (if one exists), use the
184184
corresponding ``get_*`` method.
185185
186-
:ivar unsupported_folder: This folder cannot be tagged. Shared folders and
187-
team folders are not supported for team-owned tags.
186+
:ivar unsupported_folder: This folder cannot be tagged. Tagging folders is
187+
not supported for team-owned templates.
188188
"""
189189

190190
# Attribute is overwritten below the class definition

dropbox/file_requests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# pylint: skip-file
55
"""
66
This namespace contains endpoints and data types for file request operations.
7-
Warning: This namespace is in beta and is subject to backwards-incompatible changes.
87
"""
98

109
try:

dropbox/files.py

Lines changed: 142 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,6 +3471,10 @@ def __repr__(self):
34713471
class ListFolderArg(object):
34723472
"""
34733473
:ivar path: A unique identifier for the file.
3474+
:ivar shared_link: A shared link to list the contents of, if the link is
3475+
protected provide the password. if this field is present,
3476+
``ListFolderArg.path`` will be relative to root of the shared link. Only
3477+
non-recursive mode is supported for shared link.
34743478
:ivar recursive: If true, the list folder operation will be applied
34753479
recursively to all subfolders and the response will contain contents of
34763480
all subfolders.
@@ -3492,6 +3496,8 @@ class ListFolderArg(object):
34923496
__slots__ = [
34933497
'_path_value',
34943498
'_path_present',
3499+
'_shared_link_value',
3500+
'_shared_link_present',
34953501
'_recursive_value',
34963502
'_recursive_present',
34973503
'_include_media_info_value',
@@ -3510,6 +3516,7 @@ class ListFolderArg(object):
35103516

35113517
def __init__(self,
35123518
path=None,
3519+
shared_link=None,
35133520
recursive=None,
35143521
include_media_info=None,
35153522
include_deleted=None,
@@ -3518,6 +3525,8 @@ def __init__(self,
35183525
limit=None):
35193526
self._path_value = None
35203527
self._path_present = False
3528+
self._shared_link_value = None
3529+
self._shared_link_present = False
35213530
self._recursive_value = None
35223531
self._recursive_present = False
35233532
self._include_media_info_value = None
@@ -3532,6 +3541,8 @@ def __init__(self,
35323541
self._limit_present = False
35333542
if path is not None:
35343543
self.path = path
3544+
if shared_link is not None:
3545+
self.shared_link = shared_link
35353546
if recursive is not None:
35363547
self.recursive = recursive
35373548
if include_media_info is not None:
@@ -3568,6 +3579,35 @@ def path(self):
35683579
self._path_value = None
35693580
self._path_present = False
35703581

3582+
@property
3583+
def shared_link(self):
3584+
"""
3585+
A shared link to list the contents of, if the link is protected provide
3586+
the password. if this field is present, ``ListFolderArg.path`` will be
3587+
relative to root of the shared link. Only non-recursive mode is
3588+
supported for shared link.
3589+
3590+
:rtype: SharedLink
3591+
"""
3592+
if self._shared_link_present:
3593+
return self._shared_link_value
3594+
else:
3595+
return None
3596+
3597+
@shared_link.setter
3598+
def shared_link(self, val):
3599+
if val is None:
3600+
del self.shared_link
3601+
return
3602+
self._shared_link_validator.validate_type_only(val)
3603+
self._shared_link_value = val
3604+
self._shared_link_present = True
3605+
3606+
@shared_link.deleter
3607+
def shared_link(self):
3608+
self._shared_link_value = None
3609+
self._shared_link_present = False
3610+
35713611
@property
35723612
def recursive(self):
35733613
"""
@@ -3716,8 +3756,9 @@ def limit(self):
37163756
self._limit_present = False
37173757

37183758
def __repr__(self):
3719-
return 'ListFolderArg(path={!r}, recursive={!r}, include_media_info={!r}, include_deleted={!r}, include_has_explicit_shared_members={!r}, include_mounted_folders={!r}, limit={!r})'.format(
3759+
return 'ListFolderArg(path={!r}, shared_link={!r}, recursive={!r}, include_media_info={!r}, include_deleted={!r}, include_has_explicit_shared_members={!r}, include_mounted_folders={!r}, limit={!r})'.format(
37203760
self._path_value,
3761+
self._shared_link_value,
37213762
self._recursive_value,
37223763
self._include_media_info_value,
37233764
self._include_deleted_value,
@@ -7141,6 +7182,90 @@ def __repr__(self):
71417182

71427183
SearchResult_validator = bv.Struct(SearchResult)
71437184

7185+
class SharedLink(object):
7186+
"""
7187+
:ivar url: Shared link url.
7188+
:ivar password: Password for the shared link.
7189+
"""
7190+
7191+
__slots__ = [
7192+
'_url_value',
7193+
'_url_present',
7194+
'_password_value',
7195+
'_password_present',
7196+
]
7197+
7198+
_has_required_fields = True
7199+
7200+
def __init__(self,
7201+
url=None,
7202+
password=None):
7203+
self._url_value = None
7204+
self._url_present = False
7205+
self._password_value = None
7206+
self._password_present = False
7207+
if url is not None:
7208+
self.url = url
7209+
if password is not None:
7210+
self.password = password
7211+
7212+
@property
7213+
def url(self):
7214+
"""
7215+
Shared link url.
7216+
7217+
:rtype: str
7218+
"""
7219+
if self._url_present:
7220+
return self._url_value
7221+
else:
7222+
raise AttributeError("missing required field 'url'")
7223+
7224+
@url.setter
7225+
def url(self, val):
7226+
val = self._url_validator.validate(val)
7227+
self._url_value = val
7228+
self._url_present = True
7229+
7230+
@url.deleter
7231+
def url(self):
7232+
self._url_value = None
7233+
self._url_present = False
7234+
7235+
@property
7236+
def password(self):
7237+
"""
7238+
Password for the shared link.
7239+
7240+
:rtype: str
7241+
"""
7242+
if self._password_present:
7243+
return self._password_value
7244+
else:
7245+
return None
7246+
7247+
@password.setter
7248+
def password(self, val):
7249+
if val is None:
7250+
del self.password
7251+
return
7252+
val = self._password_validator.validate(val)
7253+
self._password_value = val
7254+
self._password_present = True
7255+
7256+
@password.deleter
7257+
def password(self):
7258+
self._password_value = None
7259+
self._password_present = False
7260+
7261+
def __repr__(self):
7262+
return 'SharedLink(url={!r}, password={!r})'.format(
7263+
self._url_value,
7264+
self._password_value,
7265+
)
7266+
7267+
SharedLink_validator = bv.Struct(SharedLink)
7268+
71447269
class ThumbnailArg(object):
71457270
"""
71467271
:ivar path: The path to the image file you want to thumbnail.
@@ -8662,7 +8787,7 @@ class WriteError(bb.Union):
86628787
(bytes) to write more data.
86638788
:ivar disallowed_name: Dropbox will not save the file or folder because of
86648789
its name.
8665-
:ivar team_folder: This endpoint cannot modify or delete team folders.
8790+
:ivar team_folder: This endpoint cannot move or delete team folders.
86668791
"""
86678792

86688793
_catch_all = 'other'
@@ -8881,6 +9006,7 @@ def __repr__(self):
88819006
ReadPath_validator = bv.String(pattern=u'(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)')
88829007
Rev_validator = bv.String(min_length=9, pattern=u'[0-9a-f]+')
88839008
Sha256HexHash_validator = bv.String(min_length=64, max_length=64)
9009+
SharedLinkUrl_validator = bv.String()
88849010
WritePath_validator = bv.String(pattern=u'(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)')
88859011
WritePathOrId_validator = bv.String(pattern=u'(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)')
88869012
GetMetadataArg._path_validator = ReadPath_validator
@@ -9296,6 +9422,7 @@ def __repr__(self):
92969422
]
92979423

92989424
ListFolderArg._path_validator = PathROrId_validator
9425+
ListFolderArg._shared_link_validator = bv.Nullable(SharedLink_validator)
92999426
ListFolderArg._recursive_validator = bv.Boolean()
93009427
ListFolderArg._include_media_info_validator = bv.Boolean()
93019428
ListFolderArg._include_deleted_validator = bv.Boolean()
@@ -9304,6 +9431,7 @@ def __repr__(self):
93049431
ListFolderArg._limit_validator = bv.Nullable(bv.UInt32(min_value=1, max_value=2000))
93059432
ListFolderArg._all_field_names_ = set([
93069433
'path',
9434+
'shared_link',
93079435
'recursive',
93089436
'include_media_info',
93099437
'include_deleted',
@@ -9313,6 +9441,7 @@ def __repr__(self):
93139441
])
93149442
ListFolderArg._all_fields_ = [
93159443
('path', ListFolderArg._path_validator),
9444+
('shared_link', ListFolderArg._shared_link_validator),
93169445
('recursive', ListFolderArg._recursive_validator),
93179446
('include_media_info', ListFolderArg._include_media_info_validator),
93189447
('include_deleted', ListFolderArg._include_deleted_validator),
@@ -9812,6 +9941,17 @@ def __repr__(self):
98129941
('start', SearchResult._start_validator),
98139942
]
98149943

9944+
SharedLink._url_validator = SharedLinkUrl_validator
9945+
SharedLink._password_validator = bv.Nullable(bv.String())
9946+
SharedLink._all_field_names_ = set([
9947+
'url',
9948+
'password',
9949+
])
9950+
SharedLink._all_fields_ = [
9951+
('url', SharedLink._url_validator),
9952+
('password', SharedLink._password_validator),
9953+
]
9954+
98159955
ThumbnailArg._path_validator = ReadPath_validator
98169956
ThumbnailArg._format_validator = ThumbnailFormat_validator
98179957
ThumbnailArg._size_validator = ThumbnailSize_validator

0 commit comments

Comments
 (0)