From 297067eaf8e56b81731108bfda9957f52aa191ad Mon Sep 17 00:00:00 2001 From: nuonbot Date: Tue, 11 Aug 2026 08:47:55 +0000 Subject: [PATCH] ci: generate from api 0.19.1116 --- nuon/api/runbooks/delete_runbook.py | 5 + nuon/models/__init__.py | 2 + nuon/models/app_app_branch_config.py | 14 +++ nuon/models/app_install_group_run_install.py | 38 ++++++- nuon/models/app_install_group_run_runbook.py | 107 ++++++++++++++++++ nuon/models/app_install_runbook_run.py | 10 ++ ...ervice_create_app_branch_config_request.py | 15 ++- pyproject.toml | 2 +- version.txt | 2 +- 9 files changed, 191 insertions(+), 4 deletions(-) create mode 100644 nuon/models/app_install_group_run_runbook.py diff --git a/nuon/api/runbooks/delete_runbook.py b/nuon/api/runbooks/delete_runbook.py index acc6a01c..7200eafd 100644 --- a/nuon/api/runbooks/delete_runbook.py +++ b/nuon/api/runbooks/delete_runbook.py @@ -53,6 +53,11 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = StderrErrResponse.from_dict(response.json()) + + return response_409 + if response.status_code == 500: response_500 = StderrErrResponse.from_dict(response.json()) diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index cf8c7c2d..cd79e21c 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -136,6 +136,7 @@ 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_group_run_runbook import AppInstallGroupRunRunbook from .app_install_inputs import AppInstallInputs from .app_install_inputs_redacted_values import AppInstallInputsRedactedValues from .app_install_inputs_values import AppInstallInputsValues @@ -952,6 +953,7 @@ "AppInstallEventPayload", "AppInstallGroupRun", "AppInstallGroupRunInstall", + "AppInstallGroupRunRunbook", "AppInstallInputs", "AppInstallInputsRedactedValues", "AppInstallInputsValues", diff --git a/nuon/models/app_app_branch_config.py b/nuon/models/app_app_branch_config.py index e622b0e9..94049758 100644 --- a/nuon/models/app_app_branch_config.py +++ b/nuon/models/app_app_branch_config.py @@ -32,6 +32,10 @@ class AppAppBranchConfig: id (str | Unset): install_groups (list[AppAppBranchInstallGroup] | Unset): org_id (str | Unset): + post_deploy_runbook_ids (list[str] | Unset): PostDeployRunbookIDs are runbooks run on each install, in order, + after its + deploy succeeds. Distinct from RunbookIDs, which tracks the runbooks the + branch's synced app config produced. public_git_vcs_config (AppPublicGitVCSConfig | Unset): runbook_ids (list[str] | Unset): updated_at (str | Unset): @@ -48,6 +52,7 @@ class AppAppBranchConfig: id: str | Unset = UNSET install_groups: list[AppAppBranchInstallGroup] | Unset = UNSET org_id: str | Unset = UNSET + post_deploy_runbook_ids: list[str] | Unset = UNSET public_git_vcs_config: AppPublicGitVCSConfig | Unset = UNSET runbook_ids: list[str] | Unset = UNSET updated_at: str | Unset = UNSET @@ -86,6 +91,10 @@ def to_dict(self) -> dict[str, Any]: org_id = self.org_id + post_deploy_runbook_ids: list[str] | Unset = UNSET + if not isinstance(self.post_deploy_runbook_ids, Unset): + post_deploy_runbook_ids = self.post_deploy_runbook_ids + public_git_vcs_config: dict[str, Any] | Unset = UNSET if not isinstance(self.public_git_vcs_config, Unset): public_git_vcs_config = self.public_git_vcs_config.to_dict() @@ -126,6 +135,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["install_groups"] = install_groups if org_id is not UNSET: field_dict["org_id"] = org_id + if post_deploy_runbook_ids is not UNSET: + field_dict["post_deploy_runbook_ids"] = post_deploy_runbook_ids if public_git_vcs_config is not UNSET: field_dict["public_git_vcs_config"] = public_git_vcs_config if runbook_ids is not UNSET: @@ -177,6 +188,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: org_id = d.pop("org_id", UNSET) + post_deploy_runbook_ids = cast(list[str], d.pop("post_deploy_runbook_ids", UNSET)) + _public_git_vcs_config = d.pop("public_git_vcs_config", UNSET) public_git_vcs_config: AppPublicGitVCSConfig | Unset if isinstance(_public_git_vcs_config, Unset): @@ -208,6 +221,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id=id, install_groups=install_groups, org_id=org_id, + post_deploy_runbook_ids=post_deploy_runbook_ids, public_git_vcs_config=public_git_vcs_config, runbook_ids=runbook_ids, updated_at=updated_at, diff --git a/nuon/models/app_install_group_run_install.py b/nuon/models/app_install_group_run_install.py index f010ae1c..b33aa8e3 100644 --- a/nuon/models/app_install_group_run_install.py +++ b/nuon/models/app_install_group_run_install.py @@ -1,13 +1,17 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar +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_install_group_run_runbook import AppInstallGroupRunRunbook + + T = TypeVar("T", bound="AppInstallGroupRunInstall") @@ -16,11 +20,15 @@ class AppInstallGroupRunInstall: """ Attributes: install_id (str | Unset): + phase (str | Unset): Phase is which stage of the group the install is in: "deploy" or "runbook". + runbooks (list[AppInstallGroupRunRunbook] | Unset): status (str | Unset): workflow_id (str | Unset): """ install_id: str | Unset = UNSET + phase: str | Unset = UNSET + runbooks: list[AppInstallGroupRunRunbook] | Unset = UNSET status: str | Unset = UNSET workflow_id: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -28,6 +36,15 @@ class AppInstallGroupRunInstall: def to_dict(self) -> dict[str, Any]: install_id = self.install_id + phase = self.phase + + runbooks: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.runbooks, Unset): + runbooks = [] + for runbooks_item_data in self.runbooks: + runbooks_item = runbooks_item_data.to_dict() + runbooks.append(runbooks_item) + status = self.status workflow_id = self.workflow_id @@ -37,6 +54,10 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) if install_id is not UNSET: field_dict["install_id"] = install_id + if phase is not UNSET: + field_dict["phase"] = phase + if runbooks is not UNSET: + field_dict["runbooks"] = runbooks if status is not UNSET: field_dict["status"] = status if workflow_id is not UNSET: @@ -46,15 +67,30 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_install_group_run_runbook import AppInstallGroupRunRunbook + d = dict(src_dict) install_id = d.pop("install_id", UNSET) + phase = d.pop("phase", UNSET) + + _runbooks = d.pop("runbooks", UNSET) + runbooks: list[AppInstallGroupRunRunbook] | Unset = UNSET + if _runbooks is not UNSET: + runbooks = [] + for runbooks_item_data in _runbooks: + runbooks_item = AppInstallGroupRunRunbook.from_dict(runbooks_item_data) + + runbooks.append(runbooks_item) + status = d.pop("status", UNSET) workflow_id = d.pop("workflow_id", UNSET) app_install_group_run_install = cls( install_id=install_id, + phase=phase, + runbooks=runbooks, status=status, workflow_id=workflow_id, ) diff --git a/nuon/models/app_install_group_run_runbook.py b/nuon/models/app_install_group_run_runbook.py new file mode 100644 index 00000000..136e3326 --- /dev/null +++ b/nuon/models/app_install_group_run_runbook.py @@ -0,0 +1,107 @@ +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="AppInstallGroupRunRunbook") + + +@_attrs_define +class AppInstallGroupRunRunbook: + """ + Attributes: + attempt (int | Unset): Attempt increments when a retry of the step re-runs a runbook that failed, + so the retry gets a fresh idempotency key instead of adopting the failed run. + run_id (str | Unset): + runbook_id (str | Unset): + runbook_name (str | Unset): + status (str | Unset): + workflow_id (str | Unset): + """ + + attempt: int | Unset = UNSET + run_id: str | Unset = UNSET + runbook_id: str | Unset = UNSET + runbook_name: 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]: + attempt = self.attempt + + run_id = self.run_id + + runbook_id = self.runbook_id + + runbook_name = self.runbook_name + + status = self.status + + workflow_id = self.workflow_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if attempt is not UNSET: + field_dict["attempt"] = attempt + if run_id is not UNSET: + field_dict["run_id"] = run_id + if runbook_id is not UNSET: + field_dict["runbook_id"] = runbook_id + if runbook_name is not UNSET: + field_dict["runbook_name"] = runbook_name + 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) + attempt = d.pop("attempt", UNSET) + + run_id = d.pop("run_id", UNSET) + + runbook_id = d.pop("runbook_id", UNSET) + + runbook_name = d.pop("runbook_name", UNSET) + + status = d.pop("status", UNSET) + + workflow_id = d.pop("workflow_id", UNSET) + + app_install_group_run_runbook = cls( + attempt=attempt, + run_id=run_id, + runbook_id=runbook_id, + runbook_name=runbook_name, + status=status, + workflow_id=workflow_id, + ) + + app_install_group_run_runbook.additional_properties = d + return app_install_group_run_runbook + + @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_runbook_run.py b/nuon/models/app_install_runbook_run.py index aab97507..e0f9f680 100644 --- a/nuon/models/app_install_runbook_run.py +++ b/nuon/models/app_install_runbook_run.py @@ -31,6 +31,8 @@ class AppInstallRunbookRun: created_by_id (str | Unset): execution_time (int | Unset): after query id (str | Unset): + idempotency_key (str | Unset): IdempotencyKey lets a retryable caller (e.g. a Temporal activity) repeat a + trigger without starting the runbook twice. Unique where set. install_id (str | Unset): install_runbook (AppInstallRunbook | Unset): install_runbook_id (str | Unset): @@ -56,6 +58,7 @@ class AppInstallRunbookRun: created_by_id: str | Unset = UNSET execution_time: int | Unset = UNSET id: str | Unset = UNSET + idempotency_key: str | Unset = UNSET install_id: str | Unset = UNSET install_runbook: AppInstallRunbook | Unset = UNSET install_runbook_id: str | Unset = UNSET @@ -87,6 +90,8 @@ def to_dict(self) -> dict[str, Any]: id = self.id + idempotency_key = self.idempotency_key + install_id = self.install_id install_runbook: dict[str, Any] | Unset = UNSET @@ -149,6 +154,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["execution_time"] = execution_time if id is not UNSET: field_dict["id"] = id + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key if install_id is not UNSET: field_dict["install_id"] = install_id if install_runbook is not UNSET: @@ -211,6 +218,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) + idempotency_key = d.pop("idempotency_key", UNSET) + install_id = d.pop("install_id", UNSET) _install_runbook = d.pop("install_runbook", UNSET) @@ -286,6 +295,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_by_id=created_by_id, execution_time=execution_time, id=id, + idempotency_key=idempotency_key, install_id=install_id, install_runbook=install_runbook, install_runbook_id=install_runbook_id, diff --git a/nuon/models/service_create_app_branch_config_request.py b/nuon/models/service_create_app_branch_config_request.py index 71e62c78..0560a3b3 100644 --- a/nuon/models/service_create_app_branch_config_request.py +++ b/nuon/models/service_create_app_branch_config_request.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,11 +23,15 @@ class ServiceCreateAppBranchConfigRequest: Attributes: connected_github_vcs_config (HelpersConnectedGithubVCSConfigRequest | Unset): install_groups (list[ServiceInstallGroupRequest] | Unset): + post_deploy_runbook_ids (list[str] | Unset): PostDeployRunbookIDs run on each install, in order, after its + deploy succeeds. + Omit to carry the current setting forward; send an empty array to clear it. public_git_vcs_config (HelpersPublicGitVCSConfigRequest | Unset): """ connected_github_vcs_config: HelpersConnectedGithubVCSConfigRequest | Unset = UNSET install_groups: list[ServiceInstallGroupRequest] | Unset = UNSET + post_deploy_runbook_ids: list[str] | Unset = UNSET public_git_vcs_config: HelpersPublicGitVCSConfigRequest | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,6 +47,10 @@ def to_dict(self) -> dict[str, Any]: install_groups_item = install_groups_item_data.to_dict() install_groups.append(install_groups_item) + post_deploy_runbook_ids: list[str] | Unset = UNSET + if not isinstance(self.post_deploy_runbook_ids, Unset): + post_deploy_runbook_ids = self.post_deploy_runbook_ids + public_git_vcs_config: dict[str, Any] | Unset = UNSET if not isinstance(self.public_git_vcs_config, Unset): public_git_vcs_config = self.public_git_vcs_config.to_dict() @@ -54,6 +62,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["connected_github_vcs_config"] = connected_github_vcs_config if install_groups is not UNSET: field_dict["install_groups"] = install_groups + if post_deploy_runbook_ids is not UNSET: + field_dict["post_deploy_runbook_ids"] = post_deploy_runbook_ids if public_git_vcs_config is not UNSET: field_dict["public_git_vcs_config"] = public_git_vcs_config @@ -82,6 +92,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: install_groups.append(install_groups_item) + post_deploy_runbook_ids = cast(list[str], d.pop("post_deploy_runbook_ids", UNSET)) + _public_git_vcs_config = d.pop("public_git_vcs_config", UNSET) public_git_vcs_config: HelpersPublicGitVCSConfigRequest | Unset if isinstance(_public_git_vcs_config, Unset): @@ -92,6 +104,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: service_create_app_branch_config_request = cls( connected_github_vcs_config=connected_github_vcs_config, install_groups=install_groups, + post_deploy_runbook_ids=post_deploy_runbook_ids, public_git_vcs_config=public_git_vcs_config, ) diff --git a/pyproject.toml b/pyproject.toml index cae9e6b2..80cb1a7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1115" +version = "0.19.1116" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index 4daaea4b..551aa251 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1115 +0.19.1116