INNER CODE UNIT · Python
list_app
derisk-ai/OpenDerisk · packages/derisk-client/src/derisk_client/app.py:33
async def list_app(client: Client) -> List[AppModel]:
"""List apps.
Args:
client (Client): The derisk client.
Returns:
List[AppModel]: The list of app models.
Raises:
ClientException: If the request failed.
"""
try:
res = await client.get("/apps")
result: Result = res.json()
if result["success"]:
return [AppModel(**app) for app in result["data"]["app_list"]]
else:
raise ClientException(status=result["err_code"], reason=result)
except Exception as e: