# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/routes/application.ipynb.

# %% auto 0
__all__ = ['get_applications', 'get_application_by_id']

# %% ../../nbs/routes/application.ipynb 2
from typing import Union
from enum import Enum
import httpx

import domolibrary.client.get_data as gd
import domolibrary.client.ResponseGetData as rgd
import domolibrary.client.DomoAuth as dmda
import domolibrary.client.DomoError as de

# %% ../../nbs/routes/application.ipynb 3
async def get_applications(auth: dmda.DomoFullAuth,
                           session: Union[httpx.AsyncClient, httpx.AsyncClient, None] = None,
                           debug_api: bool = False
                           )-> rgd.ResponseGetData:

    url = f'https://{auth.domo_instance}.domo.com/api/executor/v1/applications/'

    if debug_api:
        print(url)

    return await gd.get_data(
        auth=auth,
        url=url,
        method='GET',
        debug_api=debug_api,
        session=session
    )


async def get_application_by_id(auth: dmda.DomoFullAuth,
                                application_id: str,
                                session: Union[httpx.AsyncClient, httpx.AsyncClient, None] = None,
                                debug_api: bool = False)-> rgd.ResponseGetData:

    url = f'https://{auth.domo_instance}.domo.com/api/executor/v1/applications/{application_id}'

    if debug_api:
        print(url)

    return await gd.get_data(
        auth=auth,
        url=url,
        method='GET',
        debug_api=debug_api,
        session=session
    )
