Skip to content

Credit

qgendapy.resources.credit

CreditAllocationResource(client)

Bases: BaseResource

Synchronous credit allocation endpoints.

Source code in src/qgendapy/resources/_base.py
def __init__(self, client: QGendaClient) -> None:
    self._client = client

quotas(*, odata=None)

Source code in src/qgendapy/resources/credit.py
def quotas(self, *, odata: OData | None = None) -> QGendaResponse[dict]:
    # QGenda API uses PascalCase for this endpoint
    return self._get("/CreditAllocation/Quota", odata=odata)

update_quota(credit_allocation_key, staff_key, *, data)

Source code in src/qgendapy/resources/credit.py
def update_quota(
    self, credit_allocation_key: str, staff_key: str, *, data: dict
) -> QGendaResponse[dict]:
    return self._put(
        f"/creditallocation/{credit_allocation_key}/quota/{staff_key}",
        json=data,
    )

AsyncCreditAllocationResource(client)

Bases: AsyncBaseResource

Asynchronous credit allocation endpoints.

Source code in src/qgendapy/resources/_base.py
def __init__(self, client: AsyncQGendaClient) -> None:
    self._client = client

quotas(*, odata=None) async

Source code in src/qgendapy/resources/credit.py
async def quotas(self, *, odata: OData | None = None) -> QGendaResponse[dict]:
    # QGenda API uses PascalCase for this endpoint
    return await self._get("/CreditAllocation/Quota", odata=odata)

update_quota(credit_allocation_key, staff_key, *, data) async

Source code in src/qgendapy/resources/credit.py
async def update_quota(
    self, credit_allocation_key: str, staff_key: str, *, data: dict
) -> QGendaResponse[dict]:
    return await self._put(
        f"/creditallocation/{credit_allocation_key}/quota/{staff_key}",
        json=data,
    )