Skip to content

Facility

qgendapy.resources.facility

FacilityResource(client)

Bases: BaseResource

Synchronous facility / location 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/facility.py
def list(self, *, odata: OData | None = None) -> QGendaResponse[Facility]:
    params: dict[str, str] = {"companyKey": self._client.company_key}
    return self._get("/location", params=params, model=Facility, odata=odata)

create(*, data)

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

get(location_key, *, odata=None)

Source code in src/qgendapy/resources/facility.py
def get(self, location_key: str, *, odata: OData | None = None) -> QGendaResponse[Facility]:
    return self._get(f"/location/{location_key}", model=Facility, odata=odata)

update(location_key, *, data)

Source code in src/qgendapy/resources/facility.py
def update(self, location_key: str, *, data: dict) -> QGendaResponse[Facility]:
    return self._put(f"/location/{location_key}", json=data, model=Facility)

delete(location_key)

Source code in src/qgendapy/resources/facility.py
def delete(self, location_key: str) -> QGendaResponse:
    return self._delete(f"/location/{location_key}")

staff(location_key)

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

add_staff(location_key, *, data)

Source code in src/qgendapy/resources/facility.py
def add_staff(self, location_key: str, *, data: dict) -> QGendaResponse:
    return self._post(f"/location/{location_key}/staff", json=data)

update_staff(location_key, staff_key, *, data)

Source code in src/qgendapy/resources/facility.py
def update_staff(self, location_key: str, staff_key: str, *, data: dict) -> QGendaResponse:
    return self._put(f"/location/{location_key}/staff/{staff_key}", json=data)

remove_staff(location_key, staff_key)

Source code in src/qgendapy/resources/facility.py
def remove_staff(self, location_key: str, staff_key: str) -> QGendaResponse:
    return self._delete(f"/location/{location_key}/staff/{staff_key}")

staff_credentials(location_key, staff_key)

Source code in src/qgendapy/resources/facility.py
def staff_credentials(self, location_key: str, staff_key: str) -> QGendaResponse:
    return self._get(f"/location/{location_key}/staff/{staff_key}/credential")

staff_fte(location_key, staff_key)

Source code in src/qgendapy/resources/facility.py
def staff_fte(self, location_key: str, staff_key: str) -> QGendaResponse:
    return self._get(f"/location/{location_key}/staff/{staff_key}/FTE")

update_staff_fte(location_key, staff_key, *, data)

Source code in src/qgendapy/resources/facility.py
def update_staff_fte(self, location_key: str, staff_key: str, *, data: dict) -> QGendaResponse:
    return self._put(f"/location/{location_key}/staff/{staff_key}/FTE", json=data)

staff_tags(location_key, staff_key)

Source code in src/qgendapy/resources/facility.py
def staff_tags(self, location_key: str, staff_key: str) -> QGendaResponse:
    return self._get(f"/location/{location_key}/staff/{staff_key}/tag")

update_staff_tag(location_key, staff_key, *, data)

Source code in src/qgendapy/resources/facility.py
def update_staff_tag(self, location_key: str, staff_key: str, *, data: dict) -> QGendaResponse:
    return self._put(f"/location/{location_key}/staff/{staff_key}/tag", json=data)

tags(location_key)

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

update_tag(location_key, *, data)

Source code in src/qgendapy/resources/facility.py
def update_tag(self, location_key: str, *, data: dict) -> QGendaResponse:
    return self._put(f"/location/{location_key}/tag", json=data)

tasks(location_key)

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

add_task(location_key, *, data)

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

update_task(location_key, task_key, *, data)

Source code in src/qgendapy/resources/facility.py
def update_task(self, location_key: str, task_key: str, *, data: dict) -> QGendaResponse:
    return self._put(f"/location/{location_key}/task/{task_key}", json=data)

remove_task(location_key, task_key)

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

AsyncFacilityResource(client)

Bases: AsyncBaseResource

Asynchronous facility / location 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/facility.py
async def list(self, *, odata: OData | None = None) -> QGendaResponse[Facility]:
    params: dict[str, str] = {"companyKey": self._client.company_key}
    return await self._get("/location", params=params, model=Facility, odata=odata)

create(*, data) async

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

get(location_key, *, odata=None) async

Source code in src/qgendapy/resources/facility.py
async def get(
    self, location_key: str, *, odata: OData | None = None
) -> QGendaResponse[Facility]:
    return await self._get(f"/location/{location_key}", model=Facility, odata=odata)

update(location_key, *, data) async

Source code in src/qgendapy/resources/facility.py
async def update(self, location_key: str, *, data: dict) -> QGendaResponse[Facility]:
    return await self._put(f"/location/{location_key}", json=data, model=Facility)

delete(location_key) async

Source code in src/qgendapy/resources/facility.py
async def delete(self, location_key: str) -> QGendaResponse:
    return await self._delete(f"/location/{location_key}")

staff(location_key) async

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

add_staff(location_key, *, data) async

Source code in src/qgendapy/resources/facility.py
async def add_staff(self, location_key: str, *, data: dict) -> QGendaResponse:
    return await self._post(f"/location/{location_key}/staff", json=data)

update_staff(location_key, staff_key, *, data) async

Source code in src/qgendapy/resources/facility.py
async def update_staff(
    self, location_key: str, staff_key: str, *, data: dict
) -> QGendaResponse:
    return await self._put(f"/location/{location_key}/staff/{staff_key}", json=data)

remove_staff(location_key, staff_key) async

Source code in src/qgendapy/resources/facility.py
async def remove_staff(self, location_key: str, staff_key: str) -> QGendaResponse:
    return await self._delete(f"/location/{location_key}/staff/{staff_key}")

staff_credentials(location_key, staff_key) async

Source code in src/qgendapy/resources/facility.py
async def staff_credentials(self, location_key: str, staff_key: str) -> QGendaResponse:
    return await self._get(f"/location/{location_key}/staff/{staff_key}/credential")

staff_fte(location_key, staff_key) async

Source code in src/qgendapy/resources/facility.py
async def staff_fte(self, location_key: str, staff_key: str) -> QGendaResponse:
    return await self._get(f"/location/{location_key}/staff/{staff_key}/FTE")

update_staff_fte(location_key, staff_key, *, data) async

Source code in src/qgendapy/resources/facility.py
async def update_staff_fte(
    self, location_key: str, staff_key: str, *, data: dict
) -> QGendaResponse:
    return await self._put(f"/location/{location_key}/staff/{staff_key}/FTE", json=data)

staff_tags(location_key, staff_key) async

Source code in src/qgendapy/resources/facility.py
async def staff_tags(self, location_key: str, staff_key: str) -> QGendaResponse:
    return await self._get(f"/location/{location_key}/staff/{staff_key}/tag")

update_staff_tag(location_key, staff_key, *, data) async

Source code in src/qgendapy/resources/facility.py
async def update_staff_tag(
    self, location_key: str, staff_key: str, *, data: dict
) -> QGendaResponse:
    return await self._put(f"/location/{location_key}/staff/{staff_key}/tag", json=data)

tags(location_key) async

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

update_tag(location_key, *, data) async

Source code in src/qgendapy/resources/facility.py
async def update_tag(self, location_key: str, *, data: dict) -> QGendaResponse:
    return await self._put(f"/location/{location_key}/tag", json=data)

tasks(location_key) async

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

add_task(location_key, *, data) async

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

update_task(location_key, task_key, *, data) async

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

remove_task(location_key, task_key) async

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