From fb8d5c2f6c5286317df57113a3465670b191ea60 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Tue, 14 Jul 2026 10:48:01 +1000 Subject: [PATCH] api_client: regenerate from API spec Regenerate the API client from the latest API spec as of 2026/07/14. Signed-off-by: Jordan Yates --- ...s_by_organisation_id_and_application_id.py | 269 ++++++++++++++++++ .../application/get_release_by_release_id.py | 176 ++++++++++++ .../api_client/api/board/get_boards.py | 36 ++- .../api/board/get_devices_by_board_id.py | 34 +++ ...et_device_application_states_by_devices.py | 175 ++++++++++++ .../get_logger_states_for_devices_by_index.py | 191 +++++++++++++ ..._device_application_update_by_device_id.py | 170 +++++++++++ ...g_device_application_updates_by_devices.py | 173 +++++++++++ ...ice_logger_state_by_device_id_and_index.py | 15 + ...pdate_logger_state_for_devices_by_index.py | 191 +++++++++++++ .../api_client/api/network/get_networks.py | 36 ++- .../api/organisation/get_all_organisations.py | 59 +++- .../api_client/api/rpc/get_rp_cs.py | 19 ++ src/infuse_iot/api_client/models/__init__.py | 30 ++ .../appplication_states_by_devices_body.py | 62 ++++ ...appplication_states_by_devices_response.py | 67 +++++ ...ication_states_by_devices_response_data.py | 60 ++++ .../api_client/models/batch_device_error.py | 69 +++++ ..._state_for_devices_by_index_update_body.py | 76 +++++ ...te_for_devices_by_index_update_response.py | 88 ++++++ ...r_devices_by_index_update_response_data.py | 60 ++++ ...devices_by_index_update_response_errors.py | 60 ++++ ...logger_states_for_devices_by_index_body.py | 62 ++++ ...er_states_for_devices_by_index_response.py | 67 +++++ ...ates_for_devices_by_index_response_data.py | 60 ++++ ...ice_application_updates_by_devices_body.py | 61 ++++ ...application_updates_by_devices_response.py | 72 +++++ ...cation_updates_by_devices_response_data.py | 60 ++++ 28 files changed, 2492 insertions(+), 6 deletions(-) create mode 100644 src/infuse_iot/api_client/api/application/get_diffs_by_organisation_id_and_application_id.py create mode 100644 src/infuse_iot/api_client/api/application/get_release_by_release_id.py create mode 100644 src/infuse_iot/api_client/api/device/get_device_application_states_by_devices.py create mode 100644 src/infuse_iot/api_client/api/device/get_logger_states_for_devices_by_index.py create mode 100644 src/infuse_iot/api_client/api/device/get_pending_device_application_update_by_device_id.py create mode 100644 src/infuse_iot/api_client/api/device/get_pending_device_application_updates_by_devices.py create mode 100644 src/infuse_iot/api_client/api/device/update_logger_state_for_devices_by_index.py create mode 100644 src/infuse_iot/api_client/models/appplication_states_by_devices_body.py create mode 100644 src/infuse_iot/api_client/models/appplication_states_by_devices_response.py create mode 100644 src/infuse_iot/api_client/models/appplication_states_by_devices_response_data.py create mode 100644 src/infuse_iot/api_client/models/batch_device_error.py create mode 100644 src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_body.py create mode 100644 src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response.py create mode 100644 src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_data.py create mode 100644 src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_errors.py create mode 100644 src/infuse_iot/api_client/models/logger_states_for_devices_by_index_body.py create mode 100644 src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response.py create mode 100644 src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response_data.py create mode 100644 src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_body.py create mode 100644 src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response.py create mode 100644 src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response_data.py diff --git a/src/infuse_iot/api_client/api/application/get_diffs_by_organisation_id_and_application_id.py b/src/infuse_iot/api_client/api/application/get_diffs_by_organisation_id_and_application_id.py new file mode 100644 index 0000000..74ef21b --- /dev/null +++ b/src/infuse_iot/api_client/api/application/get_diffs_by_organisation_id_and_application_id.py @@ -0,0 +1,269 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.application_release_diff import ApplicationReleaseDiff +from ...models.error import Error +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: UUID, + application_id: int, + *, + from_release_id: str | Unset = UNSET, + to_release_id: str | Unset = UNSET, + limit: int | Unset = 100, + offset: int | Unset = 0, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["fromReleaseId"] = from_release_id + + params["toReleaseId"] = to_release_id + + params["limit"] = limit + + params["offset"] = offset + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/organisation/id/{id}/applications/{application_id}/diffs".format( + id=quote(str(id), safe=""), + application_id=quote(str(application_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Error | list[ApplicationReleaseDiff] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ApplicationReleaseDiff.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Error | list[ApplicationReleaseDiff]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + application_id: int, + *, + client: AuthenticatedClient | Client, + from_release_id: str | Unset = UNSET, + to_release_id: str | Unset = UNSET, + limit: int | Unset = 100, + offset: int | Unset = 0, +) -> Response[Error | list[ApplicationReleaseDiff]]: + """Get release diffs for an application + + Get release diffs for an application. Filter by fromReleaseId, toReleaseId, or both. If both are + provided, returns the matching diff between those releases. + + Args: + id (UUID): + application_id (int): + from_release_id (str | Unset): + to_release_id (str | Unset): + limit (int | Unset): Default: 100. + offset (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | list[ApplicationReleaseDiff]] + """ + + kwargs = _get_kwargs( + id=id, + application_id=application_id, + from_release_id=from_release_id, + to_release_id=to_release_id, + limit=limit, + offset=offset, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + application_id: int, + *, + client: AuthenticatedClient | Client, + from_release_id: str | Unset = UNSET, + to_release_id: str | Unset = UNSET, + limit: int | Unset = 100, + offset: int | Unset = 0, +) -> Error | list[ApplicationReleaseDiff] | None: + """Get release diffs for an application + + Get release diffs for an application. Filter by fromReleaseId, toReleaseId, or both. If both are + provided, returns the matching diff between those releases. + + Args: + id (UUID): + application_id (int): + from_release_id (str | Unset): + to_release_id (str | Unset): + limit (int | Unset): Default: 100. + offset (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | list[ApplicationReleaseDiff] + """ + + return sync_detailed( + id=id, + application_id=application_id, + client=client, + from_release_id=from_release_id, + to_release_id=to_release_id, + limit=limit, + offset=offset, + ).parsed + + +async def asyncio_detailed( + id: UUID, + application_id: int, + *, + client: AuthenticatedClient | Client, + from_release_id: str | Unset = UNSET, + to_release_id: str | Unset = UNSET, + limit: int | Unset = 100, + offset: int | Unset = 0, +) -> Response[Error | list[ApplicationReleaseDiff]]: + """Get release diffs for an application + + Get release diffs for an application. Filter by fromReleaseId, toReleaseId, or both. If both are + provided, returns the matching diff between those releases. + + Args: + id (UUID): + application_id (int): + from_release_id (str | Unset): + to_release_id (str | Unset): + limit (int | Unset): Default: 100. + offset (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | list[ApplicationReleaseDiff]] + """ + + kwargs = _get_kwargs( + id=id, + application_id=application_id, + from_release_id=from_release_id, + to_release_id=to_release_id, + limit=limit, + offset=offset, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + application_id: int, + *, + client: AuthenticatedClient | Client, + from_release_id: str | Unset = UNSET, + to_release_id: str | Unset = UNSET, + limit: int | Unset = 100, + offset: int | Unset = 0, +) -> Error | list[ApplicationReleaseDiff] | None: + """Get release diffs for an application + + Get release diffs for an application. Filter by fromReleaseId, toReleaseId, or both. If both are + provided, returns the matching diff between those releases. + + Args: + id (UUID): + application_id (int): + from_release_id (str | Unset): + to_release_id (str | Unset): + limit (int | Unset): Default: 100. + offset (int | Unset): Default: 0. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | list[ApplicationReleaseDiff] + """ + + return ( + await asyncio_detailed( + id=id, + application_id=application_id, + client=client, + from_release_id=from_release_id, + to_release_id=to_release_id, + limit=limit, + offset=offset, + ) + ).parsed diff --git a/src/infuse_iot/api_client/api/application/get_release_by_release_id.py b/src/infuse_iot/api_client/api/application/get_release_by_release_id.py new file mode 100644 index 0000000..3805f85 --- /dev/null +++ b/src/infuse_iot/api_client/api/application/get_release_by_release_id.py @@ -0,0 +1,176 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.application_release import ApplicationRelease +from ...models.error import Error +from ...types import Response + + +def _get_kwargs( + release_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/release/{release_id}".format( + release_id=quote(str(release_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApplicationRelease | Error | None: + if response.status_code == 200: + response_200 = ApplicationRelease.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ApplicationRelease | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + release_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ApplicationRelease | Error]: + """Get a release by release ID + + Args: + release_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApplicationRelease | Error] + """ + + kwargs = _get_kwargs( + release_id=release_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + release_id: str, + *, + client: AuthenticatedClient | Client, +) -> ApplicationRelease | Error | None: + """Get a release by release ID + + Args: + release_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApplicationRelease | Error + """ + + return sync_detailed( + release_id=release_id, + client=client, + ).parsed + + +async def asyncio_detailed( + release_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ApplicationRelease | Error]: + """Get a release by release ID + + Args: + release_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApplicationRelease | Error] + """ + + kwargs = _get_kwargs( + release_id=release_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + release_id: str, + *, + client: AuthenticatedClient | Client, +) -> ApplicationRelease | Error | None: + """Get a release by release ID + + Args: + release_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApplicationRelease | Error + """ + + return ( + await asyncio_detailed( + release_id=release_id, + client=client, + ) + ).parsed diff --git a/src/infuse_iot/api_client/api/board/get_boards.py b/src/infuse_iot/api_client/api/board/get_boards.py index 68e128b..db86db6 100644 --- a/src/infuse_iot/api_client/api/board/get_boards.py +++ b/src/infuse_iot/api_client/api/board/get_boards.py @@ -7,12 +7,14 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.board import Board -from ...types import UNSET, Response +from ...types import UNSET, Response, Unset def _get_kwargs( *, organisation_id: UUID, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -20,6 +22,10 @@ def _get_kwargs( json_organisation_id = str(organisation_id) params["organisationId"] = json_organisation_id + params["limit"] = limit + + params["offset"] = offset + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -61,11 +67,16 @@ def sync_detailed( *, client: AuthenticatedClient | Client, organisation_id: UUID, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[list[Board]]: """Get all boards in an organisation Args: organisation_id (UUID): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -77,6 +88,8 @@ def sync_detailed( kwargs = _get_kwargs( organisation_id=organisation_id, + limit=limit, + offset=offset, ) response = client.get_httpx_client().request( @@ -90,11 +103,16 @@ def sync( *, client: AuthenticatedClient | Client, organisation_id: UUID, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> list[Board] | None: """Get all boards in an organisation Args: organisation_id (UUID): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -107,6 +125,8 @@ def sync( return sync_detailed( client=client, organisation_id=organisation_id, + limit=limit, + offset=offset, ).parsed @@ -114,11 +134,16 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, organisation_id: UUID, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[list[Board]]: """Get all boards in an organisation Args: organisation_id (UUID): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,6 +155,8 @@ async def asyncio_detailed( kwargs = _get_kwargs( organisation_id=organisation_id, + limit=limit, + offset=offset, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -141,11 +168,16 @@ async def asyncio( *, client: AuthenticatedClient | Client, organisation_id: UUID, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> list[Board] | None: """Get all boards in an organisation Args: organisation_id (UUID): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,5 +191,7 @@ async def asyncio( await asyncio_detailed( client=client, organisation_id=organisation_id, + limit=limit, + offset=offset, ) ).parsed diff --git a/src/infuse_iot/api_client/api/board/get_devices_by_board_id.py b/src/infuse_iot/api_client/api/board/get_devices_by_board_id.py index e3415ed..288717a 100644 --- a/src/infuse_iot/api_client/api/board/get_devices_by_board_id.py +++ b/src/infuse_iot/api_client/api/board/get_devices_by_board_id.py @@ -17,6 +17,8 @@ def _get_kwargs( *, metadata_name: str | Unset = UNSET, metadata_value: str | Unset = UNSET, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -25,6 +27,10 @@ def _get_kwargs( params["metadataValue"] = metadata_value + params["limit"] = limit + + params["offset"] = offset + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -77,6 +83,8 @@ def sync_detailed( client: AuthenticatedClient | Client, metadata_name: str | Unset = UNSET, metadata_value: str | Unset = UNSET, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[Error | list[Device]]: """Get devices by board id and optional metadata field @@ -84,6 +92,9 @@ def sync_detailed( id (UUID): metadata_name (str | Unset): metadata_value (str | Unset): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,6 +108,8 @@ def sync_detailed( id=id, metadata_name=metadata_name, metadata_value=metadata_value, + limit=limit, + offset=offset, ) response = client.get_httpx_client().request( @@ -112,6 +125,8 @@ def sync( client: AuthenticatedClient | Client, metadata_name: str | Unset = UNSET, metadata_value: str | Unset = UNSET, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Error | list[Device] | None: """Get devices by board id and optional metadata field @@ -119,6 +134,9 @@ def sync( id (UUID): metadata_name (str | Unset): metadata_value (str | Unset): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,6 +151,8 @@ def sync( client=client, metadata_name=metadata_name, metadata_value=metadata_value, + limit=limit, + offset=offset, ).parsed @@ -142,6 +162,8 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, metadata_name: str | Unset = UNSET, metadata_value: str | Unset = UNSET, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[Error | list[Device]]: """Get devices by board id and optional metadata field @@ -149,6 +171,9 @@ async def asyncio_detailed( id (UUID): metadata_name (str | Unset): metadata_value (str | Unset): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,6 +187,8 @@ async def asyncio_detailed( id=id, metadata_name=metadata_name, metadata_value=metadata_value, + limit=limit, + offset=offset, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -175,6 +202,8 @@ async def asyncio( client: AuthenticatedClient | Client, metadata_name: str | Unset = UNSET, metadata_value: str | Unset = UNSET, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Error | list[Device] | None: """Get devices by board id and optional metadata field @@ -182,6 +211,9 @@ async def asyncio( id (UUID): metadata_name (str | Unset): metadata_value (str | Unset): + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,5 +229,7 @@ async def asyncio( client=client, metadata_name=metadata_name, metadata_value=metadata_value, + limit=limit, + offset=offset, ) ).parsed diff --git a/src/infuse_iot/api_client/api/device/get_device_application_states_by_devices.py b/src/infuse_iot/api_client/api/device/get_device_application_states_by_devices.py new file mode 100644 index 0000000..e27f58c --- /dev/null +++ b/src/infuse_iot/api_client/api/device/get_device_application_states_by_devices.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.appplication_states_by_devices_body import AppplicationStatesByDevicesBody +from ...models.appplication_states_by_devices_response import AppplicationStatesByDevicesResponse +from ...models.error import Error +from ...types import Response + + +def _get_kwargs( + *, + body: AppplicationStatesByDevicesBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/device/application/state/query", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppplicationStatesByDevicesResponse | Error | None: + if response.status_code == 200: + response_200 = AppplicationStatesByDevicesResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AppplicationStatesByDevicesResponse | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: AppplicationStatesByDevicesBody, +) -> Response[AppplicationStatesByDevicesResponse | Error]: + """Get device application states for a group of devices + + Args: + body (AppplicationStatesByDevicesBody): Body for getting application states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AppplicationStatesByDevicesResponse | Error] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: AppplicationStatesByDevicesBody, +) -> AppplicationStatesByDevicesResponse | Error | None: + """Get device application states for a group of devices + + Args: + body (AppplicationStatesByDevicesBody): Body for getting application states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AppplicationStatesByDevicesResponse | Error + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: AppplicationStatesByDevicesBody, +) -> Response[AppplicationStatesByDevicesResponse | Error]: + """Get device application states for a group of devices + + Args: + body (AppplicationStatesByDevicesBody): Body for getting application states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AppplicationStatesByDevicesResponse | Error] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: AppplicationStatesByDevicesBody, +) -> AppplicationStatesByDevicesResponse | Error | None: + """Get device application states for a group of devices + + Args: + body (AppplicationStatesByDevicesBody): Body for getting application states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AppplicationStatesByDevicesResponse | Error + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/infuse_iot/api_client/api/device/get_logger_states_for_devices_by_index.py b/src/infuse_iot/api_client/api/device/get_logger_states_for_devices_by_index.py new file mode 100644 index 0000000..55599c8 --- /dev/null +++ b/src/infuse_iot/api_client/api/device/get_logger_states_for_devices_by_index.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...models.logger_states_for_devices_by_index_body import LoggerStatesForDevicesByIndexBody +from ...models.logger_states_for_devices_by_index_response import LoggerStatesForDevicesByIndexResponse +from ...types import Response + + +def _get_kwargs( + index: int, + *, + body: LoggerStatesForDevicesByIndexBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/device/loggerState/{index}/query".format( + index=quote(str(index), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Error | LoggerStatesForDevicesByIndexResponse | None: + if response.status_code == 200: + response_200 = LoggerStatesForDevicesByIndexResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Error | LoggerStatesForDevicesByIndexResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStatesForDevicesByIndexBody, +) -> Response[Error | LoggerStatesForDevicesByIndexResponse]: + """Get logger states for a group of devices + + Args: + index (int): + body (LoggerStatesForDevicesByIndexBody): Body for getting logger states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LoggerStatesForDevicesByIndexResponse] + """ + + kwargs = _get_kwargs( + index=index, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStatesForDevicesByIndexBody, +) -> Error | LoggerStatesForDevicesByIndexResponse | None: + """Get logger states for a group of devices + + Args: + index (int): + body (LoggerStatesForDevicesByIndexBody): Body for getting logger states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LoggerStatesForDevicesByIndexResponse + """ + + return sync_detailed( + index=index, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStatesForDevicesByIndexBody, +) -> Response[Error | LoggerStatesForDevicesByIndexResponse]: + """Get logger states for a group of devices + + Args: + index (int): + body (LoggerStatesForDevicesByIndexBody): Body for getting logger states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LoggerStatesForDevicesByIndexResponse] + """ + + kwargs = _get_kwargs( + index=index, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStatesForDevicesByIndexBody, +) -> Error | LoggerStatesForDevicesByIndexResponse | None: + """Get logger states for a group of devices + + Args: + index (int): + body (LoggerStatesForDevicesByIndexBody): Body for getting logger states for devices by + index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LoggerStatesForDevicesByIndexResponse + """ + + return ( + await asyncio_detailed( + index=index, + client=client, + body=body, + ) + ).parsed diff --git a/src/infuse_iot/api_client/api/device/get_pending_device_application_update_by_device_id.py b/src/infuse_iot/api_client/api/device/get_pending_device_application_update_by_device_id.py new file mode 100644 index 0000000..d9abef0 --- /dev/null +++ b/src/infuse_iot/api_client/api/device/get_pending_device_application_update_by_device_id.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.device_application_update_and_message import DeviceApplicationUpdateAndMessage +from ...models.error import Error +from ...types import Response + + +def _get_kwargs( + device_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/device/deviceId/{device_id}/application/updates/pending".format( + device_id=quote(str(device_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | DeviceApplicationUpdateAndMessage | Error | None: + if response.status_code == 200: + response_200 = DeviceApplicationUpdateAndMessage.from_dict(response.json()) + + return response_200 + + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | DeviceApplicationUpdateAndMessage | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + device_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | DeviceApplicationUpdateAndMessage | Error]: + """Get pending device application update with downlink message by DeviceID + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | DeviceApplicationUpdateAndMessage | Error] + """ + + kwargs = _get_kwargs( + device_id=device_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + device_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | DeviceApplicationUpdateAndMessage | Error | None: + """Get pending device application update with downlink message by DeviceID + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | DeviceApplicationUpdateAndMessage | Error + """ + + return sync_detailed( + device_id=device_id, + client=client, + ).parsed + + +async def asyncio_detailed( + device_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | DeviceApplicationUpdateAndMessage | Error]: + """Get pending device application update with downlink message by DeviceID + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | DeviceApplicationUpdateAndMessage | Error] + """ + + kwargs = _get_kwargs( + device_id=device_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + device_id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | DeviceApplicationUpdateAndMessage | Error | None: + """Get pending device application update with downlink message by DeviceID + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | DeviceApplicationUpdateAndMessage | Error + """ + + return ( + await asyncio_detailed( + device_id=device_id, + client=client, + ) + ).parsed diff --git a/src/infuse_iot/api_client/api/device/get_pending_device_application_updates_by_devices.py b/src/infuse_iot/api_client/api/device/get_pending_device_application_updates_by_devices.py new file mode 100644 index 0000000..4e7ccdd --- /dev/null +++ b/src/infuse_iot/api_client/api/device/get_pending_device_application_updates_by_devices.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...models.pending_device_application_updates_by_devices_body import PendingDeviceApplicationUpdatesByDevicesBody +from ...models.pending_device_application_updates_by_devices_response import ( + PendingDeviceApplicationUpdatesByDevicesResponse, +) +from ...types import Response + + +def _get_kwargs( + *, + body: PendingDeviceApplicationUpdatesByDevicesBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/device/application/updates/pending/query", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Error | PendingDeviceApplicationUpdatesByDevicesResponse | None: + if response.status_code == 200: + response_200 = PendingDeviceApplicationUpdatesByDevicesResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Error | PendingDeviceApplicationUpdatesByDevicesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: PendingDeviceApplicationUpdatesByDevicesBody, +) -> Response[Error | PendingDeviceApplicationUpdatesByDevicesResponse]: + """Get pending device application update with downlink messages for a group of devices + + Args: + body (PendingDeviceApplicationUpdatesByDevicesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PendingDeviceApplicationUpdatesByDevicesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: PendingDeviceApplicationUpdatesByDevicesBody, +) -> Error | PendingDeviceApplicationUpdatesByDevicesResponse | None: + """Get pending device application update with downlink messages for a group of devices + + Args: + body (PendingDeviceApplicationUpdatesByDevicesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PendingDeviceApplicationUpdatesByDevicesResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: PendingDeviceApplicationUpdatesByDevicesBody, +) -> Response[Error | PendingDeviceApplicationUpdatesByDevicesResponse]: + """Get pending device application update with downlink messages for a group of devices + + Args: + body (PendingDeviceApplicationUpdatesByDevicesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PendingDeviceApplicationUpdatesByDevicesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: PendingDeviceApplicationUpdatesByDevicesBody, +) -> Error | PendingDeviceApplicationUpdatesByDevicesResponse | None: + """Get pending device application update with downlink messages for a group of devices + + Args: + body (PendingDeviceApplicationUpdatesByDevicesBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PendingDeviceApplicationUpdatesByDevicesResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/infuse_iot/api_client/api/device/update_device_logger_state_by_device_id_and_index.py b/src/infuse_iot/api_client/api/device/update_device_logger_state_by_device_id_and_index.py index 7610113..4470c60 100644 --- a/src/infuse_iot/api_client/api/device/update_device_logger_state_by_device_id_and_index.py +++ b/src/infuse_iot/api_client/api/device/update_device_logger_state_by_device_id_and_index.py @@ -44,11 +44,26 @@ def _parse_response( return response_200 + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + return response_403 + if response.status_code == 404: response_404 = Error.from_dict(response.json()) return response_404 + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/infuse_iot/api_client/api/device/update_logger_state_for_devices_by_index.py b/src/infuse_iot/api_client/api/device/update_logger_state_for_devices_by_index.py new file mode 100644 index 0000000..0d9f857 --- /dev/null +++ b/src/infuse_iot/api_client/api/device/update_logger_state_for_devices_by_index.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error import Error +from ...models.logger_state_for_devices_by_index_update_body import LoggerStateForDevicesByIndexUpdateBody +from ...models.logger_state_for_devices_by_index_update_response import LoggerStateForDevicesByIndexUpdateResponse +from ...types import Response + + +def _get_kwargs( + index: int, + *, + body: LoggerStateForDevicesByIndexUpdateBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/device/loggerState/{index}/".format( + index=quote(str(index), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Error | LoggerStateForDevicesByIndexUpdateResponse | None: + if response.status_code == 200: + response_200 = LoggerStateForDevicesByIndexUpdateResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + return response_400 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Error | LoggerStateForDevicesByIndexUpdateResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStateForDevicesByIndexUpdateBody, +) -> Response[Error | LoggerStateForDevicesByIndexUpdateResponse]: + """Update logger state for a group of devices + + Args: + index (int): + body (LoggerStateForDevicesByIndexUpdateBody): Body for updating logger states for devices + by index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LoggerStateForDevicesByIndexUpdateResponse] + """ + + kwargs = _get_kwargs( + index=index, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStateForDevicesByIndexUpdateBody, +) -> Error | LoggerStateForDevicesByIndexUpdateResponse | None: + """Update logger state for a group of devices + + Args: + index (int): + body (LoggerStateForDevicesByIndexUpdateBody): Body for updating logger states for devices + by index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LoggerStateForDevicesByIndexUpdateResponse + """ + + return sync_detailed( + index=index, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStateForDevicesByIndexUpdateBody, +) -> Response[Error | LoggerStateForDevicesByIndexUpdateResponse]: + """Update logger state for a group of devices + + Args: + index (int): + body (LoggerStateForDevicesByIndexUpdateBody): Body for updating logger states for devices + by index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LoggerStateForDevicesByIndexUpdateResponse] + """ + + kwargs = _get_kwargs( + index=index, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + index: int, + *, + client: AuthenticatedClient | Client, + body: LoggerStateForDevicesByIndexUpdateBody, +) -> Error | LoggerStateForDevicesByIndexUpdateResponse | None: + """Update logger state for a group of devices + + Args: + index (int): + body (LoggerStateForDevicesByIndexUpdateBody): Body for updating logger states for devices + by index + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LoggerStateForDevicesByIndexUpdateResponse + """ + + return ( + await asyncio_detailed( + index=index, + client=client, + body=body, + ) + ).parsed diff --git a/src/infuse_iot/api_client/api/network/get_networks.py b/src/infuse_iot/api_client/api/network/get_networks.py index 2661a7a..44fa5d8 100644 --- a/src/infuse_iot/api_client/api/network/get_networks.py +++ b/src/infuse_iot/api_client/api/network/get_networks.py @@ -7,13 +7,15 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.network import Network -from ...types import UNSET, Response +from ...types import UNSET, Response, Unset def _get_kwargs( *, organisation_id: UUID, include_public: bool = False, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -23,6 +25,10 @@ def _get_kwargs( params["includePublic"] = include_public + params["limit"] = limit + + params["offset"] = offset + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -65,6 +71,8 @@ def sync_detailed( client: AuthenticatedClient | Client, organisation_id: UUID, include_public: bool = False, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[list[Network]]: """Get networks @@ -73,6 +81,9 @@ def sync_detailed( Args: organisation_id (UUID): include_public (bool): Default: False. + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -85,6 +96,8 @@ def sync_detailed( kwargs = _get_kwargs( organisation_id=organisation_id, include_public=include_public, + limit=limit, + offset=offset, ) response = client.get_httpx_client().request( @@ -99,6 +112,8 @@ def sync( client: AuthenticatedClient | Client, organisation_id: UUID, include_public: bool = False, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> list[Network] | None: """Get networks @@ -107,6 +122,9 @@ def sync( Args: organisation_id (UUID): include_public (bool): Default: False. + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -120,6 +138,8 @@ def sync( client=client, organisation_id=organisation_id, include_public=include_public, + limit=limit, + offset=offset, ).parsed @@ -128,6 +148,8 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, organisation_id: UUID, include_public: bool = False, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[list[Network]]: """Get networks @@ -136,6 +158,9 @@ async def asyncio_detailed( Args: organisation_id (UUID): include_public (bool): Default: False. + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,6 +173,8 @@ async def asyncio_detailed( kwargs = _get_kwargs( organisation_id=organisation_id, include_public=include_public, + limit=limit, + offset=offset, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -160,6 +187,8 @@ async def asyncio( client: AuthenticatedClient | Client, organisation_id: UUID, include_public: bool = False, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> list[Network] | None: """Get networks @@ -168,6 +197,9 @@ async def asyncio( Args: organisation_id (UUID): include_public (bool): Default: False. + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,5 +214,7 @@ async def asyncio( client=client, organisation_id=organisation_id, include_public=include_public, + limit=limit, + offset=offset, ) ).parsed diff --git a/src/infuse_iot/api_client/api/organisation/get_all_organisations.py b/src/infuse_iot/api_client/api/organisation/get_all_organisations.py index 6a7170d..307564e 100644 --- a/src/infuse_iot/api_client/api/organisation/get_all_organisations.py +++ b/src/infuse_iot/api_client/api/organisation/get_all_organisations.py @@ -7,14 +7,27 @@ from ...client import AuthenticatedClient, Client from ...models.error import Error from ...models.organisation import Organisation -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> dict[str, Any]: +def _get_kwargs( + *, + limit: int | Unset = 10, + offset: int | Unset = 0, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["limit"] = limit + + params["offset"] = offset + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { "method": "get", "url": "/organisation", + "params": params, } return _kwargs @@ -58,9 +71,16 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient | Client, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[Error | list[Organisation]]: """Get all organisations that user has access to + Args: + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -69,7 +89,10 @@ def sync_detailed( Response[Error | list[Organisation]] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + limit=limit, + offset=offset, + ) response = client.get_httpx_client().request( **kwargs, @@ -81,9 +104,16 @@ def sync_detailed( def sync( *, client: AuthenticatedClient | Client, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Error | list[Organisation] | None: """Get all organisations that user has access to + Args: + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -94,15 +124,24 @@ def sync( return sync_detailed( client=client, + limit=limit, + offset=offset, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient | Client, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Response[Error | list[Organisation]]: """Get all organisations that user has access to + Args: + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -111,7 +150,10 @@ async def asyncio_detailed( Response[Error | list[Organisation]] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + limit=limit, + offset=offset, + ) response = await client.get_async_httpx_client().request(**kwargs) @@ -121,9 +163,16 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient | Client, + limit: int | Unset = 10, + offset: int | Unset = 0, ) -> Error | list[Organisation] | None: """Get all organisations that user has access to + Args: + limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -135,5 +184,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, + limit=limit, + offset=offset, ) ).parsed diff --git a/src/infuse_iot/api_client/api/rpc/get_rp_cs.py b/src/infuse_iot/api_client/api/rpc/get_rp_cs.py index bde2d2e..87c4899 100644 --- a/src/infuse_iot/api_client/api/rpc/get_rp_cs.py +++ b/src/infuse_iot/api_client/api/rpc/get_rp_cs.py @@ -21,6 +21,7 @@ def _get_kwargs( start_time: datetime.datetime | Unset = UNSET, end_time: datetime.datetime | Unset = UNSET, limit: int | Unset = 10, + offset: int | Unset = 0, rpc_command_id: int | Unset = UNSET, show_expired: bool | Unset = True, ) -> dict[str, Any]: @@ -52,6 +53,8 @@ def _get_kwargs( params["limit"] = limit + params["offset"] = offset + params["rpcCommandId"] = rpc_command_id params["showExpired"] = show_expired @@ -111,6 +114,7 @@ def sync_detailed( start_time: datetime.datetime | Unset = UNSET, end_time: datetime.datetime | Unset = UNSET, limit: int | Unset = 10, + offset: int | Unset = 0, rpc_command_id: int | Unset = UNSET, show_expired: bool | Unset = True, ) -> Response[Error | list[RpcMessage]]: @@ -126,6 +130,8 @@ def sync_detailed( end_time (datetime.datetime | Unset): The end time of the query (only return items on or before this time) limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. rpc_command_id (int | Unset): ID of RPC command show_expired (bool | Unset): Whether to show expired RPC messages Default: True. @@ -144,6 +150,7 @@ def sync_detailed( start_time=start_time, end_time=end_time, limit=limit, + offset=offset, rpc_command_id=rpc_command_id, show_expired=show_expired, ) @@ -164,6 +171,7 @@ def sync( start_time: datetime.datetime | Unset = UNSET, end_time: datetime.datetime | Unset = UNSET, limit: int | Unset = 10, + offset: int | Unset = 0, rpc_command_id: int | Unset = UNSET, show_expired: bool | Unset = True, ) -> Error | list[RpcMessage] | None: @@ -179,6 +187,8 @@ def sync( end_time (datetime.datetime | Unset): The end time of the query (only return items on or before this time) limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. rpc_command_id (int | Unset): ID of RPC command show_expired (bool | Unset): Whether to show expired RPC messages Default: True. @@ -198,6 +208,7 @@ def sync( start_time=start_time, end_time=end_time, limit=limit, + offset=offset, rpc_command_id=rpc_command_id, show_expired=show_expired, ).parsed @@ -212,6 +223,7 @@ async def asyncio_detailed( start_time: datetime.datetime | Unset = UNSET, end_time: datetime.datetime | Unset = UNSET, limit: int | Unset = 10, + offset: int | Unset = 0, rpc_command_id: int | Unset = UNSET, show_expired: bool | Unset = True, ) -> Response[Error | list[RpcMessage]]: @@ -227,6 +239,8 @@ async def asyncio_detailed( end_time (datetime.datetime | Unset): The end time of the query (only return items on or before this time) limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. rpc_command_id (int | Unset): ID of RPC command show_expired (bool | Unset): Whether to show expired RPC messages Default: True. @@ -245,6 +259,7 @@ async def asyncio_detailed( start_time=start_time, end_time=end_time, limit=limit, + offset=offset, rpc_command_id=rpc_command_id, show_expired=show_expired, ) @@ -263,6 +278,7 @@ async def asyncio( start_time: datetime.datetime | Unset = UNSET, end_time: datetime.datetime | Unset = UNSET, limit: int | Unset = 10, + offset: int | Unset = 0, rpc_command_id: int | Unset = UNSET, show_expired: bool | Unset = True, ) -> Error | list[RpcMessage] | None: @@ -278,6 +294,8 @@ async def asyncio( end_time (datetime.datetime | Unset): The end time of the query (only return items on or before this time) limit (int | Unset): Maximum number of items to return Default: 10. + offset (int | Unset): Number of items to skip before starting to return results (for + pagination) Default: 0. rpc_command_id (int | Unset): ID of RPC command show_expired (bool | Unset): Whether to show expired RPC messages Default: True. @@ -298,6 +316,7 @@ async def asyncio( start_time=start_time, end_time=end_time, limit=limit, + offset=offset, rpc_command_id=rpc_command_id, show_expired=show_expired, ) diff --git a/src/infuse_iot/api_client/models/__init__.py b/src/infuse_iot/api_client/models/__init__.py index f9efa95..7687be4 100644 --- a/src/infuse_iot/api_client/models/__init__.py +++ b/src/infuse_iot/api_client/models/__init__.py @@ -11,6 +11,10 @@ from .application_release_file_stats import ApplicationReleaseFileStats from .application_release_version import ApplicationReleaseVersion from .application_version import ApplicationVersion +from .appplication_states_by_devices_body import AppplicationStatesByDevicesBody +from .appplication_states_by_devices_response import AppplicationStatesByDevicesResponse +from .appplication_states_by_devices_response_data import AppplicationStatesByDevicesResponseData +from .batch_device_error import BatchDeviceError from .board import Board from .bt_le_route import BtLeRoute from .bt_le_route_type import BtLeRouteType @@ -83,6 +87,13 @@ from .interface_data import InterfaceData from .key import Key from .key_interface import KeyInterface +from .logger_state_for_devices_by_index_update_body import LoggerStateForDevicesByIndexUpdateBody +from .logger_state_for_devices_by_index_update_response import LoggerStateForDevicesByIndexUpdateResponse +from .logger_state_for_devices_by_index_update_response_data import LoggerStateForDevicesByIndexUpdateResponseData +from .logger_state_for_devices_by_index_update_response_errors import LoggerStateForDevicesByIndexUpdateResponseErrors +from .logger_states_for_devices_by_index_body import LoggerStatesForDevicesByIndexBody +from .logger_states_for_devices_by_index_response import LoggerStatesForDevicesByIndexResponse +from .logger_states_for_devices_by_index_response_data import LoggerStatesForDevicesByIndexResponseData from .metadata_field import MetadataField from .network import Network from .new_application import NewApplication @@ -97,6 +108,11 @@ from .new_rpc_message import NewRPCMessage from .new_rpc_req import NewRPCReq from .organisation import Organisation +from .pending_device_application_updates_by_devices_body import PendingDeviceApplicationUpdatesByDevicesBody +from .pending_device_application_updates_by_devices_response import PendingDeviceApplicationUpdatesByDevicesResponse +from .pending_device_application_updates_by_devices_response_data import ( + PendingDeviceApplicationUpdatesByDevicesResponseData, +) from .route_type import RouteType from .rpc_message import RpcMessage from .rpc_params import RPCParams @@ -121,6 +137,10 @@ "ApplicationReleaseFileStats", "ApplicationReleaseVersion", "ApplicationVersion", + "AppplicationStatesByDevicesBody", + "AppplicationStatesByDevicesResponse", + "AppplicationStatesByDevicesResponseData", + "BatchDeviceError", "Board", "BtLeRoute", "BtLeRouteType", @@ -193,6 +213,13 @@ "InterfaceData", "Key", "KeyInterface", + "LoggerStateForDevicesByIndexUpdateBody", + "LoggerStateForDevicesByIndexUpdateResponse", + "LoggerStateForDevicesByIndexUpdateResponseData", + "LoggerStateForDevicesByIndexUpdateResponseErrors", + "LoggerStatesForDevicesByIndexBody", + "LoggerStatesForDevicesByIndexResponse", + "LoggerStatesForDevicesByIndexResponseData", "MetadataField", "Network", "NewApplication", @@ -207,6 +234,9 @@ "NewRPCMessage", "NewRPCReq", "Organisation", + "PendingDeviceApplicationUpdatesByDevicesBody", + "PendingDeviceApplicationUpdatesByDevicesResponse", + "PendingDeviceApplicationUpdatesByDevicesResponseData", "RouteType", "RpcMessage", "RPCParams", diff --git a/src/infuse_iot/api_client/models/appplication_states_by_devices_body.py b/src/infuse_iot/api_client/models/appplication_states_by_devices_body.py new file mode 100644 index 0000000..361697f --- /dev/null +++ b/src/infuse_iot/api_client/models/appplication_states_by_devices_body.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AppplicationStatesByDevicesBody") + + +@_attrs_define +class AppplicationStatesByDevicesBody: + """Body for getting application states for devices by index + + Attributes: + device_ids (list[str]): + """ + + device_ids: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + device_ids = self.device_ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deviceIds": device_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + device_ids = cast(list[str], d.pop("deviceIds")) + + appplication_states_by_devices_body = cls( + device_ids=device_ids, + ) + + appplication_states_by_devices_body.additional_properties = d + return appplication_states_by_devices_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/appplication_states_by_devices_response.py b/src/infuse_iot/api_client/models/appplication_states_by_devices_response.py new file mode 100644 index 0000000..b35462a --- /dev/null +++ b/src/infuse_iot/api_client/models/appplication_states_by_devices_response.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.appplication_states_by_devices_response_data import AppplicationStatesByDevicesResponseData + + +T = TypeVar("T", bound="AppplicationStatesByDevicesResponse") + + +@_attrs_define +class AppplicationStatesByDevicesResponse: + """ + Attributes: + data (AppplicationStatesByDevicesResponseData): Application states keyed by deviceId. + """ + + data: AppplicationStatesByDevicesResponseData + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.appplication_states_by_devices_response_data import AppplicationStatesByDevicesResponseData + + d = dict(src_dict) + data = AppplicationStatesByDevicesResponseData.from_dict(d.pop("data")) + + appplication_states_by_devices_response = cls( + data=data, + ) + + appplication_states_by_devices_response.additional_properties = d + return appplication_states_by_devices_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/appplication_states_by_devices_response_data.py b/src/infuse_iot/api_client/models/appplication_states_by_devices_response_data.py new file mode 100644 index 0000000..dfcd7d6 --- /dev/null +++ b/src/infuse_iot/api_client/models/appplication_states_by_devices_response_data.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.device_application_state import DeviceApplicationState + + +T = TypeVar("T", bound="AppplicationStatesByDevicesResponseData") + + +@_attrs_define +class AppplicationStatesByDevicesResponseData: + """Application states keyed by deviceId.""" + + additional_properties: dict[str, DeviceApplicationState] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.device_application_state import DeviceApplicationState + + d = dict(src_dict) + appplication_states_by_devices_response_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = DeviceApplicationState.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + appplication_states_by_devices_response_data.additional_properties = additional_properties + return appplication_states_by_devices_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> DeviceApplicationState: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: DeviceApplicationState) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/batch_device_error.py b/src/infuse_iot/api_client/models/batch_device_error.py new file mode 100644 index 0000000..f1bbcf4 --- /dev/null +++ b/src/infuse_iot/api_client/models/batch_device_error.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="BatchDeviceError") + + +@_attrs_define +class BatchDeviceError: + """ + Attributes: + code (int): + message (str): + """ + + code: int + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + code = self.code + + message = self.message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "code": code, + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = d.pop("code") + + message = d.pop("message") + + batch_device_error = cls( + code=code, + message=message, + ) + + batch_device_error.additional_properties = d + return batch_device_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_body.py b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_body.py new file mode 100644 index 0000000..8744373 --- /dev/null +++ b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_body.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.device_logger_state_update import DeviceLoggerStateUpdate + + +T = TypeVar("T", bound="LoggerStateForDevicesByIndexUpdateBody") + + +@_attrs_define +class LoggerStateForDevicesByIndexUpdateBody: + """Body for updating logger states for devices by index + + Attributes: + update (DeviceLoggerStateUpdate): + device_ids (list[str]): + """ + + update: DeviceLoggerStateUpdate + device_ids: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + update = self.update.to_dict() + + device_ids = self.device_ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "update": update, + "deviceIds": device_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.device_logger_state_update import DeviceLoggerStateUpdate + + d = dict(src_dict) + update = DeviceLoggerStateUpdate.from_dict(d.pop("update")) + + device_ids = cast(list[str], d.pop("deviceIds")) + + logger_state_for_devices_by_index_update_body = cls( + update=update, + device_ids=device_ids, + ) + + logger_state_for_devices_by_index_update_body.additional_properties = d + return logger_state_for_devices_by_index_update_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response.py b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response.py new file mode 100644 index 0000000..4d02b54 --- /dev/null +++ b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.logger_state_for_devices_by_index_update_response_data import ( + LoggerStateForDevicesByIndexUpdateResponseData, + ) + from ..models.logger_state_for_devices_by_index_update_response_errors import ( + LoggerStateForDevicesByIndexUpdateResponseErrors, + ) + + +T = TypeVar("T", bound="LoggerStateForDevicesByIndexUpdateResponse") + + +@_attrs_define +class LoggerStateForDevicesByIndexUpdateResponse: + """Result of updating logger states for devices by index + + Attributes: + data (LoggerStateForDevicesByIndexUpdateResponseData): Updated logger states keyed by deviceId for devices that + were successfully updated. + errors (LoggerStateForDevicesByIndexUpdateResponseErrors): Errors keyed by deviceId for devices that could not + be updated. + """ + + data: LoggerStateForDevicesByIndexUpdateResponseData + errors: LoggerStateForDevicesByIndexUpdateResponseErrors + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + errors = self.errors.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "errors": errors, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.logger_state_for_devices_by_index_update_response_data import ( + LoggerStateForDevicesByIndexUpdateResponseData, + ) + from ..models.logger_state_for_devices_by_index_update_response_errors import ( + LoggerStateForDevicesByIndexUpdateResponseErrors, + ) + + d = dict(src_dict) + data = LoggerStateForDevicesByIndexUpdateResponseData.from_dict(d.pop("data")) + + errors = LoggerStateForDevicesByIndexUpdateResponseErrors.from_dict(d.pop("errors")) + + logger_state_for_devices_by_index_update_response = cls( + data=data, + errors=errors, + ) + + logger_state_for_devices_by_index_update_response.additional_properties = d + return logger_state_for_devices_by_index_update_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_data.py b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_data.py new file mode 100644 index 0000000..5841a11 --- /dev/null +++ b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_data.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.device_logger_state import DeviceLoggerState + + +T = TypeVar("T", bound="LoggerStateForDevicesByIndexUpdateResponseData") + + +@_attrs_define +class LoggerStateForDevicesByIndexUpdateResponseData: + """Updated logger states keyed by deviceId for devices that were successfully updated.""" + + additional_properties: dict[str, DeviceLoggerState] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.device_logger_state import DeviceLoggerState + + d = dict(src_dict) + logger_state_for_devices_by_index_update_response_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = DeviceLoggerState.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + logger_state_for_devices_by_index_update_response_data.additional_properties = additional_properties + return logger_state_for_devices_by_index_update_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> DeviceLoggerState: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: DeviceLoggerState) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_errors.py b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_errors.py new file mode 100644 index 0000000..2b1939c --- /dev/null +++ b/src/infuse_iot/api_client/models/logger_state_for_devices_by_index_update_response_errors.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.batch_device_error import BatchDeviceError + + +T = TypeVar("T", bound="LoggerStateForDevicesByIndexUpdateResponseErrors") + + +@_attrs_define +class LoggerStateForDevicesByIndexUpdateResponseErrors: + """Errors keyed by deviceId for devices that could not be updated.""" + + additional_properties: dict[str, BatchDeviceError] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.batch_device_error import BatchDeviceError + + d = dict(src_dict) + logger_state_for_devices_by_index_update_response_errors = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = BatchDeviceError.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + logger_state_for_devices_by_index_update_response_errors.additional_properties = additional_properties + return logger_state_for_devices_by_index_update_response_errors + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> BatchDeviceError: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: BatchDeviceError) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_body.py b/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_body.py new file mode 100644 index 0000000..dc3be22 --- /dev/null +++ b/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_body.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LoggerStatesForDevicesByIndexBody") + + +@_attrs_define +class LoggerStatesForDevicesByIndexBody: + """Body for getting logger states for devices by index + + Attributes: + device_ids (list[str]): + """ + + device_ids: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + device_ids = self.device_ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deviceIds": device_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + device_ids = cast(list[str], d.pop("deviceIds")) + + logger_states_for_devices_by_index_body = cls( + device_ids=device_ids, + ) + + logger_states_for_devices_by_index_body.additional_properties = d + return logger_states_for_devices_by_index_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response.py b/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response.py new file mode 100644 index 0000000..d3587a9 --- /dev/null +++ b/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.logger_states_for_devices_by_index_response_data import LoggerStatesForDevicesByIndexResponseData + + +T = TypeVar("T", bound="LoggerStatesForDevicesByIndexResponse") + + +@_attrs_define +class LoggerStatesForDevicesByIndexResponse: + """ + Attributes: + data (LoggerStatesForDevicesByIndexResponseData): Logger states keyed by deviceId. + """ + + data: LoggerStatesForDevicesByIndexResponseData + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.logger_states_for_devices_by_index_response_data import LoggerStatesForDevicesByIndexResponseData + + d = dict(src_dict) + data = LoggerStatesForDevicesByIndexResponseData.from_dict(d.pop("data")) + + logger_states_for_devices_by_index_response = cls( + data=data, + ) + + logger_states_for_devices_by_index_response.additional_properties = d + return logger_states_for_devices_by_index_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response_data.py b/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response_data.py new file mode 100644 index 0000000..8f434a4 --- /dev/null +++ b/src/infuse_iot/api_client/models/logger_states_for_devices_by_index_response_data.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.device_logger_state import DeviceLoggerState + + +T = TypeVar("T", bound="LoggerStatesForDevicesByIndexResponseData") + + +@_attrs_define +class LoggerStatesForDevicesByIndexResponseData: + """Logger states keyed by deviceId.""" + + additional_properties: dict[str, DeviceLoggerState] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.device_logger_state import DeviceLoggerState + + d = dict(src_dict) + logger_states_for_devices_by_index_response_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = DeviceLoggerState.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + logger_states_for_devices_by_index_response_data.additional_properties = additional_properties + return logger_states_for_devices_by_index_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> DeviceLoggerState: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: DeviceLoggerState) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_body.py b/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_body.py new file mode 100644 index 0000000..233d254 --- /dev/null +++ b/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_body.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PendingDeviceApplicationUpdatesByDevicesBody") + + +@_attrs_define +class PendingDeviceApplicationUpdatesByDevicesBody: + """ + Attributes: + device_ids (list[str]): + """ + + device_ids: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + device_ids = self.device_ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deviceIds": device_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + device_ids = cast(list[str], d.pop("deviceIds")) + + pending_device_application_updates_by_devices_body = cls( + device_ids=device_ids, + ) + + pending_device_application_updates_by_devices_body.additional_properties = d + return pending_device_application_updates_by_devices_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response.py b/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response.py new file mode 100644 index 0000000..e136b1b --- /dev/null +++ b/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.pending_device_application_updates_by_devices_response_data import ( + PendingDeviceApplicationUpdatesByDevicesResponseData, + ) + + +T = TypeVar("T", bound="PendingDeviceApplicationUpdatesByDevicesResponse") + + +@_attrs_define +class PendingDeviceApplicationUpdatesByDevicesResponse: + """ + Attributes: + data (PendingDeviceApplicationUpdatesByDevicesResponseData): Pending device application updates keyed by + deviceId. + """ + + data: PendingDeviceApplicationUpdatesByDevicesResponseData + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pending_device_application_updates_by_devices_response_data import ( + PendingDeviceApplicationUpdatesByDevicesResponseData, + ) + + d = dict(src_dict) + data = PendingDeviceApplicationUpdatesByDevicesResponseData.from_dict(d.pop("data")) + + pending_device_application_updates_by_devices_response = cls( + data=data, + ) + + pending_device_application_updates_by_devices_response.additional_properties = d + return pending_device_application_updates_by_devices_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response_data.py b/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response_data.py new file mode 100644 index 0000000..bfc7646 --- /dev/null +++ b/src/infuse_iot/api_client/models/pending_device_application_updates_by_devices_response_data.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.device_application_update_and_message import DeviceApplicationUpdateAndMessage + + +T = TypeVar("T", bound="PendingDeviceApplicationUpdatesByDevicesResponseData") + + +@_attrs_define +class PendingDeviceApplicationUpdatesByDevicesResponseData: + """Pending device application updates keyed by deviceId.""" + + additional_properties: dict[str, DeviceApplicationUpdateAndMessage] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.device_application_update_and_message import DeviceApplicationUpdateAndMessage + + d = dict(src_dict) + pending_device_application_updates_by_devices_response_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = DeviceApplicationUpdateAndMessage.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + pending_device_application_updates_by_devices_response_data.additional_properties = additional_properties + return pending_device_application_updates_by_devices_response_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> DeviceApplicationUpdateAndMessage: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: DeviceApplicationUpdateAndMessage) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties