diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index cd79e21c..3d04483d 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -194,6 +194,7 @@ from .app_otel_log_record_log_attributes import AppOtelLogRecordLogAttributes from .app_otel_log_record_resource_attributes import AppOtelLogRecordResourceAttributes from .app_otel_log_record_scope_attributes import AppOtelLogRecordScopeAttributes +from .app_phone_home_auth_status import AppPhoneHomeAuthStatus from .app_policy import AppPolicy from .app_policy_input_ref import AppPolicyInputRef from .app_policy_name import AppPolicyName @@ -232,6 +233,7 @@ from .app_runner_health_check import AppRunnerHealthCheck from .app_runner_heart_beat import AppRunnerHeartBeat from .app_runner_job import AppRunnerJob +from .app_runner_job_composite_error import AppRunnerJobCompositeError from .app_runner_job_execution import AppRunnerJobExecution from .app_runner_job_execution_metadata import AppRunnerJobExecutionMetadata from .app_runner_job_execution_outputs import AppRunnerJobExecutionOutputs @@ -1011,6 +1013,7 @@ "AppOtelLogRecordLogAttributes", "AppOtelLogRecordResourceAttributes", "AppOtelLogRecordScopeAttributes", + "AppPhoneHomeAuthStatus", "AppPolicy", "AppPolicyInputRef", "AppPolicyName", @@ -1049,6 +1052,7 @@ "AppRunnerHealthCheck", "AppRunnerHeartBeat", "AppRunnerJob", + "AppRunnerJobCompositeError", "AppRunnerJobExecution", "AppRunnerJobExecutionMetadata", "AppRunnerJobExecutionOutputs", diff --git a/nuon/models/app_install.py b/nuon/models/app_install.py index f89b9aa9..54f9c049 100644 --- a/nuon/models/app_install.py +++ b/nuon/models/app_install.py @@ -33,6 +33,7 @@ from ..models.app_install_sandbox_run import AppInstallSandboxRun from ..models.app_install_stack import AppInstallStack from ..models.app_install_state import AppInstallState + from ..models.app_phone_home_auth_status import AppPhoneHomeAuthStatus from ..models.app_queue import AppQueue from ..models.app_workflow import AppWorkflow from ..models.github_com_nuonco_nuon_pkg_labels_labels import GithubComNuoncoNuonPkgLabelsLabels @@ -100,6 +101,7 @@ class AppInstall: links (AppInstallLinks | Unset): metadata (AppInstallMetadata | Unset): name (str | Unset): + phone_home_auth (AppPhoneHomeAuthStatus | Unset): queues (list[AppQueue] | Unset): runner_id (str | Unset): runner_status (str | Unset): @@ -162,6 +164,7 @@ class AppInstall: links: AppInstallLinks | Unset = UNSET metadata: AppInstallMetadata | Unset = UNSET name: str | Unset = UNSET + phone_home_auth: AppPhoneHomeAuthStatus | Unset = UNSET queues: list[AppQueue] | Unset = UNSET runner_id: str | Unset = UNSET runner_status: str | Unset = UNSET @@ -338,6 +341,10 @@ def to_dict(self) -> dict[str, Any]: name = self.name + phone_home_auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.phone_home_auth, Unset): + phone_home_auth = self.phone_home_auth.to_dict() + queues: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.queues, Unset): queues = [] @@ -467,6 +474,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["metadata"] = metadata if name is not UNSET: field_dict["name"] = name + if phone_home_auth is not UNSET: + field_dict["phone_home_auth"] = phone_home_auth if queues is not UNSET: field_dict["queues"] = queues if runner_id is not UNSET: @@ -524,6 +533,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_install_sandbox_run import AppInstallSandboxRun from ..models.app_install_stack import AppInstallStack from ..models.app_install_state import AppInstallState + from ..models.app_phone_home_auth_status import AppPhoneHomeAuthStatus from ..models.app_queue import AppQueue from ..models.app_workflow import AppWorkflow from ..models.github_com_nuonco_nuon_pkg_labels_labels import GithubComNuoncoNuonPkgLabelsLabels @@ -752,6 +762,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) + _phone_home_auth = d.pop("phone_home_auth", UNSET) + phone_home_auth: AppPhoneHomeAuthStatus | Unset + if isinstance(_phone_home_auth, Unset): + phone_home_auth = UNSET + else: + phone_home_auth = AppPhoneHomeAuthStatus.from_dict(_phone_home_auth) + _queues = d.pop("queues", UNSET) queues: list[AppQueue] | Unset = UNSET if _queues is not UNSET: @@ -847,6 +864,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: links=links, metadata=metadata, name=name, + phone_home_auth=phone_home_auth, queues=queues, runner_id=runner_id, runner_status=runner_status, diff --git a/nuon/models/app_phone_home_auth_status.py b/nuon/models/app_phone_home_auth_status.py new file mode 100644 index 00000000..ec457159 --- /dev/null +++ b/nuon/models/app_phone_home_auth_status.py @@ -0,0 +1,81 @@ +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="AppPhoneHomeAuthStatus") + + +@_attrs_define +class AppPhoneHomeAuthStatus: + """ + Attributes: + last_rejected_at (str | Unset): + last_verified_at (str | Unset): + provisioned_at (str | Unset): ProvisionedAt is omitzero because recordPhoneHomeAuthResult can create the column + from an empty struct, so a row can carry verification timestamps but no + provisioning one. Serializing that as year 1 would render as a bogus timestamp. + """ + + last_rejected_at: str | Unset = UNSET + last_verified_at: str | Unset = UNSET + provisioned_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + last_rejected_at = self.last_rejected_at + + last_verified_at = self.last_verified_at + + provisioned_at = self.provisioned_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if last_rejected_at is not UNSET: + field_dict["last_rejected_at"] = last_rejected_at + if last_verified_at is not UNSET: + field_dict["last_verified_at"] = last_verified_at + if provisioned_at is not UNSET: + field_dict["provisioned_at"] = provisioned_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + last_rejected_at = d.pop("last_rejected_at", UNSET) + + last_verified_at = d.pop("last_verified_at", UNSET) + + provisioned_at = d.pop("provisioned_at", UNSET) + + app_phone_home_auth_status = cls( + last_rejected_at=last_rejected_at, + last_verified_at=last_verified_at, + provisioned_at=provisioned_at, + ) + + app_phone_home_auth_status.additional_properties = d + return app_phone_home_auth_status + + @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_runner_job.py b/nuon/models/app_runner_job.py index cbe76c7f..0b65b22a 100644 --- a/nuon/models/app_runner_job.py +++ b/nuon/models/app_runner_job.py @@ -15,6 +15,7 @@ if TYPE_CHECKING: from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_role_usage import AppInstallRoleUsage + from ..models.app_runner_job_composite_error import AppRunnerJobCompositeError from ..models.app_runner_job_execution import AppRunnerJobExecution from ..models.app_runner_job_metadata import AppRunnerJobMetadata from ..models.app_runner_job_outputs import AppRunnerJobOutputs @@ -30,6 +31,7 @@ class AppRunnerJob: Attributes: available_timeout (int | Unset): available timeout is how long a job can be marked as "available" before being requeued + composite_error (AppRunnerJobCompositeError | Unset): created_at (str | Unset): created_by_id (str | Unset): execution_count (int | Unset): @@ -66,6 +68,7 @@ class AppRunnerJob: """ available_timeout: int | Unset = UNSET + composite_error: AppRunnerJobCompositeError | Unset = UNSET created_at: str | Unset = UNSET created_by_id: str | Unset = UNSET execution_count: int | Unset = UNSET @@ -103,6 +106,10 @@ class AppRunnerJob: def to_dict(self) -> dict[str, Any]: available_timeout = self.available_timeout + 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_id = self.created_by_id @@ -195,6 +202,8 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) if available_timeout is not UNSET: field_dict["available_timeout"] = available_timeout + 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_id is not UNSET: @@ -266,6 +275,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_role_usage import AppInstallRoleUsage + from ..models.app_runner_job_composite_error import AppRunnerJobCompositeError from ..models.app_runner_job_execution import AppRunnerJobExecution from ..models.app_runner_job_metadata import AppRunnerJobMetadata from ..models.app_runner_job_outputs import AppRunnerJobOutputs @@ -274,6 +284,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) available_timeout = d.pop("available_timeout", UNSET) + _composite_error = d.pop("composite_error", UNSET) + composite_error: AppRunnerJobCompositeError | Unset + if isinstance(_composite_error, Unset): + composite_error = UNSET + else: + composite_error = AppRunnerJobCompositeError.from_dict(_composite_error) + created_at = d.pop("created_at", UNSET) created_by_id = d.pop("created_by_id", UNSET) @@ -392,6 +409,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: app_runner_job = cls( available_timeout=available_timeout, + composite_error=composite_error, created_at=created_at, created_by_id=created_by_id, execution_count=execution_count, diff --git a/nuon/models/app_runner_job_composite_error.py b/nuon/models/app_runner_job_composite_error.py new file mode 100644 index 00000000..23da5a98 --- /dev/null +++ b/nuon/models/app_runner_job_composite_error.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AppRunnerJobCompositeError") + + +@_attrs_define +class AppRunnerJobCompositeError: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_runner_job_composite_error = cls() + + app_runner_job_composite_error.additional_properties = d + return app_runner_job_composite_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_trigger_app_branch_run_request.py b/nuon/models/service_trigger_app_branch_run_request.py index 8c40195a..82172f12 100644 --- a/nuon/models/service_trigger_app_branch_run_request.py +++ b/nuon/models/service_trigger_app_branch_run_request.py @@ -16,28 +16,41 @@ class ServiceTriggerAppBranchRunRequest: """ Attributes: app_config_id (str | Unset): optional - use pre-existing app config (skips VCS fetch + config parse) + base_branch (str | Unset): config_id (str | Unset): optional - use latest if not provided force (bool | Unset): force run even if no changes detected + head_sha (str | Unset): plan_only (bool | Unset): plan-only preview mode (no apply) + pr_number (int | Unset): PR context, for previews triggered from CI rather than a GitHub webhook. + Supplying PRNumber is what lets the run report back onto the pull request. skip_builds (bool | Unset): skip builds step (e.g. rollback to existing config with existing builds) """ app_config_id: str | Unset = UNSET + base_branch: str | Unset = UNSET config_id: str | Unset = UNSET force: bool | Unset = UNSET + head_sha: str | Unset = UNSET plan_only: bool | Unset = UNSET + pr_number: int | Unset = UNSET skip_builds: 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 + base_branch = self.base_branch + config_id = self.config_id force = self.force + head_sha = self.head_sha + plan_only = self.plan_only + pr_number = self.pr_number + skip_builds = self.skip_builds field_dict: dict[str, Any] = {} @@ -45,12 +58,18 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) 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 config_id is not UNSET: field_dict["config_id"] = config_id if force is not UNSET: field_dict["force"] = force + if head_sha is not UNSET: + field_dict["head_sha"] = head_sha 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 skip_builds is not UNSET: field_dict["skip_builds"] = skip_builds @@ -61,19 +80,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) app_config_id = d.pop("app_config_id", UNSET) + base_branch = d.pop("base_branch", UNSET) + config_id = d.pop("config_id", UNSET) force = d.pop("force", UNSET) + head_sha = d.pop("head_sha", UNSET) + plan_only = d.pop("plan_only", UNSET) + pr_number = d.pop("pr_number", UNSET) + skip_builds = d.pop("skip_builds", UNSET) service_trigger_app_branch_run_request = cls( app_config_id=app_config_id, + base_branch=base_branch, config_id=config_id, force=force, + head_sha=head_sha, plan_only=plan_only, + pr_number=pr_number, skip_builds=skip_builds, ) diff --git a/pyproject.toml b/pyproject.toml index 80cb1a7e..3fd5b13f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1116" +version = "0.19.1117" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index 551aa251..40d4ca22 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1116 +0.19.1117