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")
|
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}")
|