Skip to content

Commit 3d378fd

Browse files
authored
Automated Spec Update (#284)
ed6e389b2d16d19b21e68413ae8f4743dd9b9223 Change Notes: File Namespace: - Add UploadSessionStartError union - Add UploadSessionType union - Update UploadSessionFinishError union to include concurrent_sessions_data_not_allowed, concurrent_session_not_closed, concurrent_session_missing_data - Update UploadSessionType struct to include session_type - Update upload_session/start to include UploadSessionStartError - Update Comments Team Log Namespace: - Add AdminAlertingAlertConfiguration, AdminAlertingChangedAlertConfigDetails, MemberChangeResellerRoleDetails, TeamProfileAddBackgroundDetails, TeamProfileChangeBackgroundDetails, TeamProfileRemoveBackgroundDetails, AdminAlertingChangedAlertConfigType, MemberChangeResellerRoleType, TeamProfileAddBackgroundType, TeamProfileChangeBackgroundType, TeamProfileRemoveBackgroundType structs - Add AdminAlertingAlertStatePolicy, ResellerRole unions - Update EventCategory union to include admin_alerting - Update GovernancePolicyRemoveFoldersDetails struct to include reason - Update EventDetails union to include admin_alerting_changed_alert_config_details, member_change_reseller_role_details, team_profile_add_background_details, team_profile_change_background_details, team_profile_remove_background_details - Update EventType union to include admin_alerting_changed_alert_config, member_change_reseller_role, team_profile_add_background, team_profile_change_background, team_profile_remove_background - Update EventTypeArg to include admin_alerting_changed_alert_config, member_change_reseller_role, team_profile_add_background, team_profile_change_background, team_profile_remove_background - Update Examples Co-authored-by: Brent Bumann <bbumann@dropbox.com> de3a7718946ee79f1a0d5ca499b9d22b41cc7c84 Co-authored-by: DropboxBot <DropboxBot@users.noreply.github.com>
1 parent ef994be commit 3d378fd

File tree

4 files changed

+1516
-33
lines changed

4 files changed

+1516
-33
lines changed

dropbox/base.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,8 @@ def files_upload_session_finish_batch_check(self,
29362936

29372937
def files_upload_session_start(self,
29382938
f,
2939-
close=False):
2939+
close=False,
2940+
session_type=None):
29402941
"""
29412942
Upload sessions allow you to upload a single file in one or more
29422943
requests, for example where the size of the file is greater than 150 MB.
@@ -2955,15 +2956,40 @@ def files_upload_session_start(self,
29552956
allowed per month. For more information, see the `Data transport limit
29562957
page
29572958
<https://www.dropbox.com/developers/reference/data-transport-limit>`_.
2959+
By default, upload sessions require you to send content of the file in
2960+
sequential order via consecutive :meth:`files_upload_session_start`,
2961+
:meth:`files_upload_session_append_v2`,
2962+
:meth:`files_upload_session_finish` calls. For better performance, you
2963+
can instead optionally use a ``UploadSessionType.concurrent`` upload
2964+
session. To start a new concurrent session, set
2965+
``UploadSessionStartArg.session_type`` to
2966+
``UploadSessionType.concurrent``. After that, you can send file data in
2967+
concurrent :meth:`files_upload_session_append_v2` requests. Finally
2968+
finish the session with :meth:`files_upload_session_finish`. There are
2969+
couple of constraints with concurrent sessions to make them work. You
2970+
can not send data with :meth:`files_upload_session_start` or
2971+
:meth:`files_upload_session_finish` call, only with
2972+
:meth:`files_upload_session_append_v2` call. Also data uploaded in
2973+
:meth:`files_upload_session_append_v2` call must be multiple of 4194304
2974+
bytes (except for last :meth:`files_upload_session_append_v2` with
2975+
``UploadSessionStartArg.close`` to ``True``, that may contain any
2976+
remaining data).
29582977
29592978
:param bytes f: Contents to upload.
29602979
:param bool close: If true, the current session will be closed, at which
29612980
point you won't be able to call
29622981
:meth:`files_upload_session_append_v2` anymore with the current
29632982
session.
2983+
:param Nullable session_type: Type of upload session you want to start.
2984+
If not specified, default is ``UploadSessionType.sequential``.
29642985
:rtype: :class:`dropbox.files.UploadSessionStartResult`
2986+
:raises: :class:`.exceptions.ApiError`
2987+
2988+
If this raises, ApiError will contain:
2989+
:class:`dropbox.files.UploadSessionStartError`
29652990
"""
2966-
arg = files.UploadSessionStartArg(close)
2991+
arg = files.UploadSessionStartArg(close,
2992+
session_type)
29672993
r = self.request(
29682994
files.upload_session_start,
29692995
'files',

0 commit comments

Comments
 (0)