|
13 | 13 | Backup, |
14 | 14 | BackupInfo, |
15 | 15 | DeployData, |
| 16 | + DNSRecord, |
16 | 17 | DomainAnalytics, |
17 | 18 | FileInfo, |
18 | 19 | LogsData, |
| 20 | + ResumedStatus, |
19 | 21 | StatusData, |
20 | 22 | UploadData, |
21 | 23 | UserData, |
@@ -740,8 +742,33 @@ async def domain_analytics( |
740 | 742 | return DomainAnalytics(**response.response) |
741 | 743 |
|
742 | 744 | @_notify_listener(Endpoint.all_backups()) |
743 | | - async def all_app_backups(self, app_id: str, **_kwargs): |
| 745 | + async def all_app_backups( |
| 746 | + self, app_id: str, **_kwargs |
| 747 | + ) -> list[BackupInfo]: |
744 | 748 | response: Response = await self._http.get_all_app_backups( |
745 | 749 | app_id=app_id |
746 | 750 | ) |
747 | 751 | return [BackupInfo(**backup_data) for backup_data in response.response] |
| 752 | + |
| 753 | + @_notify_listener(Endpoint.all_apps_status()) |
| 754 | + async def all_apps_status(self, **_kwargs) -> list[ResumedStatus]: |
| 755 | + response: Response = await self._http.all_apps_status() |
| 756 | + all_status = [] |
| 757 | + for status in response.response: |
| 758 | + if status['running'] is True: |
| 759 | + all_status.append(ResumedStatus(**status)) |
| 760 | + return all_status |
| 761 | + |
| 762 | + @_notify_listener(Endpoint.move_file()) |
| 763 | + async def move_app_file( |
| 764 | + self, app_id: str, origin: str, dest: str, **_kwargs |
| 765 | + ) -> Response: |
| 766 | + response: Response = await self._http.move_app_file( |
| 767 | + app_id=app_id, origin=origin, dest=dest |
| 768 | + ) |
| 769 | + return response |
| 770 | + |
| 771 | + @_notify_listener(Endpoint.dns_records()) |
| 772 | + async def dns_records(self, app_id: str) -> list[DNSRecord]: |
| 773 | + response: Response = await self._http.dns_records(app_id) |
| 774 | + return [DNSRecord(**data) for data in response.response] |
0 commit comments