Skip to content

Commit d836886

Browse files
deprecate: Deprecating all_app_backups -> all_app_snapshots
1 parent dcb61db commit d836886

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

squarecloud/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,13 @@ async def set_custom_domain(self, custom_domain: str) -> Response:
667667
return response
668668

669669
@deprecated("this method will be removed in future versions, use the 'all_snapshots' method instead")
670-
async def all_backups(self) -> Response:
671-
backups: list[SnapshotInfo] = await self.client.all_app_backups(self.id)
670+
async def all_backups(self) -> list[SnapshotInfo]:
671+
backups: list[SnapshotInfo] = await self.client.all_app_snapshots(self.id)
672672
return backups
673+
674+
async def all_snapshots(self) -> list[SnapshotInfo]:
675+
snapshots: list[SnapshotInfo] = await self.client.all_app_snapshots(self.id)
676+
return snapshots
673677

674678
@validate
675679
async def move_file(self, origin: str, dest: str) -> Response:

squarecloud/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,24 @@ async def domain_analytics(
700700

701701
@validate
702702
@_notify_listener(Endpoint.all_snapshots())
703+
@deprecated("this method will be removed in future versions, use the 'all_app_snapshots' method instead")
703704
async def all_app_backups(
704705
self, app_id: str, **_kwargs
705706
) -> list[SnapshotInfo]:
706707
response: Response = await self._http.get_all_app_snapshots(
707708
app_id=app_id
708709
)
709710
return [SnapshotInfo(**backup_data) for backup_data in response.response]
711+
712+
@validate
713+
@_notify_listener(Endpoint.all_snapshots())
714+
async def all_app_snapshots(
715+
self, app_id: str, **_kwargs
716+
) -> list[SnapshotInfo]:
717+
response: Response = await self._http.get_all_app_snapshots(
718+
app_id=app_id
719+
)
720+
return [SnapshotInfo(**backup_data) for backup_data in response.response]
710721

711722
@_notify_listener(Endpoint.all_apps_status())
712723
async def all_apps_status(self, **_kwargs) -> list[ResumedStatus]:

0 commit comments

Comments
 (0)