Skip to content

Commit b521dff

Browse files
author
Scott Erickson
committed
Publish update from April
1 parent 487793d commit b521dff

File tree

10 files changed

+2710
-17
lines changed

10 files changed

+2710
-17
lines changed

dropbox/auth.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
675675
token_from_oauth1 = bb.Route(
676676
'token/from_oauth1',
677677
1,
678-
False,
678+
True,
679679
TokenFromOAuth1Arg_validator,
680680
TokenFromOAuth1Result_validator,
681681
TokenFromOAuth1Error_validator,

dropbox/base.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def auth_token_from_oauth1(self,
8282
If this raises, ApiError will contain:
8383
:class:`dropbox.auth.TokenFromOAuth1Error`
8484
"""
85+
warnings.warn(
86+
'token/from_oauth1 is deprecated.',
87+
DeprecationWarning,
88+
)
8589
arg = auth.TokenFromOAuth1Arg(oauth1_token,
8690
oauth1_token_secret)
8791
r = self.request(
@@ -2880,7 +2884,7 @@ def files_save_url(self,
28802884
url):
28812885
"""
28822886
Save the data from a specified URL into a file in user's Dropbox. Note
2883-
that the transfer from the URL must complete within 5 minutes, or the
2887+
that the transfer from the URL must complete within 15 minutes, or the
28842888
operation will time out and the job will fail. If the given path already
28852889
exists, the file will be renamed to avoid the conflict (e.g. myfile
28862890
(1).txt).

dropbox/base_team.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,10 @@ def team_member_space_limits_excluded_users_remove(self,
12571257
def team_member_space_limits_get_custom_quota(self,
12581258
users):
12591259
"""
1260-
Get users custom quota. Returns none as the custom quota if none was
1261-
set. A maximum of 1000 members can be specified in a single call.
1260+
Get users custom quota. A maximum of 1000 members can be specified in a
1261+
single call. Note: to apply a custom space limit, a team admin needs to
1262+
set a member space limit for the team first. (the team admin can check
1263+
the settings here: https://www.dropbox.com/team/admin/settings/space).
12621264
12631265
Route attributes:
12641266
scope: members.read
@@ -1283,7 +1285,10 @@ def team_member_space_limits_remove_custom_quota(self,
12831285
users):
12841286
"""
12851287
Remove users custom quota. A maximum of 1000 members can be specified in
1286-
a single call.
1288+
a single call. Note: to apply a custom space limit, a team admin needs
1289+
to set a member space limit for the team first. (the team admin can
1290+
check the settings here:
1291+
https://www.dropbox.com/team/admin/settings/space).
12871292
12881293
Route attributes:
12891294
scope: members.write
@@ -1308,7 +1313,10 @@ def team_member_space_limits_set_custom_quota(self,
13081313
users_and_quotas):
13091314
"""
13101315
Set users custom quota. Custom quota has to be at least 15GB. A maximum
1311-
of 1000 members can be specified in a single call.
1316+
of 1000 members can be specified in a single call. Note: to apply a
1317+
custom space limit, a team admin needs to set a member space limit for
1318+
the team first. (the team admin can check the settings here:
1319+
https://www.dropbox.com/team/admin/settings/space).
13121320
13131321
Route attributes:
13141322
scope: members.read

dropbox/check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class EchoArg(bb.Struct):
1111
"""
12-
EchoArg contains the arguments to be sent to the Dropbox servers.
12+
Contains the arguments to be sent to the Dropbox servers.
1313
1414
:ivar check.EchoArg.query: The string that you'd like to be echoed back to
1515
you.

dropbox/files.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10868,7 +10868,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1086810868
SearchV2Cursor_validator = bv.String(min_length=1)
1086910869
Sha256HexHash_validator = bv.String(min_length=64, max_length=64)
1087010870
SharedLinkUrl_validator = bv.String()
10871-
TagText_validator = bv.String(min_length=1, max_length=32, pattern='[A-Za-z0-9_]+')
10871+
TagText_validator = bv.String(min_length=1, max_length=32, pattern='[\\w]+')
1087210872
WritePath_validator = bv.String(pattern='(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)')
1087310873
WritePathOrId_validator = bv.String(pattern='(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)')
1087410874
AddTagArg.path.validator = Path_validator
@@ -11086,7 +11086,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1108611086
('parent_rev', DeleteArg.parent_rev.validator),
1108711087
]
1108811088

11089-
DeleteBatchArg.entries.validator = bv.List(DeleteArg_validator)
11089+
DeleteBatchArg.entries.validator = bv.List(DeleteArg_validator, max_items=1000)
1109011090
DeleteBatchArg._all_field_names_ = set(['entries'])
1109111091
DeleteBatchArg._all_fields_ = [('entries', DeleteBatchArg.entries.validator)]
1109211092

@@ -11979,7 +11979,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1197911979
('rev', MinimalFileLinkMetadata.rev.validator),
1198011980
]
1198111981

11982-
RelocationBatchArgBase.entries.validator = bv.List(RelocationPath_validator, min_items=1)
11982+
RelocationBatchArgBase.entries.validator = bv.List(RelocationPath_validator, min_items=1, max_items=1000)
1198311983
RelocationBatchArgBase.autorename.validator = bv.Boolean()
1198411984
RelocationBatchArgBase._all_field_names_ = set([
1198511985
'entries',

dropbox/sharing.py

+51-3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ class AccessLevel(bb.Union):
9090
the shared folder and does not have any access to comments.
9191
:ivar sharing.AccessLevel.traverse: The collaborator can only view the
9292
shared folder that they have access to.
93+
:ivar sharing.AccessLevel.no_access: If there is a Righteous Link on the
94+
folder which grants access and the user has visited such link, they are
95+
allowed to perform certain action (i.e. add themselves to the folder)
96+
via the link access even though the user themselves are not a member on
97+
the shared folder yet.
9398
"""
9499

95100
_catch_all = 'other'
@@ -104,6 +109,8 @@ class AccessLevel(bb.Union):
104109
# Attribute is overwritten below the class definition
105110
traverse = None
106111
# Attribute is overwritten below the class definition
112+
no_access = None
113+
# Attribute is overwritten below the class definition
107114
other = None
108115

109116
def is_owner(self):
@@ -146,6 +153,14 @@ def is_traverse(self):
146153
"""
147154
return self._tag == 'traverse'
148155

156+
def is_no_access(self):
157+
"""
158+
Check if the union tag is ``no_access``.
159+
160+
:rtype: bool
161+
"""
162+
return self._tag == 'no_access'
163+
149164
def is_other(self):
150165
"""
151166
Check if the union tag is ``other``.
@@ -7909,8 +7924,8 @@ class ShareFolderArgBase(bb.Struct):
79097924
happen asynchronously.
79107925
:ivar sharing.ShareFolderArgBase.member_policy: Who can be a member of this
79117926
shared folder. Only applicable if the current user is on a team.
7912-
:ivar sharing.ShareFolderArgBase.path: The path to the folder to share. If
7913-
it does not exist, then a new one is created.
7927+
:ivar sharing.ShareFolderArgBase.path: The path or the file id to the folder
7928+
to share. If it does not exist, then a new one is created.
79147929
:ivar sharing.ShareFolderArgBase.shared_link_policy: The policy to apply to
79157930
shared links created for content inside this shared folder. The current
79167931
user must be on a team to set this policy to
@@ -8815,6 +8830,8 @@ class SharedFolderAccessError(bb.Union):
88158830
invalid.
88168831
:ivar sharing.SharedFolderAccessError.not_a_member: The user is not a member
88178832
of the shared folder thus cannot access it.
8833+
:ivar sharing.SharedFolderAccessError.invalid_member: The user does not
8834+
exist or their account is disabled.
88188835
:ivar sharing.SharedFolderAccessError.email_unverified: Never set.
88198836
:ivar sharing.SharedFolderAccessError.unmounted: The shared folder is
88208837
unmounted.
@@ -8826,6 +8843,8 @@ class SharedFolderAccessError(bb.Union):
88268843
# Attribute is overwritten below the class definition
88278844
not_a_member = None
88288845
# Attribute is overwritten below the class definition
8846+
invalid_member = None
8847+
# Attribute is overwritten below the class definition
88298848
email_unverified = None
88308849
# Attribute is overwritten below the class definition
88318850
unmounted = None
@@ -8848,6 +8867,14 @@ def is_not_a_member(self):
88488867
"""
88498868
return self._tag == 'not_a_member'
88508869

8870+
def is_invalid_member(self):
8871+
"""
8872+
Check if the union tag is ``invalid_member``.
8873+
8874+
:rtype: bool
8875+
"""
8876+
return self._tag == 'invalid_member'
8877+
88518878
def is_email_unverified(self):
88528879
"""
88538880
Check if the union tag is ``email_unverified``.
@@ -9039,6 +9066,8 @@ class SharedFolderMetadataBase(bb.Struct):
90399066
:ivar sharing.SharedFolderMetadataBase.parent_shared_folder_id: The ID of
90409067
the parent shared folder. This field is present only if the folder is
90419068
contained within another shared folder.
9069+
:ivar sharing.SharedFolderMetadataBase.path_display: The full path of this
9070+
shared folder. Absent for unmounted folders.
90429071
:ivar sharing.SharedFolderMetadataBase.path_lower: The lower-cased full path
90439072
of this shared folder. Absent for unmounted folders.
90449073
:ivar sharing.SharedFolderMetadataBase.parent_folder_name: Display name for
@@ -9052,6 +9081,7 @@ class SharedFolderMetadataBase(bb.Struct):
90529081
'_owner_display_names_value',
90539082
'_owner_team_value',
90549083
'_parent_shared_folder_id_value',
9084+
'_path_display_value',
90559085
'_path_lower_value',
90569086
'_parent_folder_name_value',
90579087
]
@@ -9065,6 +9095,7 @@ def __init__(self,
90659095
owner_display_names=None,
90669096
owner_team=None,
90679097
parent_shared_folder_id=None,
9098+
path_display=None,
90689099
path_lower=None,
90699100
parent_folder_name=None):
90709101
self._access_type_value = bb.NOT_SET
@@ -9073,6 +9104,7 @@ def __init__(self,
90739104
self._owner_display_names_value = bb.NOT_SET
90749105
self._owner_team_value = bb.NOT_SET
90759106
self._parent_shared_folder_id_value = bb.NOT_SET
9107+
self._path_display_value = bb.NOT_SET
90769108
self._path_lower_value = bb.NOT_SET
90779109
self._parent_folder_name_value = bb.NOT_SET
90789110
if access_type is not None:
@@ -9087,6 +9119,8 @@ def __init__(self,
90879119
self.owner_team = owner_team
90889120
if parent_shared_folder_id is not None:
90899121
self.parent_shared_folder_id = parent_shared_folder_id
9122+
if path_display is not None:
9123+
self.path_display = path_display
90909124
if path_lower is not None:
90919125
self.path_lower = path_lower
90929126
if parent_folder_name is not None:
@@ -9110,6 +9144,9 @@ def __init__(self,
91109144
# Instance attribute type: str (validator is set below)
91119145
parent_shared_folder_id = bb.Attribute("parent_shared_folder_id", nullable=True)
91129146

9147+
# Instance attribute type: str (validator is set below)
9148+
path_display = bb.Attribute("path_display", nullable=True)
9149+
91139150
# Instance attribute type: str (validator is set below)
91149151
path_lower = bb.Attribute("path_lower", nullable=True)
91159152

@@ -9169,6 +9206,7 @@ def __init__(self,
91699206
owner_display_names=None,
91709207
owner_team=None,
91719208
parent_shared_folder_id=None,
9209+
path_display=None,
91729210
path_lower=None,
91739211
parent_folder_name=None,
91749212
link_metadata=None,
@@ -9180,6 +9218,7 @@ def __init__(self,
91809218
owner_display_names,
91819219
owner_team,
91829220
parent_shared_folder_id,
9221+
path_display,
91839222
path_lower,
91849223
parent_folder_name)
91859224
self._link_metadata_value = bb.NOT_SET
@@ -11093,13 +11132,15 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1109311132
AccessLevel._viewer_validator = bv.Void()
1109411133
AccessLevel._viewer_no_comment_validator = bv.Void()
1109511134
AccessLevel._traverse_validator = bv.Void()
11135+
AccessLevel._no_access_validator = bv.Void()
1109611136
AccessLevel._other_validator = bv.Void()
1109711137
AccessLevel._tagmap = {
1109811138
'owner': AccessLevel._owner_validator,
1109911139
'editor': AccessLevel._editor_validator,
1110011140
'viewer': AccessLevel._viewer_validator,
1110111141
'viewer_no_comment': AccessLevel._viewer_no_comment_validator,
1110211142
'traverse': AccessLevel._traverse_validator,
11143+
'no_access': AccessLevel._no_access_validator,
1110311144
'other': AccessLevel._other_validator,
1110411145
}
1110511146

@@ -11108,6 +11149,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1110811149
AccessLevel.viewer = AccessLevel('viewer')
1110911150
AccessLevel.viewer_no_comment = AccessLevel('viewer_no_comment')
1111011151
AccessLevel.traverse = AccessLevel('traverse')
11152+
AccessLevel.no_access = AccessLevel('no_access')
1111111153
AccessLevel.other = AccessLevel('other')
1111211154

1111311155
AclUpdatePolicy._owner_validator = bv.Void()
@@ -12781,7 +12823,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1278112823
ShareFolderArgBase.acl_update_policy.validator = bv.Nullable(AclUpdatePolicy_validator)
1278212824
ShareFolderArgBase.force_async.validator = bv.Boolean()
1278312825
ShareFolderArgBase.member_policy.validator = bv.Nullable(MemberPolicy_validator)
12784-
ShareFolderArgBase.path.validator = files.WritePath_validator
12826+
ShareFolderArgBase.path.validator = files.WritePathOrId_validator
1278512827
ShareFolderArgBase.shared_link_policy.validator = bv.Nullable(SharedLinkPolicy_validator)
1278612828
ShareFolderArgBase.viewer_info_policy.validator = bv.Nullable(ViewerInfoPolicy_validator)
1278712829
ShareFolderArgBase.access_inheritance.validator = AccessInheritance_validator
@@ -12986,19 +13028,22 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1298613028

1298713029
SharedFolderAccessError._invalid_id_validator = bv.Void()
1298813030
SharedFolderAccessError._not_a_member_validator = bv.Void()
13031+
SharedFolderAccessError._invalid_member_validator = bv.Void()
1298913032
SharedFolderAccessError._email_unverified_validator = bv.Void()
1299013033
SharedFolderAccessError._unmounted_validator = bv.Void()
1299113034
SharedFolderAccessError._other_validator = bv.Void()
1299213035
SharedFolderAccessError._tagmap = {
1299313036
'invalid_id': SharedFolderAccessError._invalid_id_validator,
1299413037
'not_a_member': SharedFolderAccessError._not_a_member_validator,
13038+
'invalid_member': SharedFolderAccessError._invalid_member_validator,
1299513039
'email_unverified': SharedFolderAccessError._email_unverified_validator,
1299613040
'unmounted': SharedFolderAccessError._unmounted_validator,
1299713041
'other': SharedFolderAccessError._other_validator,
1299813042
}
1299913043

1300013044
SharedFolderAccessError.invalid_id = SharedFolderAccessError('invalid_id')
1300113045
SharedFolderAccessError.not_a_member = SharedFolderAccessError('not_a_member')
13046+
SharedFolderAccessError.invalid_member = SharedFolderAccessError('invalid_member')
1300213047
SharedFolderAccessError.email_unverified = SharedFolderAccessError('email_unverified')
1300313048
SharedFolderAccessError.unmounted = SharedFolderAccessError('unmounted')
1300413049
SharedFolderAccessError.other = SharedFolderAccessError('other')
@@ -13041,6 +13086,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1304113086
SharedFolderMetadataBase.owner_display_names.validator = bv.Nullable(bv.List(bv.String()))
1304213087
SharedFolderMetadataBase.owner_team.validator = bv.Nullable(users.Team_validator)
1304313088
SharedFolderMetadataBase.parent_shared_folder_id.validator = bv.Nullable(common.SharedFolderId_validator)
13089+
SharedFolderMetadataBase.path_display.validator = bv.Nullable(bv.String())
1304413090
SharedFolderMetadataBase.path_lower.validator = bv.Nullable(bv.String())
1304513091
SharedFolderMetadataBase.parent_folder_name.validator = bv.Nullable(bv.String())
1304613092
SharedFolderMetadataBase._all_field_names_ = set([
@@ -13050,6 +13096,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1305013096
'owner_display_names',
1305113097
'owner_team',
1305213098
'parent_shared_folder_id',
13099+
'path_display',
1305313100
'path_lower',
1305413101
'parent_folder_name',
1305513102
])
@@ -13060,6 +13107,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1306013107
('owner_display_names', SharedFolderMetadataBase.owner_display_names.validator),
1306113108
('owner_team', SharedFolderMetadataBase.owner_team.validator),
1306213109
('parent_shared_folder_id', SharedFolderMetadataBase.parent_shared_folder_id.validator),
13110+
('path_display', SharedFolderMetadataBase.path_display.validator),
1306313111
('path_lower', SharedFolderMetadataBase.path_lower.validator),
1306413112
('parent_folder_name', SharedFolderMetadataBase.parent_folder_name.validator),
1306513113
]

dropbox/team.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12396,8 +12396,8 @@ def __init__(self,
1239612396
team_id=None,
1239712397
num_licensed_users=None,
1239812398
num_provisioned_users=None,
12399-
num_used_licenses=None,
12400-
policies=None):
12399+
policies=None,
12400+
num_used_licenses=None):
1240112401
self._name_value = bb.NOT_SET
1240212402
self._team_id_value = bb.NOT_SET
1240312403
self._num_licensed_users_value = bb.NOT_SET
@@ -16980,6 +16980,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1698016980
SharingAllowlistListResponse.has_more.default = False
1698116981
TeamFolderArchiveArg.force_async_off.default = False
1698216982
TeamFolderListArg.limit.default = 1000
16983+
TeamGetInfoResult.num_used_licenses.default = 0
1698316984
TeamNamespacesListArg.limit.default = 1000
1698416985
devices_list_member_devices = bb.Route(
1698516986
'devices/list_member_devices',

0 commit comments

Comments
 (0)