INNER CODE UNIT · Python
get_app
derisk-ai/OpenDerisk · packages/derisk-client/src/derisk_client/app.py:11
async def get_app(client: Client, app_id: str) -> AppModel:
"""Get an app.
Args:
client (Client): The derisk client.
app_id (str): The app id.
Returns:
AppModel: The app model.
Raises:
ClientException: If the request failed.
"""
try:
res = await client.get("/apps/" + app_id)
result: Result = res.json()
if result["success"]:
return AppModel(**result["data"])
else:
raise ClientException(status=result["err_code"], reason=result)