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

# %% auto 0
__all__ = ['get_boards']

# %% ../../nbs/jira/routes.ipynb 2
import urllib.parse as parse
import httpx
from dataclasses import dataclass, field

import domolibrary_extensions.client as gd
import domolibrary_extensions.jira.auth as ja

# %% ../../nbs/jira/routes.ipynb 5
async def get_boards(
    auth: ja.JiraAuth,
    params: dict = None,
    debug_api: bool = False,
    debug_loop: bool = False,
    return_raw: bool = False,
    client: httpx.AsyncClient = None,
    is_ignore_cache: bool = False,
    cache_path: str = None,
):
    url = f"https://{auth.instance}/rest/agile/1.0/board"

    def arr_fn(res):
        return res.response["values"]

    client = client or httpx.AsyncClient()

    res = await gd.looper(
        url=url,
        auth=auth,
        arr_fn=arr_fn,
        params=params,
        method="GET",
        debug_loop=debug_loop,
        debug_api=debug_api,
        client=client,
        is_ignore_cache=is_ignore_cache,
        cache_path=cache_path,
    )

    if return_raw:
        return res

    return res.response
