From 1ed26d8f90a5340136db58c26db732bbb3f0e878 Mon Sep 17 00:00:00 2001 From: nuonbot Date: Thu, 18 Jun 2026 18:49:46 +0000 Subject: [PATCH] ci: generate from api 0.19.1012 --- nuon/api/apps/get_app_branch_run_builds.py | 222 +++++++++++++++++ .../apps/get_app_branch_run_install_groups.py | 222 +++++++++++++++++ nuon/api/apps/get_app_config_diff.py | 224 +++++++++++++++++ nuon/api/apps/get_install_group_run.py | 231 +++++++++++++++++ nuon/api/apps/get_install_group_runs.py | 222 +++++++++++++++++ .../components/cancel_app_component_build.py | 221 +++++++++++++++++ .../create_install_app_config_update.py | 210 ++++++++++++++++ ...ate_vcs_connection_webhook_subscription.py | 191 ++++++++++++++ ...get_vcs_connection_webhook_subscription.py | 189 ++++++++++++++ nuon/api/vcs/write_vcs_event.py | 32 +-- nuon/api/vcs/write_webhook_event.py | 184 ++++++++++++++ nuon/models/__init__.py | 34 ++- nuon/models/app_app_branch_install_group.py | 51 ++-- nuon/models/app_app_branch_run.py | 72 ++++++ nuon/models/app_component_build.py | 9 + .../{app_vcs_event.py => app_github_event.py} | 40 +-- nuon/models/app_install_config_update.py | 209 ++++++++++++++++ nuon/models/app_install_deploy.py | 18 ++ nuon/models/app_install_group_run.py | 232 ++++++++++++++++++ nuon/models/app_install_group_run_install.py | 79 ++++++ nuon/models/app_vcs_webhook_subscription.py | 146 +++++++++++ nuon/models/app_workflow_type.py | 1 + .../compositeerrors_composite_error_data.py | 125 ++++++++++ ..._payload.py => compositeerrors_section.py} | 37 ++- nuon/models/compositeerrors_severity.py | 11 + nuon/models/diff_diff.py | 104 ++++++++ nuon/models/diff_diff_key.py | 78 ++++++ nuon/models/diff_diff_summary.py | 97 ++++++++ nuon/models/diff_op.py | 12 + ...hub_com_nuonco_nuon_pkg_labels_selector.py | 90 +++++++ .../service_app_config_diff_response.py | 119 +++++++++ .../service_create_app_config_request.py | 19 ++ ...reate_install_app_config_update_request.py | 72 ++++++ nuon/models/service_install_group_request.py | 52 ++-- .../service_trigger_app_branch_run_request.py | 9 + pyproject.toml | 2 +- version.txt | 2 +- 37 files changed, 3776 insertions(+), 92 deletions(-) create mode 100644 nuon/api/apps/get_app_branch_run_builds.py create mode 100644 nuon/api/apps/get_app_branch_run_install_groups.py create mode 100644 nuon/api/apps/get_app_config_diff.py create mode 100644 nuon/api/apps/get_install_group_run.py create mode 100644 nuon/api/apps/get_install_group_runs.py create mode 100644 nuon/api/components/cancel_app_component_build.py create mode 100644 nuon/api/installs/create_install_app_config_update.py create mode 100644 nuon/api/vcs/create_vcs_connection_webhook_subscription.py create mode 100644 nuon/api/vcs/get_vcs_connection_webhook_subscription.py create mode 100644 nuon/api/vcs/write_webhook_event.py rename nuon/models/{app_vcs_event.py => app_github_event.py} (80%) create mode 100644 nuon/models/app_install_config_update.py create mode 100644 nuon/models/app_install_group_run.py create mode 100644 nuon/models/app_install_group_run_install.py create mode 100644 nuon/models/app_vcs_webhook_subscription.py create mode 100644 nuon/models/compositeerrors_composite_error_data.py rename nuon/models/{app_vcs_event_payload.py => compositeerrors_section.py} (57%) create mode 100644 nuon/models/compositeerrors_severity.py create mode 100644 nuon/models/diff_diff.py create mode 100644 nuon/models/diff_diff_key.py create mode 100644 nuon/models/diff_diff_summary.py create mode 100644 nuon/models/diff_op.py create mode 100644 nuon/models/github_com_nuonco_nuon_pkg_labels_selector.py create mode 100644 nuon/models/service_app_config_diff_response.py create mode 100644 nuon/models/service_create_install_app_config_update_request.py diff --git a/nuon/api/apps/get_app_branch_run_builds.py b/nuon/api/apps/get_app_branch_run_builds.py new file mode 100644 index 00000000..82993667 --- /dev/null +++ b/nuon/api/apps/get_app_branch_run_builds.py @@ -0,0 +1,222 @@ +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.app_component_build import AppComponentBuild +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + app_branch_id: str, + run_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/apps/{app_id}/branches/{app_branch_id}/runs/{run_id}/builds".format( + app_id=quote(str(app_id), safe=""), + app_branch_id=quote(str(app_branch_id), safe=""), + run_id=quote(str(run_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StderrErrResponse | list[AppComponentBuild] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppComponentBuild.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[StderrErrResponse | list[AppComponentBuild]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppComponentBuild]]: + """get builds for an app branch run + + Returns component builds triggered by a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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[StderrErrResponse | list[AppComponentBuild]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppComponentBuild] | None: + """get builds for an app branch run + + Returns component builds triggered by a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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: + StderrErrResponse | list[AppComponentBuild] + """ + + return sync_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppComponentBuild]]: + """get builds for an app branch run + + Returns component builds triggered by a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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[StderrErrResponse | list[AppComponentBuild]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppComponentBuild] | None: + """get builds for an app branch run + + Returns component builds triggered by a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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: + StderrErrResponse | list[AppComponentBuild] + """ + + return ( + await asyncio_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + client=client, + ) + ).parsed diff --git a/nuon/api/apps/get_app_branch_run_install_groups.py b/nuon/api/apps/get_app_branch_run_install_groups.py new file mode 100644 index 00000000..096e937d --- /dev/null +++ b/nuon/api/apps/get_app_branch_run_install_groups.py @@ -0,0 +1,222 @@ +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.app_install_config_update import AppInstallConfigUpdate +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + app_branch_id: str, + run_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/apps/{app_id}/branches/{app_branch_id}/runs/{run_id}/install-groups".format( + app_id=quote(str(app_id), safe=""), + app_branch_id=quote(str(app_branch_id), safe=""), + run_id=quote(str(run_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StderrErrResponse | list[AppInstallConfigUpdate] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppInstallConfigUpdate.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[StderrErrResponse | list[AppInstallConfigUpdate]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppInstallConfigUpdate]]: + """get install group deployments for an app branch run + + Returns install config updates triggered by a specific app branch run, grouped by install group + + Args: + app_id (str): + app_branch_id (str): + run_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[StderrErrResponse | list[AppInstallConfigUpdate]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppInstallConfigUpdate] | None: + """get install group deployments for an app branch run + + Returns install config updates triggered by a specific app branch run, grouped by install group + + Args: + app_id (str): + app_branch_id (str): + run_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: + StderrErrResponse | list[AppInstallConfigUpdate] + """ + + return sync_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppInstallConfigUpdate]]: + """get install group deployments for an app branch run + + Returns install config updates triggered by a specific app branch run, grouped by install group + + Args: + app_id (str): + app_branch_id (str): + run_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[StderrErrResponse | list[AppInstallConfigUpdate]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppInstallConfigUpdate] | None: + """get install group deployments for an app branch run + + Returns install config updates triggered by a specific app branch run, grouped by install group + + Args: + app_id (str): + app_branch_id (str): + run_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: + StderrErrResponse | list[AppInstallConfigUpdate] + """ + + return ( + await asyncio_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + client=client, + ) + ).parsed diff --git a/nuon/api/apps/get_app_config_diff.py b/nuon/api/apps/get_app_config_diff.py new file mode 100644 index 00000000..6d015f49 --- /dev/null +++ b/nuon/api/apps/get_app_config_diff.py @@ -0,0 +1,224 @@ +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.service_app_config_diff_response import ServiceAppConfigDiffResponse +from ...models.stderr_err_response import StderrErrResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + app_id: str, + config_id: str, + *, + old_config_id: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["old_config_id"] = old_config_id + + 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": "/v1/apps/{app_id}/configs/{config_id}/diff".format( + app_id=quote(str(app_id), safe=""), + config_id=quote(str(config_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceAppConfigDiffResponse | StderrErrResponse | None: + if response.status_code == 200: + response_200 = ServiceAppConfigDiffResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[ServiceAppConfigDiffResponse | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, + old_config_id: str | Unset = UNSET, +) -> Response[ServiceAppConfigDiffResponse | StderrErrResponse]: + """diff two app configs + + Compares a new app config against an old one and returns a hierarchical diff. + + Args: + app_id (str): + config_id (str): + old_config_id (str | Unset): + + 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[ServiceAppConfigDiffResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + config_id=config_id, + old_config_id=old_config_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, + old_config_id: str | Unset = UNSET, +) -> ServiceAppConfigDiffResponse | StderrErrResponse | None: + """diff two app configs + + Compares a new app config against an old one and returns a hierarchical diff. + + Args: + app_id (str): + config_id (str): + old_config_id (str | Unset): + + 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: + ServiceAppConfigDiffResponse | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + config_id=config_id, + client=client, + old_config_id=old_config_id, + ).parsed + + +async def asyncio_detailed( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, + old_config_id: str | Unset = UNSET, +) -> Response[ServiceAppConfigDiffResponse | StderrErrResponse]: + """diff two app configs + + Compares a new app config against an old one and returns a hierarchical diff. + + Args: + app_id (str): + config_id (str): + old_config_id (str | Unset): + + 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[ServiceAppConfigDiffResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + config_id=config_id, + old_config_id=old_config_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, + old_config_id: str | Unset = UNSET, +) -> ServiceAppConfigDiffResponse | StderrErrResponse | None: + """diff two app configs + + Compares a new app config against an old one and returns a hierarchical diff. + + Args: + app_id (str): + config_id (str): + old_config_id (str | Unset): + + 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: + ServiceAppConfigDiffResponse | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + config_id=config_id, + client=client, + old_config_id=old_config_id, + ) + ).parsed diff --git a/nuon/api/apps/get_install_group_run.py b/nuon/api/apps/get_install_group_run.py new file mode 100644 index 00000000..a189db14 --- /dev/null +++ b/nuon/api/apps/get_install_group_run.py @@ -0,0 +1,231 @@ +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.app_install_group_run import AppInstallGroupRun +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + app_branch_id: str, + run_id: str, + install_group_run_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/apps/{app_id}/branches/{app_branch_id}/runs/{run_id}/install-group-runs/{install_group_run_id}".format( + app_id=quote(str(app_id), safe=""), + app_branch_id=quote(str(app_branch_id), safe=""), + run_id=quote(str(run_id), safe=""), + install_group_run_id=quote(str(install_group_run_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppInstallGroupRun | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppInstallGroupRun.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[AppInstallGroupRun | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + install_group_run_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppInstallGroupRun | StderrErrResponse]: + """get a specific install group run + + Returns a single install group run with full details + + Args: + app_id (str): + app_branch_id (str): + run_id (str): + install_group_run_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[AppInstallGroupRun | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + install_group_run_id=install_group_run_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + app_branch_id: str, + run_id: str, + install_group_run_id: str, + *, + client: AuthenticatedClient, +) -> AppInstallGroupRun | StderrErrResponse | None: + """get a specific install group run + + Returns a single install group run with full details + + Args: + app_id (str): + app_branch_id (str): + run_id (str): + install_group_run_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: + AppInstallGroupRun | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + install_group_run_id=install_group_run_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + install_group_run_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppInstallGroupRun | StderrErrResponse]: + """get a specific install group run + + Returns a single install group run with full details + + Args: + app_id (str): + app_branch_id (str): + run_id (str): + install_group_run_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[AppInstallGroupRun | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + install_group_run_id=install_group_run_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + app_branch_id: str, + run_id: str, + install_group_run_id: str, + *, + client: AuthenticatedClient, +) -> AppInstallGroupRun | StderrErrResponse | None: + """get a specific install group run + + Returns a single install group run with full details + + Args: + app_id (str): + app_branch_id (str): + run_id (str): + install_group_run_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: + AppInstallGroupRun | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + install_group_run_id=install_group_run_id, + client=client, + ) + ).parsed diff --git a/nuon/api/apps/get_install_group_runs.py b/nuon/api/apps/get_install_group_runs.py new file mode 100644 index 00000000..02233551 --- /dev/null +++ b/nuon/api/apps/get_install_group_runs.py @@ -0,0 +1,222 @@ +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.app_install_group_run import AppInstallGroupRun +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + app_branch_id: str, + run_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/apps/{app_id}/branches/{app_branch_id}/runs/{run_id}/install-group-runs".format( + app_id=quote(str(app_id), safe=""), + app_branch_id=quote(str(app_branch_id), safe=""), + run_id=quote(str(run_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StderrErrResponse | list[AppInstallGroupRun] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppInstallGroupRun.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[StderrErrResponse | list[AppInstallGroupRun]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppInstallGroupRun]]: + """list install group runs for an app branch run + + Returns all install group runs for a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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[StderrErrResponse | list[AppInstallGroupRun]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppInstallGroupRun] | None: + """list install group runs for an app branch run + + Returns all install group runs for a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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: + StderrErrResponse | list[AppInstallGroupRun] + """ + + return sync_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppInstallGroupRun]]: + """list install group runs for an app branch run + + Returns all install group runs for a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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[StderrErrResponse | list[AppInstallGroupRun]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + app_branch_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppInstallGroupRun] | None: + """list install group runs for an app branch run + + Returns all install group runs for a specific app branch run + + Args: + app_id (str): + app_branch_id (str): + run_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: + StderrErrResponse | list[AppInstallGroupRun] + """ + + return ( + await asyncio_detailed( + app_id=app_id, + app_branch_id=app_branch_id, + run_id=run_id, + client=client, + ) + ).parsed diff --git a/nuon/api/components/cancel_app_component_build.py b/nuon/api/components/cancel_app_component_build.py new file mode 100644 index 00000000..30468695 --- /dev/null +++ b/nuon/api/components/cancel_app_component_build.py @@ -0,0 +1,221 @@ +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.app_component_build import AppComponentBuild +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + component_id: str, + build_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/apps/{app_id}/components/{component_id}/builds/{build_id}/cancel".format( + app_id=quote(str(app_id), safe=""), + component_id=quote(str(component_id), safe=""), + build_id=quote(str(build_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppComponentBuild | StderrErrResponse | None: + if response.status_code == 202: + response_202 = AppComponentBuild.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[AppComponentBuild | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + component_id: str, + build_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppComponentBuild | StderrErrResponse]: + """cancel component build + + Cancel a component build by cancelling its queue signal. If the build has an in-flight runner job, + it will also be cancelled. + + Args: + app_id (str): + component_id (str): + build_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[AppComponentBuild | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + component_id=component_id, + build_id=build_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + component_id: str, + build_id: str, + *, + client: AuthenticatedClient, +) -> AppComponentBuild | StderrErrResponse | None: + """cancel component build + + Cancel a component build by cancelling its queue signal. If the build has an in-flight runner job, + it will also be cancelled. + + Args: + app_id (str): + component_id (str): + build_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: + AppComponentBuild | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + component_id=component_id, + build_id=build_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + component_id: str, + build_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppComponentBuild | StderrErrResponse]: + """cancel component build + + Cancel a component build by cancelling its queue signal. If the build has an in-flight runner job, + it will also be cancelled. + + Args: + app_id (str): + component_id (str): + build_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[AppComponentBuild | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + component_id=component_id, + build_id=build_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + component_id: str, + build_id: str, + *, + client: AuthenticatedClient, +) -> AppComponentBuild | StderrErrResponse | None: + """cancel component build + + Cancel a component build by cancelling its queue signal. If the build has an in-flight runner job, + it will also be cancelled. + + Args: + app_id (str): + component_id (str): + build_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: + AppComponentBuild | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + component_id=component_id, + build_id=build_id, + client=client, + ) + ).parsed diff --git a/nuon/api/installs/create_install_app_config_update.py b/nuon/api/installs/create_install_app_config_update.py new file mode 100644 index 00000000..d1b23638 --- /dev/null +++ b/nuon/api/installs/create_install_app_config_update.py @@ -0,0 +1,210 @@ +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.app_install_config_update import AppInstallConfigUpdate +from ...models.service_create_install_app_config_update_request import ServiceCreateInstallAppConfigUpdateRequest +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + install_id: str, + *, + body: ServiceCreateInstallAppConfigUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/installs/{install_id}/app-config-updates".format( + install_id=quote(str(install_id), 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 +) -> AppInstallConfigUpdate | StderrErrResponse | None: + if response.status_code == 201: + response_201 = AppInstallConfigUpdate.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[AppInstallConfigUpdate | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateInstallAppConfigUpdateRequest, +) -> Response[AppInstallConfigUpdate | StderrErrResponse]: + """trigger an app config update for an install + + Creates a workflow to diff and deploy a new app config to an install. + + Args: + install_id (str): + body (ServiceCreateInstallAppConfigUpdateRequest): + + 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[AppInstallConfigUpdate | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateInstallAppConfigUpdateRequest, +) -> AppInstallConfigUpdate | StderrErrResponse | None: + """trigger an app config update for an install + + Creates a workflow to diff and deploy a new app config to an install. + + Args: + install_id (str): + body (ServiceCreateInstallAppConfigUpdateRequest): + + 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: + AppInstallConfigUpdate | StderrErrResponse + """ + + return sync_detailed( + install_id=install_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateInstallAppConfigUpdateRequest, +) -> Response[AppInstallConfigUpdate | StderrErrResponse]: + """trigger an app config update for an install + + Creates a workflow to diff and deploy a new app config to an install. + + Args: + install_id (str): + body (ServiceCreateInstallAppConfigUpdateRequest): + + 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[AppInstallConfigUpdate | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateInstallAppConfigUpdateRequest, +) -> AppInstallConfigUpdate | StderrErrResponse | None: + """trigger an app config update for an install + + Creates a workflow to diff and deploy a new app config to an install. + + Args: + install_id (str): + body (ServiceCreateInstallAppConfigUpdateRequest): + + 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: + AppInstallConfigUpdate | StderrErrResponse + """ + + return ( + await asyncio_detailed( + install_id=install_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/vcs/create_vcs_connection_webhook_subscription.py b/nuon/api/vcs/create_vcs_connection_webhook_subscription.py new file mode 100644 index 00000000..27d8c183 --- /dev/null +++ b/nuon/api/vcs/create_vcs_connection_webhook_subscription.py @@ -0,0 +1,191 @@ +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.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + connection_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/vcs/connections/{connection_id}/webhook-subscription".format( + connection_id=quote(str(connection_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | StderrErrResponse | None: + if response.status_code == 201: + response_201 = cast(Any, None) + return response_201 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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 | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + connection_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any | StderrErrResponse]: + """creates a webhook subscription for a vcs connection + + Creates a webhook subscription for a VCS connection. This enqueues a signal that will register a + GitHub webhook for receiving push and pull request events. + + Args: + connection_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 | StderrErrResponse] + """ + + kwargs = _get_kwargs( + connection_id=connection_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + connection_id: str, + *, + client: AuthenticatedClient, +) -> Any | StderrErrResponse | None: + """creates a webhook subscription for a vcs connection + + Creates a webhook subscription for a VCS connection. This enqueues a signal that will register a + GitHub webhook for receiving push and pull request events. + + Args: + connection_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 | StderrErrResponse + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + ).parsed + + +async def asyncio_detailed( + connection_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any | StderrErrResponse]: + """creates a webhook subscription for a vcs connection + + Creates a webhook subscription for a VCS connection. This enqueues a signal that will register a + GitHub webhook for receiving push and pull request events. + + Args: + connection_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 | StderrErrResponse] + """ + + kwargs = _get_kwargs( + connection_id=connection_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + connection_id: str, + *, + client: AuthenticatedClient, +) -> Any | StderrErrResponse | None: + """creates a webhook subscription for a vcs connection + + Creates a webhook subscription for a VCS connection. This enqueues a signal that will register a + GitHub webhook for receiving push and pull request events. + + Args: + connection_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 | StderrErrResponse + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + ) + ).parsed diff --git a/nuon/api/vcs/get_vcs_connection_webhook_subscription.py b/nuon/api/vcs/get_vcs_connection_webhook_subscription.py new file mode 100644 index 00000000..4cd639df --- /dev/null +++ b/nuon/api/vcs/get_vcs_connection_webhook_subscription.py @@ -0,0 +1,189 @@ +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.app_vcs_webhook_subscription import AppVCSWebhookSubscription +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + connection_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/vcs/connections/{connection_id}/webhook-subscription".format( + connection_id=quote(str(connection_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppVCSWebhookSubscription | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppVCSWebhookSubscription.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[AppVCSWebhookSubscription | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + connection_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppVCSWebhookSubscription | StderrErrResponse]: + """returns the webhook subscription for a vcs connection + + Returns the webhook subscription associated with a VCS connection. + + Args: + connection_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[AppVCSWebhookSubscription | StderrErrResponse] + """ + + kwargs = _get_kwargs( + connection_id=connection_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + connection_id: str, + *, + client: AuthenticatedClient, +) -> AppVCSWebhookSubscription | StderrErrResponse | None: + """returns the webhook subscription for a vcs connection + + Returns the webhook subscription associated with a VCS connection. + + Args: + connection_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: + AppVCSWebhookSubscription | StderrErrResponse + """ + + return sync_detailed( + connection_id=connection_id, + client=client, + ).parsed + + +async def asyncio_detailed( + connection_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppVCSWebhookSubscription | StderrErrResponse]: + """returns the webhook subscription for a vcs connection + + Returns the webhook subscription associated with a VCS connection. + + Args: + connection_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[AppVCSWebhookSubscription | StderrErrResponse] + """ + + kwargs = _get_kwargs( + connection_id=connection_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + connection_id: str, + *, + client: AuthenticatedClient, +) -> AppVCSWebhookSubscription | StderrErrResponse | None: + """returns the webhook subscription for a vcs connection + + Returns the webhook subscription associated with a VCS connection. + + Args: + connection_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: + AppVCSWebhookSubscription | StderrErrResponse + """ + + return ( + await asyncio_detailed( + connection_id=connection_id, + client=client, + ) + ).parsed diff --git a/nuon/api/vcs/write_vcs_event.py b/nuon/api/vcs/write_vcs_event.py index fd0b2bc8..131815e8 100644 --- a/nuon/api/vcs/write_vcs_event.py +++ b/nuon/api/vcs/write_vcs_event.py @@ -6,7 +6,7 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.app_vcs_event import AppVCSEvent +from ...models.app_github_event import AppGithubEvent from ...models.stderr_err_response import StderrErrResponse from ...types import Response @@ -27,9 +27,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AppVCSEvent | StderrErrResponse | None: +) -> AppGithubEvent | StderrErrResponse | None: if response.status_code == 200: - response_200 = AppVCSEvent.from_dict(response.json()) + response_200 = AppGithubEvent.from_dict(response.json()) return response_200 @@ -56,7 +56,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AppVCSEvent | StderrErrResponse]: +) -> Response[AppGithubEvent | StderrErrResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,10 +69,10 @@ def sync_detailed( vcs_connection_id: str, *, client: AuthenticatedClient | Client, -) -> Response[AppVCSEvent | StderrErrResponse]: +) -> Response[AppGithubEvent | StderrErrResponse]: """Write a VCS webhook event - Writes incoming webhook events for a VCS connection + Writes incoming webhook events for a VCS connection (legacy endpoint) Args: vcs_connection_id (str): @@ -82,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AppVCSEvent | StderrErrResponse] + Response[AppGithubEvent | StderrErrResponse] """ kwargs = _get_kwargs( @@ -100,10 +100,10 @@ def sync( vcs_connection_id: str, *, client: AuthenticatedClient | Client, -) -> AppVCSEvent | StderrErrResponse | None: +) -> AppGithubEvent | StderrErrResponse | None: """Write a VCS webhook event - Writes incoming webhook events for a VCS connection + Writes incoming webhook events for a VCS connection (legacy endpoint) Args: vcs_connection_id (str): @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AppVCSEvent | StderrErrResponse + AppGithubEvent | StderrErrResponse """ return sync_detailed( @@ -126,10 +126,10 @@ async def asyncio_detailed( vcs_connection_id: str, *, client: AuthenticatedClient | Client, -) -> Response[AppVCSEvent | StderrErrResponse]: +) -> Response[AppGithubEvent | StderrErrResponse]: """Write a VCS webhook event - Writes incoming webhook events for a VCS connection + Writes incoming webhook events for a VCS connection (legacy endpoint) Args: vcs_connection_id (str): @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AppVCSEvent | StderrErrResponse] + Response[AppGithubEvent | StderrErrResponse] """ kwargs = _get_kwargs( @@ -155,10 +155,10 @@ async def asyncio( vcs_connection_id: str, *, client: AuthenticatedClient | Client, -) -> AppVCSEvent | StderrErrResponse | None: +) -> AppGithubEvent | StderrErrResponse | None: """Write a VCS webhook event - Writes incoming webhook events for a VCS connection + Writes incoming webhook events for a VCS connection (legacy endpoint) Args: vcs_connection_id (str): @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AppVCSEvent | StderrErrResponse + AppGithubEvent | StderrErrResponse """ return ( diff --git a/nuon/api/vcs/write_webhook_event.py b/nuon/api/vcs/write_webhook_event.py new file mode 100644 index 00000000..ae6c8d19 --- /dev/null +++ b/nuon/api/vcs/write_webhook_event.py @@ -0,0 +1,184 @@ +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.app_github_event import AppGithubEvent +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + subscription_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/vcs/webhooks/{subscription_id}/events".format( + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppGithubEvent | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppGithubEvent.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.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[AppGithubEvent | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + subscription_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[AppGithubEvent | StderrErrResponse]: + """Write a VCS webhook event (shared per subscription) + + Receives webhook events for a webhook subscription and creates a GithubEvent for processing + + Args: + subscription_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[AppGithubEvent | StderrErrResponse] + """ + + kwargs = _get_kwargs( + subscription_id=subscription_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + subscription_id: str, + *, + client: AuthenticatedClient | Client, +) -> AppGithubEvent | StderrErrResponse | None: + """Write a VCS webhook event (shared per subscription) + + Receives webhook events for a webhook subscription and creates a GithubEvent for processing + + Args: + subscription_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: + AppGithubEvent | StderrErrResponse + """ + + return sync_detailed( + subscription_id=subscription_id, + client=client, + ).parsed + + +async def asyncio_detailed( + subscription_id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[AppGithubEvent | StderrErrResponse]: + """Write a VCS webhook event (shared per subscription) + + Receives webhook events for a webhook subscription and creates a GithubEvent for processing + + Args: + subscription_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[AppGithubEvent | StderrErrResponse] + """ + + kwargs = _get_kwargs( + subscription_id=subscription_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + subscription_id: str, + *, + client: AuthenticatedClient | Client, +) -> AppGithubEvent | StderrErrResponse | None: + """Write a VCS webhook event (shared per subscription) + + Receives webhook events for a webhook subscription and creates a GithubEvent for processing + + Args: + subscription_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: + AppGithubEvent | StderrErrResponse + """ + + return ( + await asyncio_detailed( + subscription_id=subscription_id, + client=client, + ) + ).parsed diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index 3c4fbbb8..aab7d029 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -80,6 +80,7 @@ from .app_gcp_stack_outputs_custom_sa_emails import AppGCPStackOutputsCustomSaEmails from .app_gcp_stack_outputs_install_inputs import AppGCPStackOutputsInstallInputs from .app_gcpgar_image_config import AppGCPGARImageConfig +from .app_github_event import AppGithubEvent from .app_helm_chart import AppHelmChart from .app_helm_component_config import AppHelmComponentConfig from .app_helm_component_config_values import AppHelmComponentConfigValues @@ -101,11 +102,14 @@ from .app_install_component_links import AppInstallComponentLinks from .app_install_component_statuses import AppInstallComponentStatuses from .app_install_config import AppInstallConfig +from .app_install_config_update import AppInstallConfigUpdate from .app_install_deploy import AppInstallDeploy from .app_install_deploy_outputs import AppInstallDeployOutputs from .app_install_deploy_type import AppInstallDeployType from .app_install_event import AppInstallEvent from .app_install_event_payload import AppInstallEventPayload +from .app_install_group_run import AppInstallGroupRun +from .app_install_group_run_install import AppInstallGroupRunInstall from .app_install_inputs import AppInstallInputs from .app_install_inputs_redacted_values import AppInstallInputsRedactedValues from .app_install_inputs_values import AppInstallInputsValues @@ -248,8 +252,7 @@ from .app_user_journey_step_metadata import AppUserJourneyStepMetadata from .app_vcs_connection import AppVCSConnection from .app_vcs_connection_commit import AppVCSConnectionCommit -from .app_vcs_event import AppVCSEvent -from .app_vcs_event_payload import AppVCSEventPayload +from .app_vcs_webhook_subscription import AppVCSWebhookSubscription from .app_waitlist import AppWaitlist from .app_workflow import AppWorkflow from .app_workflow_links import AppWorkflowLinks @@ -272,6 +275,9 @@ from .callback_ref import CallbackRef from .cctx_signal_context import CctxSignalContext from .client_conversation import ClientConversation +from .compositeerrors_composite_error_data import CompositeerrorsCompositeErrorData +from .compositeerrors_section import CompositeerrorsSection +from .compositeerrors_severity import CompositeerrorsSeverity from .config_app_policy_engine import ConfigAppPolicyEngine from .config_app_policy_type import ConfigAppPolicyType from .config_custom_nested_stack import ConfigCustomNestedStack @@ -284,6 +290,10 @@ from .credentials_assume_role_config import CredentialsAssumeRoleConfig from .credentials_service_principal_credentials import CredentialsServicePrincipalCredentials from .credentials_static_credentials import CredentialsStaticCredentials +from .diff_diff import DiffDiff +from .diff_diff_key import DiffDiffKey +from .diff_diff_summary import DiffDiffSummary +from .diff_op import DiffOp from .generics_null_time import GenericsNullTime from .get_action_label_keys_response_200 import GetActionLabelKeysResponse200 from .get_app_config_template_type import GetAppConfigTemplateType @@ -302,6 +312,7 @@ from .github_com_nuonco_nuon_pkg_azure_credentials_config import GithubComNuoncoNuonPkgAzureCredentialsConfig from .github_com_nuonco_nuon_pkg_gcp_credentials_config import GithubComNuoncoNuonPkgGcpCredentialsConfig from .github_com_nuonco_nuon_pkg_labels_labels import GithubComNuoncoNuonPkgLabelsLabels +from .github_com_nuonco_nuon_pkg_labels_selector import GithubComNuoncoNuonPkgLabelsSelector from .github_com_nuonco_nuon_pkg_types_state_state import GithubComNuoncoNuonPkgTypesStateState from .github_com_nuonco_nuon_pkg_types_state_state_components import GithubComNuoncoNuonPkgTypesStateStateComponents from .github_com_nuonco_nuon_pkg_types_state_state_labels import GithubComNuoncoNuonPkgTypesStateStateLabels @@ -394,6 +405,7 @@ from .service_app_awsiam_policy_config import ServiceAppAWSIAMPolicyConfig from .service_app_awsiam_role_config import ServiceAppAWSIAMRoleConfig from .service_app_awsiam_role_config_cloud_platform import ServiceAppAWSIAMRoleConfigCloudPlatform +from .service_app_config_diff_response import ServiceAppConfigDiffResponse from .service_app_config_template import ServiceAppConfigTemplate from .service_app_config_template_type import ServiceAppConfigTemplateType from .service_app_group_request import ServiceAppGroupRequest @@ -497,6 +509,7 @@ from .service_create_install_action_workflow_run_request_run_env_vars import ( ServiceCreateInstallActionWorkflowRunRequestRunEnvVars, ) +from .service_create_install_app_config_update_request import ServiceCreateInstallAppConfigUpdateRequest from .service_create_install_component_deploy_request import ServiceCreateInstallComponentDeployRequest from .service_create_install_config_request import ServiceCreateInstallConfigRequest from .service_create_install_config_request_labels import ServiceCreateInstallConfigRequestLabels @@ -784,6 +797,7 @@ "AppGCPStackOutputsBreakGlassSaEmails", "AppGCPStackOutputsCustomSaEmails", "AppGCPStackOutputsInstallInputs", + "AppGithubEvent", "AppHelmChart", "AppHelmComponentConfig", "AppHelmComponentConfigValues", @@ -805,11 +819,14 @@ "AppInstallComponentLinks", "AppInstallComponentStatuses", "AppInstallConfig", + "AppInstallConfigUpdate", "AppInstallDeploy", "AppInstallDeployOutputs", "AppInstallDeployType", "AppInstallEvent", "AppInstallEventPayload", + "AppInstallGroupRun", + "AppInstallGroupRunInstall", "AppInstallInputs", "AppInstallInputsRedactedValues", "AppInstallInputsValues", @@ -950,8 +967,7 @@ "AppUserJourneyStepMetadata", "AppVCSConnection", "AppVCSConnectionCommit", - "AppVCSEvent", - "AppVCSEventPayload", + "AppVCSWebhookSubscription", "AppWaitlist", "AppWorkflow", "AppWorkflowLinks", @@ -974,6 +990,9 @@ "CallbackRef", "CctxSignalContext", "ClientConversation", + "CompositeerrorsCompositeErrorData", + "CompositeerrorsSection", + "CompositeerrorsSeverity", "ConfigAppPolicyEngine", "ConfigAppPolicyType", "ConfigCustomNestedStack", @@ -986,6 +1005,10 @@ "CredentialsAssumeRoleConfig", "CredentialsServicePrincipalCredentials", "CredentialsStaticCredentials", + "DiffDiff", + "DiffDiffKey", + "DiffDiffSummary", + "DiffOp", "GenericsNullTime", "GetActionLabelKeysResponse200", "GetAppConfigTemplateType", @@ -1004,6 +1027,7 @@ "GithubComNuoncoNuonPkgAzureCredentialsConfig", "GithubComNuoncoNuonPkgGcpCredentialsConfig", "GithubComNuoncoNuonPkgLabelsLabels", + "GithubComNuoncoNuonPkgLabelsSelector", "GithubComNuoncoNuonPkgTypesStateState", "GithubComNuoncoNuonPkgTypesStateStateComponents", "GithubComNuoncoNuonPkgTypesStateStateLabels", @@ -1094,6 +1118,7 @@ "ServiceAppAWSIAMPolicyConfig", "ServiceAppAWSIAMRoleConfig", "ServiceAppAWSIAMRoleConfigCloudPlatform", + "ServiceAppConfigDiffResponse", "ServiceAppConfigTemplate", "ServiceAppConfigTemplateType", "ServiceAppGroupRequest", @@ -1181,6 +1206,7 @@ "ServiceCreateHelmComponentConfigRequestValues", "ServiceCreateInstallActionWorkflowRunRequest", "ServiceCreateInstallActionWorkflowRunRequestRunEnvVars", + "ServiceCreateInstallAppConfigUpdateRequest", "ServiceCreateInstallComponentDeployRequest", "ServiceCreateInstallConfigRequest", "ServiceCreateInstallConfigRequestLabels", diff --git a/nuon/models/app_app_branch_install_group.py b/nuon/models/app_app_branch_install_group.py index 6e0cd142..86bb54b1 100644 --- a/nuon/models/app_app_branch_install_group.py +++ b/nuon/models/app_app_branch_install_group.py @@ -1,13 +1,17 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.github_com_nuonco_nuon_pkg_labels_selector import GithubComNuoncoNuonPkgLabelsSelector + + T = TypeVar("T", bound="AppAppBranchInstallGroup") @@ -20,13 +24,13 @@ class AppAppBranchInstallGroup: created_by_id (str | Unset): id (str | Unset): install_ids (list[str] | Unset): + label_selector (GithubComNuoncoNuonPkgLabelsSelector | Unset): max_parallel (int | Unset): name (str | Unset): order (int | Unset): org_id (str | Unset): - requires_approval (bool | Unset): - rollback_on_failure (bool | Unset): updated_at (str | Unset): + use_for_previews (bool | Unset): UseForPreviews marks this group for plan-only preview runs (e.g., PR previews). """ app_branch_config_id: str | Unset = UNSET @@ -34,13 +38,13 @@ class AppAppBranchInstallGroup: created_by_id: str | Unset = UNSET id: str | Unset = UNSET install_ids: list[str] | Unset = UNSET + label_selector: GithubComNuoncoNuonPkgLabelsSelector | Unset = UNSET max_parallel: int | Unset = UNSET name: str | Unset = UNSET order: int | Unset = UNSET org_id: str | Unset = UNSET - requires_approval: bool | Unset = UNSET - rollback_on_failure: bool | Unset = UNSET updated_at: str | Unset = UNSET + use_for_previews: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,6 +60,10 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.install_ids, Unset): install_ids = self.install_ids + label_selector: dict[str, Any] | Unset = UNSET + if not isinstance(self.label_selector, Unset): + label_selector = self.label_selector.to_dict() + max_parallel = self.max_parallel name = self.name @@ -64,12 +72,10 @@ def to_dict(self) -> dict[str, Any]: org_id = self.org_id - requires_approval = self.requires_approval - - rollback_on_failure = self.rollback_on_failure - updated_at = self.updated_at + use_for_previews = self.use_for_previews + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -83,6 +89,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["id"] = id if install_ids is not UNSET: field_dict["install_ids"] = install_ids + if label_selector is not UNSET: + field_dict["label_selector"] = label_selector if max_parallel is not UNSET: field_dict["max_parallel"] = max_parallel if name is not UNSET: @@ -91,17 +99,17 @@ def to_dict(self) -> dict[str, Any]: field_dict["order"] = order if org_id is not UNSET: field_dict["org_id"] = org_id - if requires_approval is not UNSET: - field_dict["requires_approval"] = requires_approval - if rollback_on_failure is not UNSET: - field_dict["rollback_on_failure"] = rollback_on_failure if updated_at is not UNSET: field_dict["updated_at"] = updated_at + if use_for_previews is not UNSET: + field_dict["use_for_previews"] = use_for_previews return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.github_com_nuonco_nuon_pkg_labels_selector import GithubComNuoncoNuonPkgLabelsSelector + d = dict(src_dict) app_branch_config_id = d.pop("app_branch_config_id", UNSET) @@ -113,6 +121,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: install_ids = cast(list[str], d.pop("install_ids", UNSET)) + _label_selector = d.pop("label_selector", UNSET) + label_selector: GithubComNuoncoNuonPkgLabelsSelector | Unset + if isinstance(_label_selector, Unset): + label_selector = UNSET + else: + label_selector = GithubComNuoncoNuonPkgLabelsSelector.from_dict(_label_selector) + max_parallel = d.pop("max_parallel", UNSET) name = d.pop("name", UNSET) @@ -121,25 +136,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: org_id = d.pop("org_id", UNSET) - requires_approval = d.pop("requires_approval", UNSET) - - rollback_on_failure = d.pop("rollback_on_failure", UNSET) - updated_at = d.pop("updated_at", UNSET) + use_for_previews = d.pop("use_for_previews", UNSET) + app_app_branch_install_group = cls( app_branch_config_id=app_branch_config_id, created_at=created_at, created_by_id=created_by_id, id=id, install_ids=install_ids, + label_selector=label_selector, max_parallel=max_parallel, name=name, order=order, org_id=org_id, - requires_approval=requires_approval, - rollback_on_failure=rollback_on_failure, updated_at=updated_at, + use_for_previews=use_for_previews, ) app_app_branch_install_group.additional_properties = d diff --git a/nuon/models/app_app_branch_run.py b/nuon/models/app_app_branch_run.py index 132e26a0..9719204e 100644 --- a/nuon/models/app_app_branch_run.py +++ b/nuon/models/app_app_branch_run.py @@ -28,6 +28,7 @@ class AppAppBranchRun: app_branch (AppAppBranch | Unset): app_branch_config (AppAppBranchConfig | Unset): app_config_id (str | Unset): AppConfigID is the app config that was created/synced during this run + base_branch (str | Unset): commit_sha (str | Unset): CommitSHA is the VCS commit that triggered or is associated with this run DEPRECATED: Use VCSConnectionCommit relationship instead completed_at (str | Unset): CompletedAt tracks when execution finished @@ -35,10 +36,18 @@ class AppAppBranchRun: created_by (AppAccount | Unset): created_by_id (str | Unset): error_message (str | Unset): ErrorMessage stores any error that occurred during execution + event_type (str | Unset): EventType indicates what triggered this run (push, pull_request, manual). force (bool | Unset): Force indicates if this run was forced (bypassing change detection) + head_sha (str | Unset): id (str | Unset): log_stream (AppLogStream | Unset): log_stream_id (str | Unset): LogStreamID is the log stream created during this run for event tracking + plan_only (bool | Unset): PlanOnly indicates this is a preview run (e.g., PR preview) that should + only plan changes without applying them. + pr_number (int | Unset): PR metadata — populated when EventType is "pull_request" + previous_run (AppAppBranchRun | Unset): + previous_run_id (str | Unset): PreviousRunID links to the previous successful run on the same branch, + used for build diffing to determine which components need rebuilding. queue_signal (AppQueueSignal | Unset): started_at (str | Unset): StartedAt tracks when execution actually began status (str | Unset): Status tracks the current state of the run @@ -52,16 +61,23 @@ class AppAppBranchRun: app_branch: AppAppBranch | Unset = UNSET app_branch_config: AppAppBranchConfig | Unset = UNSET app_config_id: str | Unset = UNSET + base_branch: str | Unset = UNSET commit_sha: str | Unset = UNSET completed_at: str | Unset = UNSET created_at: str | Unset = UNSET created_by: AppAccount | Unset = UNSET created_by_id: str | Unset = UNSET error_message: str | Unset = UNSET + event_type: str | Unset = UNSET force: bool | Unset = UNSET + head_sha: str | Unset = UNSET id: str | Unset = UNSET log_stream: AppLogStream | Unset = UNSET log_stream_id: str | Unset = UNSET + plan_only: bool | Unset = UNSET + pr_number: int | Unset = UNSET + previous_run: AppAppBranchRun | Unset = UNSET + previous_run_id: str | Unset = UNSET queue_signal: AppQueueSignal | Unset = UNSET started_at: str | Unset = UNSET status: str | Unset = UNSET @@ -82,6 +98,8 @@ def to_dict(self) -> dict[str, Any]: app_config_id = self.app_config_id + base_branch = self.base_branch + commit_sha = self.commit_sha completed_at = self.completed_at @@ -96,8 +114,12 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message + event_type = self.event_type + force = self.force + head_sha = self.head_sha + id = self.id log_stream: dict[str, Any] | Unset = UNSET @@ -106,6 +128,16 @@ def to_dict(self) -> dict[str, Any]: log_stream_id = self.log_stream_id + plan_only = self.plan_only + + pr_number = self.pr_number + + previous_run: dict[str, Any] | Unset = UNSET + if not isinstance(self.previous_run, Unset): + previous_run = self.previous_run.to_dict() + + previous_run_id = self.previous_run_id + queue_signal: dict[str, Any] | Unset = UNSET if not isinstance(self.queue_signal, Unset): queue_signal = self.queue_signal.to_dict() @@ -135,6 +167,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["app_branch_config"] = app_branch_config if app_config_id is not UNSET: field_dict["app_config_id"] = app_config_id + if base_branch is not UNSET: + field_dict["base_branch"] = base_branch if commit_sha is not UNSET: field_dict["commit_sha"] = commit_sha if completed_at is not UNSET: @@ -147,14 +181,26 @@ def to_dict(self) -> dict[str, Any]: field_dict["created_by_id"] = created_by_id if error_message is not UNSET: field_dict["error_message"] = error_message + if event_type is not UNSET: + field_dict["event_type"] = event_type if force is not UNSET: field_dict["force"] = force + if head_sha is not UNSET: + field_dict["head_sha"] = head_sha if id is not UNSET: field_dict["id"] = id if log_stream is not UNSET: field_dict["log_stream"] = log_stream if log_stream_id is not UNSET: field_dict["log_stream_id"] = log_stream_id + if plan_only is not UNSET: + field_dict["plan_only"] = plan_only + if pr_number is not UNSET: + field_dict["pr_number"] = pr_number + if previous_run is not UNSET: + field_dict["previous_run"] = previous_run + if previous_run_id is not UNSET: + field_dict["previous_run_id"] = previous_run_id if queue_signal is not UNSET: field_dict["queue_signal"] = queue_signal if started_at is not UNSET: @@ -199,6 +245,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: app_config_id = d.pop("app_config_id", UNSET) + base_branch = d.pop("base_branch", UNSET) + commit_sha = d.pop("commit_sha", UNSET) completed_at = d.pop("completed_at", UNSET) @@ -216,8 +264,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("error_message", UNSET) + event_type = d.pop("event_type", UNSET) + force = d.pop("force", UNSET) + head_sha = d.pop("head_sha", UNSET) + id = d.pop("id", UNSET) _log_stream = d.pop("log_stream", UNSET) @@ -229,6 +281,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: log_stream_id = d.pop("log_stream_id", UNSET) + plan_only = d.pop("plan_only", UNSET) + + pr_number = d.pop("pr_number", UNSET) + + _previous_run = d.pop("previous_run", UNSET) + previous_run: AppAppBranchRun | Unset + if isinstance(_previous_run, Unset): + previous_run = UNSET + else: + previous_run = AppAppBranchRun.from_dict(_previous_run) + + previous_run_id = d.pop("previous_run_id", UNSET) + _queue_signal = d.pop("queue_signal", UNSET) queue_signal: AppQueueSignal | Unset if isinstance(_queue_signal, Unset): @@ -262,16 +327,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: app_branch=app_branch, app_branch_config=app_branch_config, app_config_id=app_config_id, + base_branch=base_branch, commit_sha=commit_sha, completed_at=completed_at, created_at=created_at, created_by=created_by, created_by_id=created_by_id, error_message=error_message, + event_type=event_type, force=force, + head_sha=head_sha, id=id, log_stream=log_stream, log_stream_id=log_stream_id, + plan_only=plan_only, + pr_number=pr_number, + previous_run=previous_run, + previous_run_id=previous_run_id, queue_signal=queue_signal, started_at=started_at, status=status, diff --git a/nuon/models/app_component_build.py b/nuon/models/app_component_build.py index 43be8c2e..d360646d 100644 --- a/nuon/models/app_component_build.py +++ b/nuon/models/app_component_build.py @@ -28,6 +28,7 @@ class AppComponentBuild: """ Attributes: + app_branch_run_id (str | Unset): checksum (str | Unset): checksum of our intermediate component config component_config_connection (AppComponentConfigConnection | Unset): component_config_connection_id (str | Unset): DEPRECATED: will retain the field to connect against the last @@ -83,6 +84,7 @@ class AppComponentBuild: vcs_connection_commit (AppVCSConnectionCommit | Unset): """ + app_branch_run_id: str | Unset = UNSET checksum: str | Unset = UNSET component_config_connection: AppComponentConfigConnection | Unset = UNSET component_config_connection_id: str | Unset = UNSET @@ -115,6 +117,8 @@ class AppComponentBuild: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + app_branch_run_id = self.app_branch_run_id + checksum = self.checksum component_config_connection: dict[str, Any] | Unset = UNSET @@ -205,6 +209,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if app_branch_run_id is not UNSET: + field_dict["app_branch_run_id"] = app_branch_run_id if checksum is not UNSET: field_dict["checksum"] = checksum if component_config_connection is not UNSET: @@ -280,6 +286,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_vcs_connection_commit import AppVCSConnectionCommit d = dict(src_dict) + app_branch_run_id = d.pop("app_branch_run_id", UNSET) + checksum = d.pop("checksum", UNSET) _component_config_connection = d.pop("component_config_connection", UNSET) @@ -395,6 +403,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: vcs_connection_commit = AppVCSConnectionCommit.from_dict(_vcs_connection_commit) app_component_build = cls( + app_branch_run_id=app_branch_run_id, checksum=checksum, component_config_connection=component_config_connection, component_config_connection_id=component_config_connection_id, diff --git a/nuon/models/app_vcs_event.py b/nuon/models/app_github_event.py similarity index 80% rename from nuon/models/app_vcs_event.py rename to nuon/models/app_github_event.py index 3f3f7cd8..cb6bb8ef 100644 --- a/nuon/models/app_vcs_event.py +++ b/nuon/models/app_github_event.py @@ -10,34 +10,34 @@ if TYPE_CHECKING: from ..models.app_composite_status import AppCompositeStatus - from ..models.app_vcs_event_payload import AppVCSEventPayload + from ..models.blobstore_blob import BlobstoreBlob -T = TypeVar("T", bound="AppVCSEvent") +T = TypeVar("T", bound="AppGithubEvent") @_attrs_define -class AppVCSEvent: +class AppGithubEvent: """ Attributes: created_at (str | Unset): created_by_id (str | Unset): event_type (str | Unset): + github_install_id (str | Unset): id (str | Unset): - payload (AppVCSEventPayload | Unset): + payload (BlobstoreBlob | Unset): status (AppCompositeStatus | Unset): updated_at (str | Unset): - vcs_connection_id (str | Unset): """ created_at: str | Unset = UNSET created_by_id: str | Unset = UNSET event_type: str | Unset = UNSET + github_install_id: str | Unset = UNSET id: str | Unset = UNSET - payload: AppVCSEventPayload | Unset = UNSET + payload: BlobstoreBlob | Unset = UNSET status: AppCompositeStatus | Unset = UNSET updated_at: str | Unset = UNSET - vcs_connection_id: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,6 +47,8 @@ def to_dict(self) -> dict[str, Any]: event_type = self.event_type + github_install_id = self.github_install_id + id = self.id payload: dict[str, Any] | Unset = UNSET @@ -59,8 +61,6 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - vcs_connection_id = self.vcs_connection_id - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -70,6 +70,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["created_by_id"] = created_by_id if event_type is not UNSET: field_dict["event_type"] = event_type + if github_install_id is not UNSET: + field_dict["github_install_id"] = github_install_id if id is not UNSET: field_dict["id"] = id if payload is not UNSET: @@ -78,15 +80,13 @@ def to_dict(self) -> dict[str, Any]: field_dict["status"] = status if updated_at is not UNSET: field_dict["updated_at"] = updated_at - if vcs_connection_id is not UNSET: - field_dict["vcs_connection_id"] = vcs_connection_id return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_composite_status import AppCompositeStatus - from ..models.app_vcs_event_payload import AppVCSEventPayload + from ..models.blobstore_blob import BlobstoreBlob d = dict(src_dict) created_at = d.pop("created_at", UNSET) @@ -95,14 +95,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event_type = d.pop("event_type", UNSET) + github_install_id = d.pop("github_install_id", UNSET) + id = d.pop("id", UNSET) _payload = d.pop("payload", UNSET) - payload: AppVCSEventPayload | Unset + payload: BlobstoreBlob | Unset if isinstance(_payload, Unset): payload = UNSET else: - payload = AppVCSEventPayload.from_dict(_payload) + payload = BlobstoreBlob.from_dict(_payload) _status = d.pop("status", UNSET) status: AppCompositeStatus | Unset @@ -113,21 +115,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at", UNSET) - vcs_connection_id = d.pop("vcs_connection_id", UNSET) - - app_vcs_event = cls( + app_github_event = cls( created_at=created_at, created_by_id=created_by_id, event_type=event_type, + github_install_id=github_install_id, id=id, payload=payload, status=status, updated_at=updated_at, - vcs_connection_id=vcs_connection_id, ) - app_vcs_event.additional_properties = d - return app_vcs_event + app_github_event.additional_properties = d + return app_github_event @property def additional_keys(self) -> list[str]: diff --git a/nuon/models/app_install_config_update.py b/nuon/models/app_install_config_update.py new file mode 100644 index 00000000..bea1352e --- /dev/null +++ b/nuon/models/app_install_config_update.py @@ -0,0 +1,209 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_composite_status import AppCompositeStatus + from ..models.app_workflow import AppWorkflow + from ..models.blobstore_blob import BlobstoreBlob + + +T = TypeVar("T", bound="AppInstallConfigUpdate") + + +@_attrs_define +class AppInstallConfigUpdate: + """ + Attributes: + app_branch_run_id (str | Unset): + created_at (str | Unset): + created_by_id (str | Unset): + diff (BlobstoreBlob | Unset): + id (str | Unset): + install_group_id (str | Unset): + install_id (str | Unset): + new_app_config_id (str | Unset): + old_app_config_id (str | Unset): + org_id (str | Unset): + status (AppCompositeStatus | Unset): + updated_at (str | Unset): + workflow (AppWorkflow | Unset): + workflow_id (str | Unset): WorkflowID links to the install workflow that performs the actual diff and deploy. + """ + + app_branch_run_id: str | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + diff: BlobstoreBlob | Unset = UNSET + id: str | Unset = UNSET + install_group_id: str | Unset = UNSET + install_id: str | Unset = UNSET + new_app_config_id: str | Unset = UNSET + old_app_config_id: str | Unset = UNSET + org_id: str | Unset = UNSET + status: AppCompositeStatus | Unset = UNSET + updated_at: str | Unset = UNSET + workflow: AppWorkflow | Unset = UNSET + workflow_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app_branch_run_id = self.app_branch_run_id + + created_at = self.created_at + + created_by_id = self.created_by_id + + diff: dict[str, Any] | Unset = UNSET + if not isinstance(self.diff, Unset): + diff = self.diff.to_dict() + + id = self.id + + install_group_id = self.install_group_id + + install_id = self.install_id + + new_app_config_id = self.new_app_config_id + + old_app_config_id = self.old_app_config_id + + org_id = self.org_id + + status: dict[str, Any] | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.to_dict() + + updated_at = self.updated_at + + workflow: dict[str, Any] | Unset = UNSET + if not isinstance(self.workflow, Unset): + workflow = self.workflow.to_dict() + + workflow_id = self.workflow_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_branch_run_id is not UNSET: + field_dict["app_branch_run_id"] = app_branch_run_id + if created_at is not UNSET: + field_dict["created_at"] = created_at + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if diff is not UNSET: + field_dict["diff"] = diff + if id is not UNSET: + field_dict["id"] = id + if install_group_id is not UNSET: + field_dict["install_group_id"] = install_group_id + if install_id is not UNSET: + field_dict["install_id"] = install_id + if new_app_config_id is not UNSET: + field_dict["new_app_config_id"] = new_app_config_id + if old_app_config_id is not UNSET: + field_dict["old_app_config_id"] = old_app_config_id + if org_id is not UNSET: + field_dict["org_id"] = org_id + if status is not UNSET: + field_dict["status"] = status + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if workflow is not UNSET: + field_dict["workflow"] = workflow + if workflow_id is not UNSET: + field_dict["workflow_id"] = workflow_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_composite_status import AppCompositeStatus + from ..models.app_workflow import AppWorkflow + from ..models.blobstore_blob import BlobstoreBlob + + d = dict(src_dict) + app_branch_run_id = d.pop("app_branch_run_id", UNSET) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + _diff = d.pop("diff", UNSET) + diff: BlobstoreBlob | Unset + if isinstance(_diff, Unset): + diff = UNSET + else: + diff = BlobstoreBlob.from_dict(_diff) + + id = d.pop("id", UNSET) + + install_group_id = d.pop("install_group_id", UNSET) + + install_id = d.pop("install_id", UNSET) + + new_app_config_id = d.pop("new_app_config_id", UNSET) + + old_app_config_id = d.pop("old_app_config_id", UNSET) + + org_id = d.pop("org_id", UNSET) + + _status = d.pop("status", UNSET) + status: AppCompositeStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = AppCompositeStatus.from_dict(_status) + + updated_at = d.pop("updated_at", UNSET) + + _workflow = d.pop("workflow", UNSET) + workflow: AppWorkflow | Unset + if isinstance(_workflow, Unset): + workflow = UNSET + else: + workflow = AppWorkflow.from_dict(_workflow) + + workflow_id = d.pop("workflow_id", UNSET) + + app_install_config_update = cls( + app_branch_run_id=app_branch_run_id, + created_at=created_at, + created_by_id=created_by_id, + diff=diff, + id=id, + install_group_id=install_group_id, + install_id=install_id, + new_app_config_id=new_app_config_id, + old_app_config_id=old_app_config_id, + org_id=org_id, + status=status, + updated_at=updated_at, + workflow=workflow, + workflow_id=workflow_id, + ) + + app_install_config_update.additional_properties = d + return app_install_config_update + + @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/nuon/models/app_install_deploy.py b/nuon/models/app_install_deploy.py index dc6a92e3..2f557b1a 100644 --- a/nuon/models/app_install_deploy.py +++ b/nuon/models/app_install_deploy.py @@ -21,6 +21,7 @@ from ..models.app_queue_signal import AppQueueSignal from ..models.app_runner_job import AppRunnerJob from ..models.app_workflow import AppWorkflow + from ..models.compositeerrors_composite_error_data import CompositeerrorsCompositeErrorData T = TypeVar("T", bound="AppInstallDeploy") @@ -37,6 +38,7 @@ class AppInstallDeploy: component_config_version (int | Unset): component_id (str | Unset): component_name (str | Unset): + composite_error (CompositeerrorsCompositeErrorData | Unset): created_at (str | Unset): created_by (AppAccount | Unset): created_by_id (str | Unset): @@ -70,6 +72,7 @@ class AppInstallDeploy: component_config_version: int | Unset = UNSET component_id: str | Unset = UNSET component_name: str | Unset = UNSET + composite_error: CompositeerrorsCompositeErrorData | Unset = UNSET created_at: str | Unset = UNSET created_by: AppAccount | Unset = UNSET created_by_id: str | Unset = UNSET @@ -118,6 +121,10 @@ def to_dict(self) -> dict[str, Any]: component_name = self.component_name + composite_error: dict[str, Any] | Unset = UNSET + if not isinstance(self.composite_error, Unset): + composite_error = self.composite_error.to_dict() + created_at = self.created_at created_by: dict[str, Any] | Unset = UNSET @@ -212,6 +219,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["component_id"] = component_id if component_name is not UNSET: field_dict["component_name"] = component_name + if composite_error is not UNSET: + field_dict["composite_error"] = composite_error if created_at is not UNSET: field_dict["created_at"] = created_at if created_by is not UNSET: @@ -276,6 +285,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_queue_signal import AppQueueSignal from ..models.app_runner_job import AppRunnerJob from ..models.app_workflow import AppWorkflow + from ..models.compositeerrors_composite_error_data import CompositeerrorsCompositeErrorData d = dict(src_dict) _action_workflow_runs = d.pop("action_workflow_runs", UNSET) @@ -304,6 +314,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: component_name = d.pop("component_name", UNSET) + _composite_error = d.pop("composite_error", UNSET) + composite_error: CompositeerrorsCompositeErrorData | Unset + if isinstance(_composite_error, Unset): + composite_error = UNSET + else: + composite_error = CompositeerrorsCompositeErrorData.from_dict(_composite_error) + created_at = d.pop("created_at", UNSET) _created_by = d.pop("created_by", UNSET) @@ -416,6 +433,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: component_config_version=component_config_version, component_id=component_id, component_name=component_name, + composite_error=composite_error, created_at=created_at, created_by=created_by, created_by_id=created_by_id, diff --git a/nuon/models/app_install_group_run.py b/nuon/models/app_install_group_run.py new file mode 100644 index 00000000..5841b9e5 --- /dev/null +++ b/nuon/models/app_install_group_run.py @@ -0,0 +1,232 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_app_branch_install_group import AppAppBranchInstallGroup + from ..models.app_composite_status import AppCompositeStatus + from ..models.app_install_group_run_install import AppInstallGroupRunInstall + + +T = TypeVar("T", bound="AppInstallGroupRun") + + +@_attrs_define +class AppInstallGroupRun: + """ + Attributes: + app_branch_run_id (str | Unset): + completed_at (str | Unset): + completed_installs (int | Unset): + created_at (str | Unset): + created_by_id (str | Unset): + failed_installs (int | Unset): + id (str | Unset): + install_group (AppAppBranchInstallGroup | Unset): + install_group_id (str | Unset): + install_group_name (str | Unset): + installs (list[AppInstallGroupRunInstall] | Unset): + org_id (str | Unset): + started_at (str | Unset): + status (AppCompositeStatus | Unset): + total_installs (int | Unset): + updated_at (str | Unset): + """ + + app_branch_run_id: str | Unset = UNSET + completed_at: str | Unset = UNSET + completed_installs: int | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + failed_installs: int | Unset = UNSET + id: str | Unset = UNSET + install_group: AppAppBranchInstallGroup | Unset = UNSET + install_group_id: str | Unset = UNSET + install_group_name: str | Unset = UNSET + installs: list[AppInstallGroupRunInstall] | Unset = UNSET + org_id: str | Unset = UNSET + started_at: str | Unset = UNSET + status: AppCompositeStatus | Unset = UNSET + total_installs: int | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app_branch_run_id = self.app_branch_run_id + + completed_at = self.completed_at + + completed_installs = self.completed_installs + + created_at = self.created_at + + created_by_id = self.created_by_id + + failed_installs = self.failed_installs + + id = self.id + + install_group: dict[str, Any] | Unset = UNSET + if not isinstance(self.install_group, Unset): + install_group = self.install_group.to_dict() + + install_group_id = self.install_group_id + + install_group_name = self.install_group_name + + installs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.installs, Unset): + installs = [] + for installs_item_data in self.installs: + installs_item = installs_item_data.to_dict() + installs.append(installs_item) + + org_id = self.org_id + + started_at = self.started_at + + status: dict[str, Any] | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.to_dict() + + total_installs = self.total_installs + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_branch_run_id is not UNSET: + field_dict["app_branch_run_id"] = app_branch_run_id + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if completed_installs is not UNSET: + field_dict["completed_installs"] = completed_installs + if created_at is not UNSET: + field_dict["created_at"] = created_at + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if failed_installs is not UNSET: + field_dict["failed_installs"] = failed_installs + if id is not UNSET: + field_dict["id"] = id + if install_group is not UNSET: + field_dict["install_group"] = install_group + if install_group_id is not UNSET: + field_dict["install_group_id"] = install_group_id + if install_group_name is not UNSET: + field_dict["install_group_name"] = install_group_name + if installs is not UNSET: + field_dict["installs"] = installs + if org_id is not UNSET: + field_dict["org_id"] = org_id + if started_at is not UNSET: + field_dict["started_at"] = started_at + if status is not UNSET: + field_dict["status"] = status + if total_installs is not UNSET: + field_dict["total_installs"] = total_installs + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_app_branch_install_group import AppAppBranchInstallGroup + from ..models.app_composite_status import AppCompositeStatus + from ..models.app_install_group_run_install import AppInstallGroupRunInstall + + d = dict(src_dict) + app_branch_run_id = d.pop("app_branch_run_id", UNSET) + + completed_at = d.pop("completed_at", UNSET) + + completed_installs = d.pop("completed_installs", UNSET) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + failed_installs = d.pop("failed_installs", UNSET) + + id = d.pop("id", UNSET) + + _install_group = d.pop("install_group", UNSET) + install_group: AppAppBranchInstallGroup | Unset + if isinstance(_install_group, Unset): + install_group = UNSET + else: + install_group = AppAppBranchInstallGroup.from_dict(_install_group) + + install_group_id = d.pop("install_group_id", UNSET) + + install_group_name = d.pop("install_group_name", UNSET) + + _installs = d.pop("installs", UNSET) + installs: list[AppInstallGroupRunInstall] | Unset = UNSET + if _installs is not UNSET: + installs = [] + for installs_item_data in _installs: + installs_item = AppInstallGroupRunInstall.from_dict(installs_item_data) + + installs.append(installs_item) + + org_id = d.pop("org_id", UNSET) + + started_at = d.pop("started_at", UNSET) + + _status = d.pop("status", UNSET) + status: AppCompositeStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = AppCompositeStatus.from_dict(_status) + + total_installs = d.pop("total_installs", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + app_install_group_run = cls( + app_branch_run_id=app_branch_run_id, + completed_at=completed_at, + completed_installs=completed_installs, + created_at=created_at, + created_by_id=created_by_id, + failed_installs=failed_installs, + id=id, + install_group=install_group, + install_group_id=install_group_id, + install_group_name=install_group_name, + installs=installs, + org_id=org_id, + started_at=started_at, + status=status, + total_installs=total_installs, + updated_at=updated_at, + ) + + app_install_group_run.additional_properties = d + return app_install_group_run + + @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/nuon/models/app_install_group_run_install.py b/nuon/models/app_install_group_run_install.py new file mode 100644 index 00000000..f010ae1c --- /dev/null +++ b/nuon/models/app_install_group_run_install.py @@ -0,0 +1,79 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AppInstallGroupRunInstall") + + +@_attrs_define +class AppInstallGroupRunInstall: + """ + Attributes: + install_id (str | Unset): + status (str | Unset): + workflow_id (str | Unset): + """ + + install_id: str | Unset = UNSET + status: str | Unset = UNSET + workflow_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + install_id = self.install_id + + status = self.status + + workflow_id = self.workflow_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if install_id is not UNSET: + field_dict["install_id"] = install_id + if status is not UNSET: + field_dict["status"] = status + if workflow_id is not UNSET: + field_dict["workflow_id"] = workflow_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + install_id = d.pop("install_id", UNSET) + + status = d.pop("status", UNSET) + + workflow_id = d.pop("workflow_id", UNSET) + + app_install_group_run_install = cls( + install_id=install_id, + status=status, + workflow_id=workflow_id, + ) + + app_install_group_run_install.additional_properties = d + return app_install_group_run_install + + @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/nuon/models/app_vcs_webhook_subscription.py b/nuon/models/app_vcs_webhook_subscription.py new file mode 100644 index 00000000..42fc8ad0 --- /dev/null +++ b/nuon/models/app_vcs_webhook_subscription.py @@ -0,0 +1,146 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_composite_status import AppCompositeStatus + + +T = TypeVar("T", bound="AppVCSWebhookSubscription") + + +@_attrs_define +class AppVCSWebhookSubscription: + """ + Attributes: + created_at (str | Unset): + created_by_id (str | Unset): + github_hook_id (int | Unset): + github_install_id (str | Unset): + id (str | Unset): + status (AppCompositeStatus | Unset): + updated_at (str | Unset): + vcs_connection_id (str | Unset): + webhook_url (str | Unset): + """ + + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + github_hook_id: int | Unset = UNSET + github_install_id: str | Unset = UNSET + id: str | Unset = UNSET + status: AppCompositeStatus | Unset = UNSET + updated_at: str | Unset = UNSET + vcs_connection_id: str | Unset = UNSET + webhook_url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + created_by_id = self.created_by_id + + github_hook_id = self.github_hook_id + + github_install_id = self.github_install_id + + id = self.id + + status: dict[str, Any] | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.to_dict() + + updated_at = self.updated_at + + vcs_connection_id = self.vcs_connection_id + + webhook_url = self.webhook_url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if github_hook_id is not UNSET: + field_dict["github_hook_id"] = github_hook_id + if github_install_id is not UNSET: + field_dict["github_install_id"] = github_install_id + if id is not UNSET: + field_dict["id"] = id + if status is not UNSET: + field_dict["status"] = status + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if vcs_connection_id is not UNSET: + field_dict["vcs_connection_id"] = vcs_connection_id + if webhook_url is not UNSET: + field_dict["webhook_url"] = webhook_url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_composite_status import AppCompositeStatus + + d = dict(src_dict) + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + github_hook_id = d.pop("github_hook_id", UNSET) + + github_install_id = d.pop("github_install_id", UNSET) + + id = d.pop("id", UNSET) + + _status = d.pop("status", UNSET) + status: AppCompositeStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = AppCompositeStatus.from_dict(_status) + + updated_at = d.pop("updated_at", UNSET) + + vcs_connection_id = d.pop("vcs_connection_id", UNSET) + + webhook_url = d.pop("webhook_url", UNSET) + + app_vcs_webhook_subscription = cls( + created_at=created_at, + created_by_id=created_by_id, + github_hook_id=github_hook_id, + github_install_id=github_install_id, + id=id, + status=status, + updated_at=updated_at, + vcs_connection_id=vcs_connection_id, + webhook_url=webhook_url, + ) + + app_vcs_webhook_subscription.additional_properties = d + return app_vcs_webhook_subscription + + @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/nuon/models/app_workflow_type.py b/nuon/models/app_workflow_type.py index 4e296b33..2f218eb2 100644 --- a/nuon/models/app_workflow_type.py +++ b/nuon/models/app_workflow_type.py @@ -6,6 +6,7 @@ class AppWorkflowType(str, Enum): APP_BRANCHES_COMPONENT_REPO_UPDATE = "app_branches_component_repo_update" APP_BRANCHES_CONFIG_REPO_UPDATE = "app_branches_config_repo_update" APP_BRANCHES_MANUAL_UPDATE = "app_branches_manual_update" + APP_BRANCH_CONFIG_UPDATE = "app_branch_config_update" APP_CONFIG_BUILD = "app_config_build" DEPLOY_COMPONENTS = "deploy_components" DEPROVISION = "deprovision" diff --git a/nuon/models/compositeerrors_composite_error_data.py b/nuon/models/compositeerrors_composite_error_data.py new file mode 100644 index 00000000..d27ff4ed --- /dev/null +++ b/nuon/models/compositeerrors_composite_error_data.py @@ -0,0 +1,125 @@ +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 + +from ..models.compositeerrors_severity import CompositeerrorsSeverity +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.compositeerrors_section import CompositeerrorsSection + + +T = TypeVar("T", bound="CompositeerrorsCompositeErrorData") + + +@_attrs_define +class CompositeerrorsCompositeErrorData: + """ + Attributes: + data (list[int] | Unset): + message (str | Unset): + sections (list[CompositeerrorsSection] | Unset): + severity (CompositeerrorsSeverity | Unset): + type_ (str | Unset): + """ + + data: list[int] | Unset = UNSET + message: str | Unset = UNSET + sections: list[CompositeerrorsSection] | Unset = UNSET + severity: CompositeerrorsSeverity | Unset = UNSET + type_: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data: list[int] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data + + message = self.message + + sections: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.sections, Unset): + sections = [] + for sections_item_data in self.sections: + sections_item = sections_item_data.to_dict() + sections.append(sections_item) + + severity: str | Unset = UNSET + if not isinstance(self.severity, Unset): + severity = self.severity.value + + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + if message is not UNSET: + field_dict["message"] = message + if sections is not UNSET: + field_dict["sections"] = sections + if severity is not UNSET: + field_dict["severity"] = severity + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.compositeerrors_section import CompositeerrorsSection + + d = dict(src_dict) + data = cast(list[int], d.pop("data", UNSET)) + + message = d.pop("message", UNSET) + + _sections = d.pop("sections", UNSET) + sections: list[CompositeerrorsSection] | Unset = UNSET + if _sections is not UNSET: + sections = [] + for sections_item_data in _sections: + sections_item = CompositeerrorsSection.from_dict(sections_item_data) + + sections.append(sections_item) + + _severity = d.pop("severity", UNSET) + severity: CompositeerrorsSeverity | Unset + if isinstance(_severity, Unset): + severity = UNSET + else: + severity = CompositeerrorsSeverity(_severity) + + type_ = d.pop("type", UNSET) + + compositeerrors_composite_error_data = cls( + data=data, + message=message, + sections=sections, + severity=severity, + type_=type_, + ) + + compositeerrors_composite_error_data.additional_properties = d + return compositeerrors_composite_error_data + + @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/nuon/models/app_vcs_event_payload.py b/nuon/models/compositeerrors_section.py similarity index 57% rename from nuon/models/app_vcs_event_payload.py rename to nuon/models/compositeerrors_section.py index 9372ed03..71caa209 100644 --- a/nuon/models/app_vcs_event_payload.py +++ b/nuon/models/compositeerrors_section.py @@ -6,29 +6,52 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AppVCSEventPayload") +from ..types import UNSET, Unset +T = TypeVar("T", bound="CompositeerrorsSection") -@_attrs_define -class AppVCSEventPayload: - """ """ +@_attrs_define +class CompositeerrorsSection: + """ + Attributes: + body (str | Unset): + heading (str | Unset): + """ + + body: str | Unset = UNSET + heading: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + body = self.body + + heading = self.heading field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if heading is not UNSET: + field_dict["heading"] = heading return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - app_vcs_event_payload = cls() + body = d.pop("body", UNSET) + + heading = d.pop("heading", UNSET) + + compositeerrors_section = cls( + body=body, + heading=heading, + ) - app_vcs_event_payload.additional_properties = d - return app_vcs_event_payload + compositeerrors_section.additional_properties = d + return compositeerrors_section @property def additional_keys(self) -> list[str]: diff --git a/nuon/models/compositeerrors_severity.py b/nuon/models/compositeerrors_severity.py new file mode 100644 index 00000000..2bbdcddd --- /dev/null +++ b/nuon/models/compositeerrors_severity.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class CompositeerrorsSeverity(str, Enum): + ERROR = "error" + FATAL = "fatal" + INFO = "info" + WARNING = "warning" + + def __str__(self) -> str: + return str(self.value) diff --git a/nuon/models/diff_diff.py b/nuon/models/diff_diff.py new file mode 100644 index 00000000..7c0a0031 --- /dev/null +++ b/nuon/models/diff_diff.py @@ -0,0 +1,104 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.diff_diff_key import DiffDiffKey + + +T = TypeVar("T", bound="DiffDiff") + + +@_attrs_define +class DiffDiff: + """ + Attributes: + children (list[DiffDiff] | Unset): + diff (DiffDiffKey | Unset): + key (str | Unset): + """ + + children: list[DiffDiff] | Unset = UNSET + diff: DiffDiffKey | Unset = UNSET + key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + children: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.children, Unset): + children = [] + for children_item_data in self.children: + children_item = children_item_data.to_dict() + children.append(children_item) + + diff: dict[str, Any] | Unset = UNSET + if not isinstance(self.diff, Unset): + diff = self.diff.to_dict() + + key = self.key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if children is not UNSET: + field_dict["children"] = children + if diff is not UNSET: + field_dict["diff"] = diff + if key is not UNSET: + field_dict["key"] = key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.diff_diff_key import DiffDiffKey + + d = dict(src_dict) + _children = d.pop("children", UNSET) + children: list[DiffDiff] | Unset = UNSET + if _children is not UNSET: + children = [] + for children_item_data in _children: + children_item = DiffDiff.from_dict(children_item_data) + + children.append(children_item) + + _diff = d.pop("diff", UNSET) + diff: DiffDiffKey | Unset + if isinstance(_diff, Unset): + diff = UNSET + else: + diff = DiffDiffKey.from_dict(_diff) + + key = d.pop("key", UNSET) + + diff_diff = cls( + children=children, + diff=diff, + key=key, + ) + + diff_diff.additional_properties = d + return diff_diff + + @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/nuon/models/diff_diff_key.py b/nuon/models/diff_diff_key.py new file mode 100644 index 00000000..2c99de95 --- /dev/null +++ b/nuon/models/diff_diff_key.py @@ -0,0 +1,78 @@ +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 + +from ..models.diff_op import DiffOp +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DiffDiffKey") + + +@_attrs_define +class DiffDiffKey: + """ + Attributes: + diff (str | Unset): + op (DiffOp | Unset): + """ + + diff: str | Unset = UNSET + op: DiffOp | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + diff = self.diff + + op: str | Unset = UNSET + if not isinstance(self.op, Unset): + op = self.op.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if diff is not UNSET: + field_dict["diff"] = diff + if op is not UNSET: + field_dict["op"] = op + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + diff = d.pop("diff", UNSET) + + _op = d.pop("op", UNSET) + op: DiffOp | Unset + if isinstance(_op, Unset): + op = UNSET + else: + op = DiffOp(_op) + + diff_diff_key = cls( + diff=diff, + op=op, + ) + + diff_diff_key.additional_properties = d + return diff_diff_key + + @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/nuon/models/diff_diff_summary.py b/nuon/models/diff_diff_summary.py new file mode 100644 index 00000000..3440a0ce --- /dev/null +++ b/nuon/models/diff_diff_summary.py @@ -0,0 +1,97 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DiffDiffSummary") + + +@_attrs_define +class DiffDiffSummary: + """ + Attributes: + added (int | Unset): + changed (int | Unset): + has_changed (bool | Unset): + removed (int | Unset): + unchanged (int | Unset): + """ + + added: int | Unset = UNSET + changed: int | Unset = UNSET + has_changed: bool | Unset = UNSET + removed: int | Unset = UNSET + unchanged: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + added = self.added + + changed = self.changed + + has_changed = self.has_changed + + removed = self.removed + + unchanged = self.unchanged + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if added is not UNSET: + field_dict["added"] = added + if changed is not UNSET: + field_dict["changed"] = changed + if has_changed is not UNSET: + field_dict["has_changed"] = has_changed + if removed is not UNSET: + field_dict["removed"] = removed + if unchanged is not UNSET: + field_dict["unchanged"] = unchanged + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + added = d.pop("added", UNSET) + + changed = d.pop("changed", UNSET) + + has_changed = d.pop("has_changed", UNSET) + + removed = d.pop("removed", UNSET) + + unchanged = d.pop("unchanged", UNSET) + + diff_diff_summary = cls( + added=added, + changed=changed, + has_changed=has_changed, + removed=removed, + unchanged=unchanged, + ) + + diff_diff_summary.additional_properties = d + return diff_diff_summary + + @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/nuon/models/diff_op.py b/nuon/models/diff_op.py new file mode 100644 index 00000000..884d9bef --- /dev/null +++ b/nuon/models/diff_op.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class DiffOp(str, Enum): + ADD = "add" + CHANGE = "change" + NOOP = "noop" + REMOVE = "remove" + VALUE_4 = "" + + def __str__(self) -> str: + return str(self.value) diff --git a/nuon/models/github_com_nuonco_nuon_pkg_labels_selector.py b/nuon/models/github_com_nuonco_nuon_pkg_labels_selector.py new file mode 100644 index 00000000..5b0c5a38 --- /dev/null +++ b/nuon/models/github_com_nuonco_nuon_pkg_labels_selector.py @@ -0,0 +1,90 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.github_com_nuonco_nuon_pkg_labels_labels import GithubComNuoncoNuonPkgLabelsLabels + + +T = TypeVar("T", bound="GithubComNuoncoNuonPkgLabelsSelector") + + +@_attrs_define +class GithubComNuoncoNuonPkgLabelsSelector: + """ + Attributes: + match_labels (GithubComNuoncoNuonPkgLabelsLabels | Unset): + not_match_labels (GithubComNuoncoNuonPkgLabelsLabels | Unset): + """ + + match_labels: GithubComNuoncoNuonPkgLabelsLabels | Unset = UNSET + not_match_labels: GithubComNuoncoNuonPkgLabelsLabels | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + match_labels: dict[str, Any] | Unset = UNSET + if not isinstance(self.match_labels, Unset): + match_labels = self.match_labels.to_dict() + + not_match_labels: dict[str, Any] | Unset = UNSET + if not isinstance(self.not_match_labels, Unset): + not_match_labels = self.not_match_labels.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if match_labels is not UNSET: + field_dict["match_labels"] = match_labels + if not_match_labels is not UNSET: + field_dict["not_match_labels"] = not_match_labels + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.github_com_nuonco_nuon_pkg_labels_labels import GithubComNuoncoNuonPkgLabelsLabels + + d = dict(src_dict) + _match_labels = d.pop("match_labels", UNSET) + match_labels: GithubComNuoncoNuonPkgLabelsLabels | Unset + if isinstance(_match_labels, Unset): + match_labels = UNSET + else: + match_labels = GithubComNuoncoNuonPkgLabelsLabels.from_dict(_match_labels) + + _not_match_labels = d.pop("not_match_labels", UNSET) + not_match_labels: GithubComNuoncoNuonPkgLabelsLabels | Unset + if isinstance(_not_match_labels, Unset): + not_match_labels = UNSET + else: + not_match_labels = GithubComNuoncoNuonPkgLabelsLabels.from_dict(_not_match_labels) + + github_com_nuonco_nuon_pkg_labels_selector = cls( + match_labels=match_labels, + not_match_labels=not_match_labels, + ) + + github_com_nuonco_nuon_pkg_labels_selector.additional_properties = d + return github_com_nuonco_nuon_pkg_labels_selector + + @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/nuon/models/service_app_config_diff_response.py b/nuon/models/service_app_config_diff_response.py new file mode 100644 index 00000000..ef684c01 --- /dev/null +++ b/nuon/models/service_app_config_diff_response.py @@ -0,0 +1,119 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.diff_diff import DiffDiff + from ..models.diff_diff_summary import DiffDiffSummary + + +T = TypeVar("T", bound="ServiceAppConfigDiffResponse") + + +@_attrs_define +class ServiceAppConfigDiffResponse: + """ + Attributes: + changed (str | Unset): + config_id (str | Unset): + diff (DiffDiff | Unset): + old_config_id (str | Unset): + summary (DiffDiffSummary | Unset): + """ + + changed: str | Unset = UNSET + config_id: str | Unset = UNSET + diff: DiffDiff | Unset = UNSET + old_config_id: str | Unset = UNSET + summary: DiffDiffSummary | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + changed = self.changed + + config_id = self.config_id + + diff: dict[str, Any] | Unset = UNSET + if not isinstance(self.diff, Unset): + diff = self.diff.to_dict() + + old_config_id = self.old_config_id + + summary: dict[str, Any] | Unset = UNSET + if not isinstance(self.summary, Unset): + summary = self.summary.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if changed is not UNSET: + field_dict["changed"] = changed + if config_id is not UNSET: + field_dict["config_id"] = config_id + if diff is not UNSET: + field_dict["diff"] = diff + if old_config_id is not UNSET: + field_dict["old_config_id"] = old_config_id + if summary is not UNSET: + field_dict["summary"] = summary + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.diff_diff import DiffDiff + from ..models.diff_diff_summary import DiffDiffSummary + + d = dict(src_dict) + changed = d.pop("changed", UNSET) + + config_id = d.pop("config_id", UNSET) + + _diff = d.pop("diff", UNSET) + diff: DiffDiff | Unset + if isinstance(_diff, Unset): + diff = UNSET + else: + diff = DiffDiff.from_dict(_diff) + + old_config_id = d.pop("old_config_id", UNSET) + + _summary = d.pop("summary", UNSET) + summary: DiffDiffSummary | Unset + if isinstance(_summary, Unset): + summary = UNSET + else: + summary = DiffDiffSummary.from_dict(_summary) + + service_app_config_diff_response = cls( + changed=changed, + config_id=config_id, + diff=diff, + old_config_id=old_config_id, + summary=summary, + ) + + service_app_config_diff_response.additional_properties = d + return service_app_config_diff_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/nuon/models/service_create_app_config_request.py b/nuon/models/service_create_app_config_request.py index f18b252f..39a99804 100644 --- a/nuon/models/service_create_app_config_request.py +++ b/nuon/models/service_create_app_config_request.py @@ -15,24 +15,37 @@ class ServiceCreateAppConfigRequest: """ Attributes: + app_branch_id (str | Unset): AppBranchID optionally links this config to an app branch. + When set, triggers an app branch run after sync. cli_version (str | Unset): + plan_only (bool | Unset): PlanOnly creates a preview run (plan without apply). Only used with AppBranchID. readme (str | Unset): not required Readme """ + app_branch_id: str | Unset = UNSET cli_version: str | Unset = UNSET + plan_only: bool | Unset = UNSET readme: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + app_branch_id = self.app_branch_id + cli_version = self.cli_version + plan_only = self.plan_only + readme = self.readme field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if app_branch_id is not UNSET: + field_dict["app_branch_id"] = app_branch_id if cli_version is not UNSET: field_dict["cli_version"] = cli_version + if plan_only is not UNSET: + field_dict["plan_only"] = plan_only if readme is not UNSET: field_dict["readme"] = readme @@ -41,12 +54,18 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + app_branch_id = d.pop("app_branch_id", UNSET) + cli_version = d.pop("cli_version", UNSET) + plan_only = d.pop("plan_only", UNSET) + readme = d.pop("readme", UNSET) service_create_app_config_request = cls( + app_branch_id=app_branch_id, cli_version=cli_version, + plan_only=plan_only, readme=readme, ) diff --git a/nuon/models/service_create_install_app_config_update_request.py b/nuon/models/service_create_install_app_config_update_request.py new file mode 100644 index 00000000..03189ec6 --- /dev/null +++ b/nuon/models/service_create_install_app_config_update_request.py @@ -0,0 +1,72 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceCreateInstallAppConfigUpdateRequest") + + +@_attrs_define +class ServiceCreateInstallAppConfigUpdateRequest: + """ + Attributes: + app_config_id (str): + plan_only (bool | Unset): + """ + + app_config_id: str + plan_only: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app_config_id = self.app_config_id + + plan_only = self.plan_only + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "app_config_id": app_config_id, + } + ) + if plan_only is not UNSET: + field_dict["plan_only"] = plan_only + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_config_id = d.pop("app_config_id") + + plan_only = d.pop("plan_only", UNSET) + + service_create_install_app_config_update_request = cls( + app_config_id=app_config_id, + plan_only=plan_only, + ) + + service_create_install_app_config_update_request.additional_properties = d + return service_create_install_app_config_update_request + + @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/nuon/models/service_install_group_request.py b/nuon/models/service_install_group_request.py index 5d750ed1..6a028768 100644 --- a/nuon/models/service_install_group_request.py +++ b/nuon/models/service_install_group_request.py @@ -1,13 +1,17 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.github_com_nuonco_nuon_pkg_labels_selector import GithubComNuoncoNuonPkgLabelsSelector + + T = TypeVar("T", bound="ServiceInstallGroupRequest") @@ -17,18 +21,16 @@ class ServiceInstallGroupRequest: Attributes: name (str): install_ids (list[str] | Unset): - max_parallel (int | Unset): + label_selector (GithubComNuoncoNuonPkgLabelsSelector | Unset): order (int | Unset): - requires_approval (bool | Unset): - rollback_on_failure (bool | Unset): + use_for_previews (bool | Unset): """ name: str install_ids: list[str] | Unset = UNSET - max_parallel: int | Unset = UNSET + label_selector: GithubComNuoncoNuonPkgLabelsSelector | Unset = UNSET order: int | Unset = UNSET - requires_approval: bool | Unset = UNSET - rollback_on_failure: bool | Unset = UNSET + use_for_previews: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,13 +40,13 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.install_ids, Unset): install_ids = self.install_ids - max_parallel = self.max_parallel + label_selector: dict[str, Any] | Unset = UNSET + if not isinstance(self.label_selector, Unset): + label_selector = self.label_selector.to_dict() order = self.order - requires_approval = self.requires_approval - - rollback_on_failure = self.rollback_on_failure + use_for_previews = self.use_for_previews field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -55,39 +57,41 @@ def to_dict(self) -> dict[str, Any]: ) if install_ids is not UNSET: field_dict["install_ids"] = install_ids - if max_parallel is not UNSET: - field_dict["max_parallel"] = max_parallel + if label_selector is not UNSET: + field_dict["label_selector"] = label_selector if order is not UNSET: field_dict["order"] = order - if requires_approval is not UNSET: - field_dict["requires_approval"] = requires_approval - if rollback_on_failure is not UNSET: - field_dict["rollback_on_failure"] = rollback_on_failure + if use_for_previews is not UNSET: + field_dict["use_for_previews"] = use_for_previews return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.github_com_nuonco_nuon_pkg_labels_selector import GithubComNuoncoNuonPkgLabelsSelector + d = dict(src_dict) name = d.pop("name") install_ids = cast(list[str], d.pop("install_ids", UNSET)) - max_parallel = d.pop("max_parallel", UNSET) + _label_selector = d.pop("label_selector", UNSET) + label_selector: GithubComNuoncoNuonPkgLabelsSelector | Unset + if isinstance(_label_selector, Unset): + label_selector = UNSET + else: + label_selector = GithubComNuoncoNuonPkgLabelsSelector.from_dict(_label_selector) order = d.pop("order", UNSET) - requires_approval = d.pop("requires_approval", UNSET) - - rollback_on_failure = d.pop("rollback_on_failure", UNSET) + use_for_previews = d.pop("use_for_previews", UNSET) service_install_group_request = cls( name=name, install_ids=install_ids, - max_parallel=max_parallel, + label_selector=label_selector, order=order, - requires_approval=requires_approval, - rollback_on_failure=rollback_on_failure, + use_for_previews=use_for_previews, ) service_install_group_request.additional_properties = d diff --git a/nuon/models/service_trigger_app_branch_run_request.py b/nuon/models/service_trigger_app_branch_run_request.py index 97cfe4f0..ba16b353 100644 --- a/nuon/models/service_trigger_app_branch_run_request.py +++ b/nuon/models/service_trigger_app_branch_run_request.py @@ -17,10 +17,12 @@ class ServiceTriggerAppBranchRunRequest: Attributes: config_id (str | Unset): optional - use latest if not provided force (bool | Unset): force run even if no changes detected + plan_only (bool | Unset): plan-only preview mode (no apply) """ config_id: str | Unset = UNSET force: bool | Unset = UNSET + plan_only: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -28,6 +30,8 @@ def to_dict(self) -> dict[str, Any]: force = self.force + plan_only = self.plan_only + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -35,6 +39,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["config_id"] = config_id if force is not UNSET: field_dict["force"] = force + if plan_only is not UNSET: + field_dict["plan_only"] = plan_only return field_dict @@ -45,9 +51,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: force = d.pop("force", UNSET) + plan_only = d.pop("plan_only", UNSET) + service_trigger_app_branch_run_request = cls( config_id=config_id, force=force, + plan_only=plan_only, ) service_trigger_app_branch_run_request.additional_properties = d diff --git a/pyproject.toml b/pyproject.toml index aabeab6c..7da6a8dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1010" +version = "0.19.1012" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index f9a74a6d..7ec53b3a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1010 +0.19.1012