|
3 | 3 | # @Author: floepi |
4 | 4 | # @Date: 2015-06-04 17:42:44 |
5 | 5 | # @Last Modified by: Nícholas Kegler |
6 | | -# @Last Modified time: 2021-03-02 |
| 6 | +# @Last Modified time: 2021-05-03 |
7 | 7 | #!/usr/local/bin/python |
8 | 8 |
|
9 | 9 | from __future__ import absolute_import, division, print_function |
@@ -606,6 +606,26 @@ def connect_item_to_review(self, item_id, review_id): |
606 | 606 | print("A new improved method for this will be added soon.") |
607 | 607 | return "Deprecated" |
608 | 608 |
|
| 609 | + def move_items(self, new_review_id, item_data): |
| 610 | + """ |
| 611 | + Move items from one review to another |
| 612 | +
|
| 613 | + item_data should be a list of dictionaries with the old review id and the item id. |
| 614 | + The items in the list will be moved to the new review for the param new_review_id |
| 615 | +
|
| 616 | + :param new_review_id: int |
| 617 | + :param item_data: list [ dict { review_id: int, item_id: int} ] |
| 618 | + :return: |
| 619 | + """ |
| 620 | + |
| 621 | + return self._get_json_response( |
| 622 | + "move-review-items/", |
| 623 | + method="post", |
| 624 | + api_version="v2", |
| 625 | + postData={"new_review_id": new_review_id, "item_data": item_data}, |
| 626 | + raw_response=True, |
| 627 | + ) |
| 628 | + |
609 | 629 | """ |
610 | 630 | Frames (Sketches / Comments) |
611 | 631 | """ |
@@ -753,6 +773,12 @@ def get_user_by_email(self, email): |
753 | 773 | def get_users_by_project_id(self, project_id): |
754 | 774 | return self._get_json_response("all-project-users/{}".format(project_id), api_version="v2") |
755 | 775 |
|
| 776 | + def get_connections_by_user_id(self, user_id, account_id): |
| 777 | + """ |
| 778 | + Get all project and account connections for a user. Good for checking access for a user that might have left... |
| 779 | + """ |
| 780 | + return self._get_json_response("user/{}/connections/account/{}".format(user_id, account_id), api_version="v2") |
| 781 | + |
756 | 782 | def get_user_by_id(self, userId): |
757 | 783 | return self._get_json_response("simpleperson/%s" % userId) |
758 | 784 |
|
|
0 commit comments