Skip to content

role_grant

role_grant

DomoGrants dataclass

DomoGrants(
    auth: DomoAuth, grants: list[DomoGrant] | None = None
)

Bases: DomoManager

get async

get(
    session: AsyncClient | None = None,
    debug_api: bool = False,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
)

Calls route

Source code in src/crew_dcs/classes/DomoInstanceConfig/role_grant.py
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
async def get(
    self,
    session: httpx.AsyncClient | None = None,
    debug_api: bool = False,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
):
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        **context_kwargs,
    )

    res = await grant_routes.get_grants(
        auth=self.auth,
        context=context,
    )

    if return_raw or not res.is_success:
        return res

    self.grants = [DomoGrant.from_dict(obj) for obj in res.response]

    return self.grants