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
4 changes: 4 additions & 0 deletions nuon/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1011,6 +1013,7 @@
"AppOtelLogRecordLogAttributes",
"AppOtelLogRecordResourceAttributes",
"AppOtelLogRecordScopeAttributes",
"AppPhoneHomeAuthStatus",
"AppPolicy",
"AppPolicyInputRef",
"AppPolicyName",
Expand Down Expand Up @@ -1049,6 +1052,7 @@
"AppRunnerHealthCheck",
"AppRunnerHeartBeat",
"AppRunnerJob",
"AppRunnerJobCompositeError",
"AppRunnerJobExecution",
"AppRunnerJobExecutionMetadata",
"AppRunnerJobExecutionOutputs",
Expand Down
18 changes: 18 additions & 0 deletions nuon/models/app_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down
81 changes: 81 additions & 0 deletions nuon/models/app_phone_home_auth_status.py
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions nuon/models/app_runner_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
47 changes: 47 additions & 0 deletions nuon/models/app_runner_job_composite_error.py
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions nuon/models/service_trigger_app_branch_run_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,60 @@ 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] = {}
field_dict.update(self.additional_properties)
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

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

Expand Down
Loading
Loading