Skip to content

Commit da7b033

Browse files
authored
Automated Spec Update (#263)
* Automated Spec Update 333278e77e8104e31e544aecac5338a350537ed5 * Add basic files * Add logo to readme 1050a44f7793bd5546db8aed197602ad763466e4 Check Namespace: - Update comments for auth tests Remove Cloud_Docs Namespace File Request Namespace: - Add optional description parameter to FileRequest, CreateFileRequestArgs, and UpdateFileRequestArgs structs Files Namespace: - Add operation_suppressed type to WriteError union - Update Comments Shared Links Namespace: - Update Comments Sharing Files Namespace: - Update Comments Sharing Folders Namespace: - Update Comments Team Legal Holds Namespace: - Add invalid_date to LegalHoldsPolicyCreateError union Team Log Generated Namespace: - Add BackupStatus union - Add PolicyType union - Add data_governance and remove legal_holds from EventCategory union - Remove - Add GovernancePolicyAddFoldersDetails, GovernancePolicyCreateDetails, GovernancePolicyDeleteDetails, GovernancePolicyEditDetailsDetails, GovernancePolicyEditDurationDetails, GovernancePolicyRemoveFoldersDetails, DeviceSyncBackupStatusChangedDetails, GroupRemoveMemberDetails, GroupRenameDetails, ShmodelDisableDownloadsDetails, ShmodelEnableDownloadsDetails structs - Add optional login_id to LogoutDetails struct - Add governance_policy_add_folders_details, governance_policy_create_details, governance_policy_delete_details, governance_policy_edit_details_details, governance_policy_edit_duration_details, governance_policy_remove_folders_details, device_sync_backup_status_changed_details, shmodel_disable_downloads_details, shmodel_enable_downloads_details to EventDetails union - Add GovernancePolicyAddFoldersType, GovernancePolicyCreateType, GovernancePolicyDeleteType, GovernancePolicyEditDetailsType, GovernancePolicyEditDurationType, GovernancePolicyRemoveFoldersType DeviceSyncBackupStatusChangedType, ShmodelDisableDownloadsType, ShmodelEnableDownloadsType structs - Add governance_policy_add_folders, governance_policy_create, governance_policy_delete, governance_policy_edit_details, governance_policy_edit_duration, governance_policy_remove_folders, device_sync_backup_status_changed, shmodel_disable_downloads, shmodel_enable_downloads to the EventType union - Add governance_policy_add_folders, governance_policy_create, governance_policy_delete, governance_policy_edit_details, governance_policy_edit_duration, governance_policy_remove_folders, device_sync_backup_status_changed, shmodel_disable_downloads,shmodel_enable_downloads - Update comments Users Namespace: - Update Comments and examples * Remove cloud docs file manually Co-authored-by: rogebrd <[email protected]>
1 parent efc224b commit da7b033

File tree

15 files changed

+5071
-4488
lines changed

15 files changed

+5071
-4488
lines changed

dropbox/base.py

Lines changed: 21 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
async_,
1212
auth,
1313
check,
14-
cloud_docs,
1514
common,
1615
contacts,
1716
file_properties,
@@ -154,194 +153,6 @@ def check_user(self,
154153
)
155154
return r
156155

157-
# ------------------------------------------
158-
# Routes in cloud_docs namespace
159-
160-
def cloud_docs_get_content(self,
161-
file_id):
162-
"""
163-
Fetch the binary content of the requested document. This route requires
164-
Cloud Docs auth. Please make a request to cloud_docs/authorize and
165-
supply that token in the Authorization header.
166-
167-
:type file_id: str
168-
:rtype: (None,
169-
:class:`requests.models.Response`)
170-
:raises: :class:`.exceptions.ApiError`
171-
172-
If this raises, ApiError will contain:
173-
:class:`dropbox.cloud_docs.CloudDocsAccessError`
174-
175-
If you do not consume the entire response body, then you must call close
176-
on the response object, otherwise you will max out your available
177-
connections. We recommend using the `contextlib.closing
178-
<https://docs.python.org/2/library/contextlib.html#contextlib.closing>`_
179-
context manager to ensure this.
180-
"""
181-
arg = cloud_docs.GetContentArg(file_id)
182-
r = self.request(
183-
cloud_docs.get_content,
184-
'cloud_docs',
185-
arg,
186-
None,
187-
)
188-
return None
189-
190-
def cloud_docs_get_content_to_file(self,
191-
download_path,
192-
file_id):
193-
"""
194-
Fetch the binary content of the requested document. This route requires
195-
Cloud Docs auth. Please make a request to cloud_docs/authorize and
196-
supply that token in the Authorization header.
197-
198-
:param str download_path: Path on local machine to save file.
199-
:type file_id: str
200-
:rtype: None
201-
:raises: :class:`.exceptions.ApiError`
202-
203-
If this raises, ApiError will contain:
204-
:class:`dropbox.cloud_docs.CloudDocsAccessError`
205-
"""
206-
arg = cloud_docs.GetContentArg(file_id)
207-
r = self.request(
208-
cloud_docs.get_content,
209-
'cloud_docs',
210-
arg,
211-
None,
212-
)
213-
self._save_body_to_file(download_path, r[1])
214-
return None
215-
216-
def cloud_docs_get_metadata(self,
217-
file_id=u''):
218-
"""
219-
Fetches metadata associated with a Cloud Doc and user. This route
220-
requires Cloud Docs auth. Please make a request to cloud_docs/authorize
221-
and supply that token in the Authorization header.
222-
223-
:param str file_id: API ID ("id:...") associated with the Cloud Doc.
224-
:rtype: :class:`dropbox.cloud_docs.GetMetadataResult`
225-
:raises: :class:`.exceptions.ApiError`
226-
227-
If this raises, ApiError will contain:
228-
:class:`dropbox.cloud_docs.GetMetadataError`
229-
"""
230-
arg = cloud_docs.GetMetadataArg(file_id)
231-
r = self.request(
232-
cloud_docs.get_metadata,
233-
'cloud_docs',
234-
arg,
235-
None,
236-
)
237-
return r
238-
239-
def cloud_docs_lock(self,
240-
file_id=u''):
241-
"""
242-
Lock a Cloud Doc. This route requires Cloud Docs auth. Please make a
243-
request to cloud_docs/authorize and supply that token in the
244-
Authorization header.
245-
246-
:param str file_id: The API ID ("id:...") associated with the Cloud Doc
247-
:rtype: :class:`dropbox.cloud_docs.LockResult`
248-
:raises: :class:`.exceptions.ApiError`
249-
250-
If this raises, ApiError will contain:
251-
:class:`dropbox.cloud_docs.LockingError`
252-
"""
253-
arg = cloud_docs.LockArg(file_id)
254-
r = self.request(
255-
cloud_docs.lock,
256-
'cloud_docs',
257-
arg,
258-
None,
259-
)
260-
return r
261-
262-
def cloud_docs_rename(self,
263-
file_id=u'',
264-
title=u''):
265-
"""
266-
Update the title of a Cloud Doc. This route requires Cloud Docs auth.
267-
Please make a request to cloud_docs/authorize and supply that token in
268-
the Authorization header.
269-
270-
:param str file_id: The API ID ("id:...") associated with the Cloud Doc
271-
:param str title: The new title of the doc, excluding extension
272-
:rtype: :class:`dropbox.cloud_docs.RenameResult`
273-
:raises: :class:`.exceptions.ApiError`
274-
275-
If this raises, ApiError will contain:
276-
:class:`dropbox.cloud_docs.RenameError`
277-
"""
278-
arg = cloud_docs.RenameArg(file_id,
279-
title)
280-
r = self.request(
281-
cloud_docs.rename,
282-
'cloud_docs',
283-
arg,
284-
None,
285-
)
286-
return r
287-
288-
def cloud_docs_unlock(self,
289-
file_id=u''):
290-
"""
291-
Unlock a Cloud Doc. This route requires Cloud Docs auth. Please make a
292-
request to cloud_docs/authorize and supply that token in the
293-
Authorization header.
294-
295-
:param str file_id: The API ID ("id:...") associated with the Cloud Doc
296-
:rtype: :class:`dropbox.cloud_docs.UnlockResult`
297-
:raises: :class:`.exceptions.ApiError`
298-
299-
If this raises, ApiError will contain:
300-
:class:`dropbox.cloud_docs.LockingError`
301-
"""
302-
arg = cloud_docs.UnlockArg(file_id)
303-
r = self.request(
304-
cloud_docs.unlock,
305-
'cloud_docs',
306-
arg,
307-
None,
308-
)
309-
return r
310-
311-
def cloud_docs_update_content(self,
312-
f,
313-
file_id,
314-
actor_tokens,
315-
additional_contents=None):
316-
"""
317-
Update the contents of a Cloud Doc. This should be called for files with
318-
a max size of 150MB. This route requires Cloud Docs auth. Please make a
319-
request to cloud_docs/authorize and supply that token in the
320-
Authorization header.
321-
322-
:param bytes f: Contents to upload.
323-
:type file_id: str
324-
:param list actor_tokens: A list of auth_tokens, one for each editor who
325-
made changes to the document since the last call to update_content.
326-
:param Nullable additional_contents: Currently, this will always be
327-
empty until we implement upload_additional_content.
328-
:rtype: :class:`dropbox.cloud_docs.UpdateContentResult`
329-
:raises: :class:`.exceptions.ApiError`
330-
331-
If this raises, ApiError will contain:
332-
:class:`dropbox.cloud_docs.UpdateContentError`
333-
"""
334-
arg = cloud_docs.UpdateContentArg(file_id,
335-
actor_tokens,
336-
additional_contents)
337-
r = self.request(
338-
cloud_docs.update_content,
339-
'cloud_docs',
340-
arg,
341-
f,
342-
)
343-
return r
344-
345156
# ------------------------------------------
346157
# Routes in contacts namespace
347158

@@ -719,7 +530,8 @@ def file_requests_create(self,
719530
title,
720531
destination,
721532
deadline=None,
722-
open=True):
533+
open=True,
534+
description=None):
723535
"""
724536
Creates a file request for this user.
725537
@@ -732,6 +544,7 @@ def file_requests_create(self,
732544
:param bool open: Whether or not the file request should be open. If the
733545
file request is closed, it will not accept any file submissions, but
734546
it can be opened later.
547+
:param Nullable description: A description of the file request.
735548
:rtype: :class:`dropbox.file_requests.FileRequest`
736549
:raises: :class:`.exceptions.ApiError`
737550
@@ -741,7 +554,8 @@ def file_requests_create(self,
741554
arg = file_requests.CreateFileRequestArgs(title,
742555
destination,
743556
deadline,
744-
open)
557+
open,
558+
description)
745559
r = self.request(
746560
file_requests.create,
747561
'file_requests',
@@ -870,7 +684,8 @@ def file_requests_update(self,
870684
title=None,
871685
destination=None,
872686
deadline=file_requests.UpdateFileRequestDeadline.no_update,
873-
open=None):
687+
open=None,
688+
description=None):
874689
"""
875690
Update a file request.
876691
@@ -885,13 +700,15 @@ def file_requests_update(self,
885700
:type deadline: :class:`dropbox.file_requests.UpdateFileRequestDeadline`
886701
:param Nullable open: Whether to set this file request as open or
887702
closed.
703+
:param Nullable description: The description of the file request.
888704
:rtype: :class:`dropbox.file_requests.FileRequest`
889705
"""
890706
arg = file_requests.UpdateFileRequestArgs(id,
891707
title,
892708
destination,
893709
deadline,
894-
open)
710+
open,
711+
description)
895712
r = self.request(
896713
file_requests.update,
897714
'file_requests',
@@ -2949,7 +2766,8 @@ def files_upload(self,
29492766
:class:`dropbox.files.WriteMode` detects conflict. For example,
29502767
always return a conflict error when ``mode`` = ``WriteMode.update``
29512768
and the given "rev" doesn't match the existing file's "rev", even if
2952-
the existing file has been deleted.
2769+
the existing file has been deleted. This also forces a conflict even
2770+
when the target path refers to a file with identical contents.
29532771
:rtype: :class:`dropbox.files.FileMetadata`
29542772
:raises: :class:`.exceptions.ApiError`
29552773
@@ -4645,11 +4463,15 @@ def sharing_list_shared_links(self,
46454463
direct_only=None):
46464464
"""
46474465
List shared links of this user. If no path is given, returns a list of
4648-
all shared links for the current user. If a non-empty path is given,
4649-
returns a list of all shared links that allow access to the given path -
4650-
direct links to the given path and links to parent folders of the given
4651-
path. Links to parent folders can be suppressed by setting direct_only
4652-
to true.
4466+
all shared links for the current user. For members of business teams
4467+
using team space and member folders, returns all shared links in the
4468+
team member's home folder unless the team space ID is specified in the
4469+
request header. For more information, refer to the `Namespace Guide
4470+
<https://www.dropbox.com/developers/reference/namespace-guide>`_. If a
4471+
non-empty path is given, returns a list of all shared links that allow
4472+
access to the given path - direct links to the given path and links to
4473+
parent folders of the given path. Links to parent folders can be
4474+
suppressed by setting direct_only to true.
46534475
46544476
:param Nullable path: See :meth:`sharing_list_shared_links` description.
46554477
:param Nullable cursor: The cursor returned by your last call to

dropbox/base_team.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
async_,
1212
auth,
1313
check,
14-
cloud_docs,
1514
common,
1615
contacts,
1716
file_properties,
@@ -47,9 +46,6 @@ def request(self, route, namespace, arg, arg_binary=None):
4746
# ------------------------------------------
4847
# Routes in check namespace
4948

50-
# ------------------------------------------
51-
# Routes in cloud_docs namespace
52-
5349
# ------------------------------------------
5450
# Routes in contacts namespace
5551

0 commit comments

Comments
 (0)