Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions nuon/api/runbooks/delete_runbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
2 changes: 2 additions & 0 deletions nuon/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -952,6 +953,7 @@
"AppInstallEventPayload",
"AppInstallGroupRun",
"AppInstallGroupRunInstall",
"AppInstallGroupRunRunbook",
"AppInstallInputs",
"AppInstallInputsRedactedValues",
"AppInstallInputsValues",
Expand Down
14 changes: 14 additions & 0 deletions nuon/models/app_app_branch_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down
38 changes: 37 additions & 1 deletion nuon/models/app_install_group_run_install.py
Original file line number Diff line number Diff line change
@@ -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")


Expand All @@ -16,18 +20,31 @@ 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)

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
Expand All @@ -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:
Expand All @@ -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,
)
Expand Down
107 changes: 107 additions & 0 deletions nuon/models/app_install_group_run_runbook.py
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions nuon/models/app_install_runbook_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
15 changes: 14 additions & 1 deletion nuon/models/service_create_app_branch_config_request.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand All @@ -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()
Expand All @@ -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

Expand Down Expand Up @@ -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):
Expand All @@ -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,
)

Expand Down
Loading
Loading