Skip to content

Task

qgendapy.resources.task

TaskResource(client)

Bases: BaseResource

Synchronous task endpoints.

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

list(*, odata=None)

Source code in src/qgendapy/resources/task.py
def list(self, *, odata: OData | None = None) -> QGendaResponse[Task]:
    params: dict[str, str] = {"companyKey": self._client.company_key}
    return self._get("/task", params=params, model=Task, odata=odata)

create(*, data)

Source code in src/qgendapy/resources/task.py
def create(self, *, data: dict) -> QGendaResponse[Task]:
    return self._post("/task", json=data, model=Task)

update(*, data)

Source code in src/qgendapy/resources/task.py
def update(self, *, data: dict) -> QGendaResponse[Task]:
    return self._put("/task", json=data, model=Task)

locations(task_key)

Source code in src/qgendapy/resources/task.py
def locations(self, task_key: str) -> QGendaResponse:
    return self._get(f"/task/{task_key}/location")

tags(task_key)

Source code in src/qgendapy/resources/task.py
def tags(self, task_key: str) -> QGendaResponse:
    return self._get(f"/task/{task_key}/tag")

add_tag(task_key, *, data)

Source code in src/qgendapy/resources/task.py
def add_tag(self, task_key: str, *, data: dict) -> QGendaResponse:
    return self._post(f"/task/{task_key}/tag", json=data)

shifts(task_key)

Source code in src/qgendapy/resources/task.py
def shifts(self, task_key: str) -> QGendaResponse[TaskShift]:
    return self._get(f"/task/{task_key}/taskshift", model=TaskShift)

create_shift(task_key, *, data)

Source code in src/qgendapy/resources/task.py
def create_shift(self, task_key: str, *, data: dict) -> QGendaResponse[TaskShift]:
    return self._post(f"/task/{task_key}/taskshift", json=data, model=TaskShift)

update_shift(task_key, shift_key, *, data)

Source code in src/qgendapy/resources/task.py
def update_shift(
    self, task_key: str, shift_key: str, *, data: dict
) -> QGendaResponse[TaskShift]:
    return self._put(f"/task/{task_key}/taskshift/{shift_key}", json=data, model=TaskShift)

delete_shift(task_key, shift_key)

Source code in src/qgendapy/resources/task.py
def delete_shift(self, task_key: str, shift_key: str) -> QGendaResponse:
    return self._delete(f"/task/{task_key}/taskshift/{shift_key}")

AsyncTaskResource(client)

Bases: AsyncBaseResource

Asynchronous task endpoints.

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

list(*, odata=None) async

Source code in src/qgendapy/resources/task.py
async def list(self, *, odata: OData | None = None) -> QGendaResponse[Task]:
    params: dict[str, str] = {"companyKey": self._client.company_key}
    return await self._get("/task", params=params, model=Task, odata=odata)

create(*, data) async

Source code in src/qgendapy/resources/task.py
async def create(self, *, data: dict) -> QGendaResponse[Task]:
    return await self._post("/task", json=data, model=Task)

update(*, data) async

Source code in src/qgendapy/resources/task.py
async def update(self, *, data: dict) -> QGendaResponse[Task]:
    return await self._put("/task", json=data, model=Task)

locations(task_key) async

Source code in src/qgendapy/resources/task.py
async def locations(self, task_key: str) -> QGendaResponse:
    return await self._get(f"/task/{task_key}/location")

tags(task_key) async

Source code in src/qgendapy/resources/task.py
async def tags(self, task_key: str) -> QGendaResponse:
    return await self._get(f"/task/{task_key}/tag")

add_tag(task_key, *, data) async

Source code in src/qgendapy/resources/task.py
async def add_tag(self, task_key: str, *, data: dict) -> QGendaResponse:
    return await self._post(f"/task/{task_key}/tag", json=data)

shifts(task_key) async

Source code in src/qgendapy/resources/task.py
async def shifts(self, task_key: str) -> QGendaResponse[TaskShift]:
    return await self._get(f"/task/{task_key}/taskshift", model=TaskShift)

create_shift(task_key, *, data) async

Source code in src/qgendapy/resources/task.py
async def create_shift(self, task_key: str, *, data: dict) -> QGendaResponse[TaskShift]:
    return await self._post(f"/task/{task_key}/taskshift", json=data, model=TaskShift)

update_shift(task_key, shift_key, *, data) async

Source code in src/qgendapy/resources/task.py
async def update_shift(
    self, task_key: str, shift_key: str, *, data: dict
) -> QGendaResponse[TaskShift]:
    return await self._put(
        f"/task/{task_key}/taskshift/{shift_key}", json=data, model=TaskShift
    )

delete_shift(task_key, shift_key) async

Source code in src/qgendapy/resources/task.py
async def delete_shift(self, task_key: str, shift_key: str) -> QGendaResponse:
    return await self._delete(f"/task/{task_key}/taskshift/{shift_key}")