Accept the pending ownership request on that file. It is necessary to edit the permission with the pending ownership. .. note:: You can only accept ownership transfer for the user currently being used.
(self, permission_id: str)
| 608 | return self.client.request("patch", url, json=payload) |
| 609 | |
| 610 | def accept_ownership(self, permission_id: str) -> Response: |
| 611 | """Accept the pending ownership request on that file. |
| 612 | |
| 613 | It is necessary to edit the permission with the pending ownership. |
| 614 | |
| 615 | .. note:: |
| 616 | |
| 617 | You can only accept ownership transfer for the user currently being used. |
| 618 | """ |
| 619 | |
| 620 | url = "{}/{}/permissions/{}".format( |
| 621 | DRIVE_FILES_API_V3_URL, |
| 622 | self.id, |
| 623 | permission_id, |
| 624 | ) |
| 625 | |
| 626 | payload = { |
| 627 | "role": "owner", |
| 628 | } |
| 629 | |
| 630 | params: ParamsType = { |
| 631 | "transferOwnership": True, |
| 632 | } |
| 633 | |
| 634 | return self.client.request("patch", url, json=payload, params=params) |
| 635 | |
| 636 | def named_range(self, named_range: str) -> List[Cell]: |
| 637 | """return a list of :class:`gspread.cell.Cell` objects from |