Skip to content

Commit c371d43

Browse files
DropboxBotBrent Bumann
andauthored
Automated Spec Update (#424)
ef6b1680d9a05ec7475f503149d771e44db913a2 Change Notes: files Namespace - Add upload_session/start_batch routes - Add UploadSessionStartBatchArg, UploadSessionStartBatchResult structs team_log_generated Namespace - Add ExternalDriveBackupEligibilityStatusCheckedDetails, ExternalDriveBackupStatusChangedDetails, ExternalDriveBackupEligibilityStatusCheckedType, ExternalDriveBackupStatusChangedType structs - Add ExternalDriveBackupEligibilityStatus, ExternalDriveBackupStatus unions Co-authored-by: DropboxBot <[email protected]> Co-authored-by: Brent Bumann <[email protected]>
1 parent aa3543e commit c371d43

File tree

4 files changed

+635
-1
lines changed

4 files changed

+635
-1
lines changed

dropbox/base.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,6 +3526,32 @@ def files_upload_session_start(self,
35263526
)
35273527
return r
35283528

3529+
def files_upload_session_start_batch(self,
3530+
num_sessions,
3531+
session_type=None):
3532+
"""
3533+
This route starts batch of upload_sessions. Please refer to
3534+
`upload_session/start` usage.
3535+
3536+
Route attributes:
3537+
scope: files.content.write
3538+
3539+
:param Nullable[:class:`dropbox.files.UploadSessionType`] session_type:
3540+
Type of upload session you want to start. If not specified, default
3541+
is ``UploadSessionType.sequential``.
3542+
:param int num_sessions: The number of upload sessions to start.
3543+
:rtype: :class:`dropbox.files.UploadSessionStartBatchResult`
3544+
"""
3545+
arg = files.UploadSessionStartBatchArg(num_sessions,
3546+
session_type)
3547+
r = self.request(
3548+
files.upload_session_start_batch,
3549+
'files',
3550+
arg,
3551+
None,
3552+
)
3553+
return r
3554+
35293555
# ------------------------------------------
35303556
# Routes in paper namespace
35313557

dropbox/files.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10204,6 +10204,71 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1020410204

1020510205
UploadSessionStartArg_validator = bv.Struct(UploadSessionStartArg)
1020610206

10207+
class UploadSessionStartBatchArg(bb.Struct):
10208+
"""
10209+
:ivar files.UploadSessionStartBatchArg.session_type: Type of upload session
10210+
you want to start. If not specified, default is
10211+
``UploadSessionType.sequential``.
10212+
:ivar files.UploadSessionStartBatchArg.num_sessions: The number of upload
10213+
sessions to start.
10214+
"""
10215+
10216+
__slots__ = [
10217+
'_session_type_value',
10218+
'_num_sessions_value',
10219+
]
10220+
10221+
_has_required_fields = True
10222+
10223+
def __init__(self,
10224+
num_sessions=None,
10225+
session_type=None):
10226+
self._session_type_value = bb.NOT_SET
10227+
self._num_sessions_value = bb.NOT_SET
10228+
if session_type is not None:
10229+
self.session_type = session_type
10230+
if num_sessions is not None:
10231+
self.num_sessions = num_sessions
10232+
10233+
# Instance attribute type: UploadSessionType (validator is set below)
10234+
session_type = bb.Attribute("session_type", nullable=True, user_defined=True)
10235+
10236+
# Instance attribute type: int (validator is set below)
10237+
num_sessions = bb.Attribute("num_sessions")
10238+
10239+
def _process_custom_annotations(self, annotation_type, field_path, processor):
10240+
super(UploadSessionStartBatchArg, self)._process_custom_annotations(annotation_type, field_path, processor)
10241+
10242+
UploadSessionStartBatchArg_validator = bv.Struct(UploadSessionStartBatchArg)
10243+
10244+
class UploadSessionStartBatchResult(bb.Struct):
10245+
"""
10246+
:ivar files.UploadSessionStartBatchResult.session_ids: A List of unique
10247+
identifiers for the upload session. Pass each session_id to
10248+
:meth:`dropbox.dropbox_client.Dropbox.files_upload_session_append` and
10249+
:meth:`dropbox.dropbox_client.Dropbox.files_upload_session_finish`.
10250+
"""
10251+
10252+
__slots__ = [
10253+
'_session_ids_value',
10254+
]
10255+
10256+
_has_required_fields = True
10257+
10258+
def __init__(self,
10259+
session_ids=None):
10260+
self._session_ids_value = bb.NOT_SET
10261+
if session_ids is not None:
10262+
self.session_ids = session_ids
10263+
10264+
# Instance attribute type: list of [str] (validator is set below)
10265+
session_ids = bb.Attribute("session_ids")
10266+
10267+
def _process_custom_annotations(self, annotation_type, field_path, processor):
10268+
super(UploadSessionStartBatchResult, self)._process_custom_annotations(annotation_type, field_path, processor)
10269+
10270+
UploadSessionStartBatchResult_validator = bv.Struct(UploadSessionStartBatchResult)
10271+
1020710272
class UploadSessionStartError(bb.Union):
1020810273
"""
1020910274
This class acts as a tagged union. Only one of the ``is_*`` methods will
@@ -13015,6 +13080,21 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1301513080
('content_hash', UploadSessionStartArg.content_hash.validator),
1301613081
]
1301713082

13083+
UploadSessionStartBatchArg.session_type.validator = bv.Nullable(UploadSessionType_validator)
13084+
UploadSessionStartBatchArg.num_sessions.validator = bv.UInt64(min_value=1, max_value=1000)
13085+
UploadSessionStartBatchArg._all_field_names_ = set([
13086+
'session_type',
13087+
'num_sessions',
13088+
])
13089+
UploadSessionStartBatchArg._all_fields_ = [
13090+
('session_type', UploadSessionStartBatchArg.session_type.validator),
13091+
('num_sessions', UploadSessionStartBatchArg.num_sessions.validator),
13092+
]
13093+
13094+
UploadSessionStartBatchResult.session_ids.validator = bv.List(bv.String())
13095+
UploadSessionStartBatchResult._all_field_names_ = set(['session_ids'])
13096+
UploadSessionStartBatchResult._all_fields_ = [('session_ids', UploadSessionStartBatchResult.session_ids.validator)]
13097+
1301813098
UploadSessionStartError._concurrent_session_data_not_allowed_validator = bv.Void()
1301913099
UploadSessionStartError._concurrent_session_close_not_allowed_validator = bv.Void()
1302013100
UploadSessionStartError._payload_too_large_validator = bv.Void()
@@ -13922,6 +14002,17 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1392214002
'host': 'content',
1392314003
'style': 'upload'},
1392414004
)
14005+
upload_session_start_batch = bb.Route(
14006+
'upload_session/start_batch',
14007+
1,
14008+
False,
14009+
UploadSessionStartBatchArg_validator,
14010+
UploadSessionStartBatchResult_validator,
14011+
bv.Void(),
14012+
{'auth': 'user',
14013+
'host': 'api',
14014+
'style': 'rpc'},
14015+
)
1392514016

1392614017
ROUTES = {
1392714018
'alpha/get_metadata': alpha_get_metadata,
@@ -13992,5 +14083,6 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1399214083
'upload_session/finish_batch:2': upload_session_finish_batch_v2,
1399314084
'upload_session/finish_batch/check': upload_session_finish_batch_check,
1399414085
'upload_session/start': upload_session_start,
14086+
'upload_session/start_batch': upload_session_start_batch,
1399514087
}
1399614088

0 commit comments

Comments
 (0)