Platform API Client
- class enlyze.api_client.client.PlatformApiClient[source]
API Client class encapsulating all interaction with the ENLYZE platform
- Parameters:
- get(api_path, **kwargs)[source]
Wraps
httpx.Client.get()with defensive error handling- Parameters:
api_path (str | URL) – Relative URL path inside the API name space (or a full URL)
- Returns:
JSON payload of the response as Python object
- Raises:
EnlyzeErroron request failure- Raises:
EnlyzeErroron non-2xx status code- Raises:
EnlyzeErroron non-JSON payload- Return type:
- post(api_path, **kwargs)[source]
Wraps
httpx.Client.post()with defensive error handling- Parameters:
api_path (str | URL) – Relative URL path inside the API name space (or a full URL)
- Returns:
JSON payload of the response as Python object
- Raises:
EnlyzeErroron request failure- Raises:
EnlyzeErroron non-2xx status code- Raises:
EnlyzeErroron non-JSON payload- Return type:
- get_paginated(api_path, model, **kwargs)[source]
Retrieve objects from a paginated ENLYZE platform API endpoint via HTTP GET
- Parameters:
api_path (str | URL) – Relative URL path inside the ENLYZE platform API
model (Type[T]) – API response model class derived from
PlatformApiModel
- Returns:
Instances of
modelretrieved from theapi_pathendpoint- Raises:
EnlyzeErroron invalid pagination schema- Raises:
EnlyzeErroron invalid data schema- Raises:
see
get()for more errors raised by this method- Return type:
Iterator[T]
- post_paginated(api_path, model, **kwargs)[source]
Retrieve objects from a paginated ENLYZE platform API endpoint via HTTP POST
- Parameters:
api_path (str | URL) – Relative URL path inside the ENLYZE platform API
model (Type[T]) – API response model class derived from
PlatformApiModel
- Returns:
Instances of
modelretrieved from theapi_pathendpoint- Raises:
EnlyzeErroron invalid pagination schema- Raises:
EnlyzeErroron invalid data schema- Raises:
see
post()for more errors raised by this method- Return type:
Iterator[T]