|
10 | 10 | properties, |
11 | 11 | sharing, |
12 | 12 | team, |
| 13 | + team_common, |
13 | 14 | team_policies, |
14 | 15 | users, |
15 | 16 | ) |
@@ -538,8 +539,8 @@ def files_list_folder_longpoll(self, |
538 | 539 | timeout=30): |
539 | 540 | """ |
540 | 541 | A longpoll endpoint to wait for changes on an account. In conjunction |
541 | | - with :meth:`list_folder`, this call gives you a low-latency way to |
542 | | - monitor an account for file changes. The connection will block until |
| 542 | + with :meth:`list_folder_continue`, this call gives you a low-latency way |
| 543 | + to monitor an account for file changes. The connection will block until |
543 | 544 | there are changes available or a timeout occurs. This endpoint is useful |
544 | 545 | mostly for client-side apps. If you're looking for server-side |
545 | 546 | notifications, check out our `webhooks documentation |
@@ -665,6 +666,54 @@ def files_restore(self, |
665 | 666 | ) |
666 | 667 | return r |
667 | 668 |
|
| 669 | + def files_save_url(self, |
| 670 | + path, |
| 671 | + url): |
| 672 | + """ |
| 673 | + Save a specified URL into a file in user's Dropbox. If the given path |
| 674 | + already exists, the file will be renamed to avoid the conflict (e.g. |
| 675 | + myfile (1).txt). |
| 676 | +
|
| 677 | + :param str path: The path in Dropbox where the URL will be saved to. |
| 678 | + :param str url: The URL to be saved. |
| 679 | + :rtype: :class:`dropbox.files.SaveUrlResult` |
| 680 | + :raises: :class:`dropbox.exceptions.ApiError` |
| 681 | +
|
| 682 | + If this raises, ApiError.reason is of type: |
| 683 | + :class:`dropbox.files.SaveUrlError` |
| 684 | + """ |
| 685 | + arg = files.SaveUrlArg(path, |
| 686 | + url) |
| 687 | + r = self.request( |
| 688 | + files.save_url, |
| 689 | + 'files', |
| 690 | + arg, |
| 691 | + None, |
| 692 | + ) |
| 693 | + return r |
| 694 | + |
| 695 | + def files_save_url_check_job_status(self, |
| 696 | + async_job_id): |
| 697 | + """ |
| 698 | + Check the status of a :meth:`save_url` job. |
| 699 | +
|
| 700 | + :param str async_job_id: Id of the asynchronous job. This is the value |
| 701 | + of a response returned from the method that launched the job. |
| 702 | + :rtype: :class:`dropbox.files.SaveUrlJobStatus` |
| 703 | + :raises: :class:`dropbox.exceptions.ApiError` |
| 704 | +
|
| 705 | + If this raises, ApiError.reason is of type: |
| 706 | + :class:`dropbox.files.PollError` |
| 707 | + """ |
| 708 | + arg = async.PollArg(async_job_id) |
| 709 | + r = self.request( |
| 710 | + files.save_url_check_job_status, |
| 711 | + 'files', |
| 712 | + arg, |
| 713 | + None, |
| 714 | + ) |
| 715 | + return r |
| 716 | + |
668 | 717 | def files_search(self, |
669 | 718 | path, |
670 | 719 | query, |
@@ -1423,28 +1472,34 @@ def sharing_mount_folder(self, |
1423 | 1472 | return r |
1424 | 1473 |
|
1425 | 1474 | def sharing_relinquish_folder_membership(self, |
1426 | | - shared_folder_id): |
| 1475 | + shared_folder_id, |
| 1476 | + leave_a_copy=False): |
1427 | 1477 | """ |
1428 | 1478 | The current user relinquishes their membership in the designated shared |
1429 | 1479 | folder and will no longer have access to the folder. A folder owner |
1430 | | - cannot relinquish membership in their own folder. Apps must have full |
1431 | | - Dropbox access to use this endpoint. |
| 1480 | + cannot relinquish membership in their own folder. This will run |
| 1481 | + synchronously if leave_a_copy is false, and asynchronously if |
| 1482 | + leave_a_copy is true. Apps must have full Dropbox access to use this |
| 1483 | + endpoint. |
1432 | 1484 |
|
1433 | 1485 | :param str shared_folder_id: The ID for the shared folder. |
1434 | | - :rtype: None |
| 1486 | + :param bool leave_a_copy: Keep a copy of the folder's contents upon |
| 1487 | + relinquishing membership. |
| 1488 | + :rtype: :class:`dropbox.sharing.LaunchEmptyResult` |
1435 | 1489 | :raises: :class:`dropbox.exceptions.ApiError` |
1436 | 1490 |
|
1437 | 1491 | If this raises, ApiError.reason is of type: |
1438 | 1492 | :class:`dropbox.sharing.RelinquishFolderMembershipError` |
1439 | 1493 | """ |
1440 | | - arg = sharing.RelinquishFolderMembershipArg(shared_folder_id) |
| 1494 | + arg = sharing.RelinquishFolderMembershipArg(shared_folder_id, |
| 1495 | + leave_a_copy) |
1441 | 1496 | r = self.request( |
1442 | 1497 | sharing.relinquish_folder_membership, |
1443 | 1498 | 'sharing', |
1444 | 1499 | arg, |
1445 | 1500 | None, |
1446 | 1501 | ) |
1447 | | - return None |
| 1502 | + return r |
1448 | 1503 |
|
1449 | 1504 | def sharing_remove_folder_member(self, |
1450 | 1505 | shared_folder_id, |
|
0 commit comments