77
88from typing_extensions import deprecated
99
10+ from ._internal .decorators import validate
1011from .app import Application
1112from .data import (
1213 AppData ,
@@ -253,6 +254,7 @@ async def get_logs(self, app_id: str, **_kwargs) -> LogsData:
253254
254255 return logs_data
255256
257+ @validate
256258 @_notify_listener (Endpoint .app_status ())
257259 async def app_status (self , app_id : str , ** _kwargs ) -> StatusData :
258260 """
@@ -274,6 +276,7 @@ async def app_status(self, app_id: str, **_kwargs) -> StatusData:
274276 payload : dict [str , Any ] = response .response
275277 return StatusData (** payload )
276278
279+ @validate
277280 @_notify_listener (Endpoint .start ())
278281 async def start_app (self , app_id : str , ** _kwargs ) -> Response :
279282 """
@@ -293,6 +296,7 @@ async def start_app(self, app_id: str, **_kwargs) -> Response:
293296 """
294297 return await self ._http .start_application (app_id )
295298
299+ @validate
296300 @_notify_listener (Endpoint .stop ())
297301 async def stop_app (self , app_id : str , ** _kwargs ) -> Response :
298302 """
@@ -312,6 +316,7 @@ async def stop_app(self, app_id: str, **_kwargs) -> Response:
312316 """
313317 return await self ._http .stop_application (app_id )
314318
319+ @validate
315320 @_notify_listener (Endpoint .restart ())
316321 async def restart_app (self , app_id : str , ** _kwargs ) -> Response :
317322 """
@@ -331,6 +336,7 @@ async def restart_app(self, app_id: str, **_kwargs) -> Response:
331336 """
332337 return await self ._http .restart_application (app_id )
333338
339+ @validate
334340 @_notify_listener (Endpoint .backup ())
335341 async def backup (self , app_id : str , ** _kwargs ) -> Backup :
336342 """
@@ -354,6 +360,7 @@ async def backup(self, app_id: str, **_kwargs) -> Backup:
354360
355361 # async def app_backups(self) -> list[BackupInfo]:
356362
363+ @validate
357364 @_notify_listener (Endpoint .delete_app ())
358365 async def delete_app (self , app_id : str , ** _kwargs ) -> Response :
359366 """
@@ -373,6 +380,7 @@ async def delete_app(self, app_id: str, **_kwargs) -> Response:
373380 """
374381 return await self ._http .delete_application (app_id )
375382
383+ @validate
376384 @_notify_listener (Endpoint .commit ())
377385 async def commit (self , app_id : str , file : File , ** _kwargs ) -> Response :
378386 """
@@ -393,6 +401,7 @@ async def commit(self, app_id: str, file: File, **_kwargs) -> Response:
393401 """
394402 return await self ._http .commit (app_id , file )
395403
404+ @validate
396405 @_notify_listener (Endpoint .user ())
397406 async def app (self , app_id : str , ** _kwargs ) -> Application :
398407 """
@@ -454,6 +463,7 @@ async def all_apps(self, **_kwargs) -> list[Application]:
454463 apps .append (Application (client = self , http = self ._http , ** data ))
455464 return apps
456465
466+ @validate
457467 @_notify_listener (Endpoint .upload ())
458468 async def upload_app (self , file : File , ** _kwargs ) -> UploadData :
459469 """
@@ -508,6 +518,7 @@ async def upload_app(self, file: File, **_kwargs) -> UploadData:
508518 payload : dict [str , Any ] = response .response
509519 return UploadData (** payload )
510520
521+ @validate
511522 @_notify_listener (Endpoint .files_list ())
512523 async def app_files_list (
513524 self , app_id : str , path : str , ** _kwargs
@@ -538,6 +549,7 @@ async def app_files_list(
538549 for data in response .response
539550 ]
540551
552+ @validate
541553 @_notify_listener (Endpoint .files_read ())
542554 async def read_app_file (
543555 self , app_id : str , path : str , ** _kwargs
@@ -563,6 +575,7 @@ async def read_app_file(
563575 if response .response :
564576 return BytesIO (bytes (response .response .get ('data' )))
565577
578+ @validate
566579 @_notify_listener (Endpoint .files_create ())
567580 async def create_app_file (
568581 self , app_id : str , file : File , path : str , ** _kwargs
@@ -597,6 +610,7 @@ async def create_app_file(
597610
598611 return response
599612
613+ @validate
600614 @_notify_listener (Endpoint .files_delete ())
601615 async def delete_app_file (
602616 self , app_id : str , path : str , ** _kwargs
@@ -620,6 +634,7 @@ async def delete_app_file(
620634 """
621635 return await self ._http .file_delete (app_id , path )
622636
637+ @validate
623638 @_notify_listener (Endpoint .app_data ())
624639 async def app_data (self , app_id : str , ** _kwargs ) -> AppData :
625640 """
@@ -640,6 +655,7 @@ async def app_data(self, app_id: str, **_kwargs) -> AppData:
640655 response : Response = await self ._http .get_app_data (app_id )
641656 return AppData (** response .response )
642657
658+ @validate
643659 @_notify_listener (Endpoint .last_deploys ())
644660 async def last_deploys (
645661 self , app_id : str , ** _kwargs
@@ -664,6 +680,7 @@ async def last_deploys(
664680 data = response .response
665681 return [[DeployData (** deploy ) for deploy in _ ] for _ in data ]
666682
683+ @validate
667684 @_notify_listener (Endpoint .github_integration ())
668685 async def github_integration (
669686 self , app_id : str , access_token : str , ** _kwargs
@@ -692,6 +709,7 @@ async def github_integration(
692709 data = response .response
693710 return data .get ('webhook' )
694711
712+ @validate
695713 @_notify_listener (Endpoint .custom_domain ())
696714 async def set_custom_domain (
697715 self , app_id : str , custom_domain : str , ** _kwargs
@@ -717,6 +735,7 @@ async def set_custom_domain(
717735 app_id = app_id , custom_domain = custom_domain
718736 )
719737
738+ @validate
720739 @_notify_listener (Endpoint .domain_analytics ())
721740 async def domain_analytics (
722741 self , app_id : str , ** _kwargs
@@ -742,6 +761,7 @@ async def domain_analytics(
742761
743762 return DomainAnalytics (** response .response )
744763
764+ @validate
745765 @_notify_listener (Endpoint .all_backups ())
746766 async def all_app_backups (
747767 self , app_id : str , ** _kwargs
@@ -760,6 +780,7 @@ async def all_apps_status(self, **_kwargs) -> list[ResumedStatus]:
760780 all_status .append (ResumedStatus (** status ))
761781 return all_status
762782
783+ @validate
763784 @_notify_listener (Endpoint .move_file ())
764785 async def move_app_file (
765786 self , app_id : str , origin : str , dest : str , ** _kwargs
@@ -769,11 +790,13 @@ async def move_app_file(
769790 )
770791 return response
771792
793+ @validate
772794 @_notify_listener (Endpoint .dns_records ())
773795 async def dns_records (self , app_id : str ) -> list [DNSRecord ]:
774796 response : Response = await self ._http .dns_records (app_id )
775797 return [DNSRecord (** data ) for data in response .response ]
776798
799+ @validate
777800 @_notify_listener (Endpoint .current_integration ())
778801 async def current_app_integration (self , app_id : str ) -> str | None :
779802 response : Response = await self ._http .get_app_current_integration (
0 commit comments