@@ -714,13 +714,36 @@ async def all_app_backups(
714714 async def all_app_snapshots (
715715 self , app_id : str , ** _kwargs
716716 ) -> list [SnapshotInfo ]:
717+ """
718+ Retrieve all snapshots for a specific application.
719+ This method fetches a list of snapshots associated with the
720+ given application ID and returns them as a list of `SnapshotInfo` objects.
721+ :param app_id: Specify the application by id.
722+ :type app_id: str
723+ :param _kwargs: Additional keyword arguments.
724+ :type _kwargs: dict
725+ :return: A list of `SnapshotInfo` objects representing the snapshots of
726+ the specified application.
727+ :rtype: list[SnapshotInfo]
728+ """
717729 response : Response = await self ._http .get_all_app_snapshots (
718730 app_id = app_id
719731 )
720- return [SnapshotInfo (** backup_data ) for backup_data in response .response ]
732+ return [SnapshotInfo (** snapshot_data ) for snapshot_data in response .response ]
721733
722734 @_notify_listener (Endpoint .all_apps_status ())
723735 async def all_apps_status (self , ** _kwargs ) -> list [ResumedStatus ]:
736+ """
737+ Retrieve the status of all applications.
738+ This method fetches the status of all applications
739+ and returns a list of `ResumedStatus` objects for applications
740+ that are currently running.
741+ :param _kwargs: Additional keyword arguments.
742+ :type _kwargs: dict
743+ :return: A list of `ResumedStatus` objects representing the status
744+ of running applications.
745+ :rtype: list[ResumedStatus]
746+ """
724747 response : Response = await self ._http .all_apps_status ()
725748 all_status = []
726749 for status in response .response :
@@ -733,6 +756,19 @@ async def all_apps_status(self, **_kwargs) -> list[ResumedStatus]:
733756 async def move_app_file (
734757 self , app_id : str , origin : str , dest : str , ** _kwargs
735758 ) -> Response :
759+ """
760+ Moves a file within an application from the origin path to the destination path.
761+ :param app_id: Specify the application by id.
762+ :type app_id: str
763+ :param origin: The current path of the file to be moved.
764+ :type origin: str
765+ :param dest: The target path where the file should be moved.
766+ :type dest: str
767+ :param _kwargs: Additional keyword arguments.
768+ :type _kwargs: dict
769+ :return: The response object containing the result of the move operation.
770+ :rtype: Response
771+ """
736772 response : Response = await self ._http .move_app_file (
737773 app_id = app_id , origin = origin , dest = dest
738774 )
@@ -741,6 +777,14 @@ async def move_app_file(
741777 @validate
742778 @_notify_listener (Endpoint .dns_records ())
743779 async def dns_records (self , app_id : str ) -> list [DNSRecord ]:
780+ """
781+ Retrieve DNS records for a specific application.
782+ :param app_id: Specify the application by id.
783+ :type app_id: str
784+ :return: A list of DNSRecord objects representing the DNS records of the application.
785+ :rtype: list[DNSRecord]
786+ """
787+
744788 response : Response = await self ._http .dns_records (app_id )
745789 return [DNSRecord (** data ) for data in response .response ]
746790
@@ -753,21 +797,74 @@ async def current_app_integration(self, app_id: str) -> str | None:
753797 return response .response ["webhook" ]
754798
755799 async def get_app_envs (self , app_id : str ) -> dict [str , str ]:
800+ """
801+ Retrieve the environment variables of a specific application.
802+ :param app_id: Specify the application by id.
803+ :type app_id: str
804+ :return: A dictionary containing the environment variables as key-value pairs.
805+ :rtype: dict[str, str]
806+ """
756807 response : Response = await self ._http .get_environment_variables (app_id )
757808 return response .response
758809
759810 async def set_app_envs (self , app_id : str , envs : dict [str , str ]) -> dict [str , str ]:
811+ """
812+ Sets or edits environment variables for a specific application.
813+ This method sends a request to update the environment variables of the
814+ specified application with the provided key-value pairs.
815+ :param app_id: Specify the application by id.
816+ :type app_id: str
817+ :param envs: A dictionary containing the environment variables to set,
818+ where the keys are variable names and the values are their
819+ corresponding values.
820+ :type envs: dict[str, str]
821+ :return: A dictionary containing the updated environment with all variables.
822+ :rtype: dict[str, str]
823+ :raises HTTPException: If the HTTP request fails or returns an error response.
824+ """
825+
760826 response : Response = await self ._http .set_environment_variable (app_id , envs )
761827 return response .response
762828
763829 async def delete_app_envs (self , app_id : str , keys : list [str ]) -> dict [str , str ]:
830+ """
831+ Deletes specified environment variables for a given application.
832+ :param app_id: Specify the application by id.
833+ :type app_id: str
834+ :param keys: A list of keys representing the environment variables to be deleted.
835+ :type keys: list[str]
836+ :return: A dictionary containing the remaining variables.
837+ :rtype: dict[str, str]
838+ """
764839 response : Response = await self ._http .delete_environment_variable (app_id , keys )
765840 return response .response
766841
767842 async def overwrite_app_envs (self , app_id : str , envs : dict [str , str ]) -> dict [str , str ]:
843+ """
844+ Overwrite the environment variables of a specific application.
845+ This method sets the dictionary provided as the new environment for the application.
846+ :param app_id: Specify the application by id.
847+ :type app_id: str
848+ :param envs: A dictionary containing the new environment variables to set
849+ for the application. Keys and values must both be strings.
850+ :type envs: dict[str, str]
851+ :return: A dictionary containing the new environment after overwriting the
852+ environment variables.
853+ :rtype: dict[str, str]
854+ """
768855 response : Response = await self ._http .overwrite_environment_variables (app_id , envs )
769856 return response .response
770857
771858 async def clear_app_envs (self , app_id : str ) -> dict [str , str ]:
859+ """
860+ Clears all environment variables for the specified application.
861+ This method overwrites the application's environment variables with an empty dictionary,
862+ effectively removing all existing environment variables.
863+
864+ :param app_id: Specify the application by id.
865+ :type app_id: str
866+ :return: A dictionary containing the response from the server.
867+ :rtype: dict[str, str]
868+ """
772869 response : Response = await self ._http .overwrite_environment_variables (app_id , {})
773870 return response .response
0 commit comments