diff --git a/nuon/api/runners/fetch_runner_token_mng.py b/nuon/api/runners/fetch_runner_token_mng.py deleted file mode 100644 index 70f30416..00000000 --- a/nuon/api/runners/fetch_runner_token_mng.py +++ /dev/null @@ -1,202 +0,0 @@ -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_empty_response import AppEmptyResponse -from ...models.service_mng_fetch_token_request import ServiceMngFetchTokenRequest -from ...models.stderr_err_response import StderrErrResponse -from ...types import Response - - -def _get_kwargs( - runner_id: str, - *, - body: ServiceMngFetchTokenRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/v1/runners/{runner_id}/mng/fetch-token".format( - runner_id=quote(str(runner_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 -) -> AppEmptyResponse | StderrErrResponse | None: - if response.status_code == 200: - response_200 = AppEmptyResponse.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[AppEmptyResponse | 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( - runner_id: str, - *, - client: AuthenticatedClient, - body: ServiceMngFetchTokenRequest, -) -> Response[AppEmptyResponse | StderrErrResponse]: - """fetch authentication token for an install runner via the mng process - - Args: - runner_id (str): - body (ServiceMngFetchTokenRequest): - - 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[AppEmptyResponse | StderrErrResponse] - """ - - kwargs = _get_kwargs( - runner_id=runner_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - runner_id: str, - *, - client: AuthenticatedClient, - body: ServiceMngFetchTokenRequest, -) -> AppEmptyResponse | StderrErrResponse | None: - """fetch authentication token for an install runner via the mng process - - Args: - runner_id (str): - body (ServiceMngFetchTokenRequest): - - 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: - AppEmptyResponse | StderrErrResponse - """ - - return sync_detailed( - runner_id=runner_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - runner_id: str, - *, - client: AuthenticatedClient, - body: ServiceMngFetchTokenRequest, -) -> Response[AppEmptyResponse | StderrErrResponse]: - """fetch authentication token for an install runner via the mng process - - Args: - runner_id (str): - body (ServiceMngFetchTokenRequest): - - 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[AppEmptyResponse | StderrErrResponse] - """ - - kwargs = _get_kwargs( - runner_id=runner_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - runner_id: str, - *, - client: AuthenticatedClient, - body: ServiceMngFetchTokenRequest, -) -> AppEmptyResponse | StderrErrResponse | None: - """fetch authentication token for an install runner via the mng process - - Args: - runner_id (str): - body (ServiceMngFetchTokenRequest): - - 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: - AppEmptyResponse | StderrErrResponse - """ - - return ( - await asyncio_detailed( - runner_id=runner_id, - client=client, - body=body, - ) - ).parsed diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index 011d6945..3661dd03 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -39,9 +39,11 @@ from .app_app_sandbox_config import AppAppSandboxConfig from .app_app_sandbox_config_env_vars import AppAppSandboxConfigEnvVars from .app_app_sandbox_config_operation_roles import AppAppSandboxConfigOperationRoles +from .app_app_sandbox_config_pulumi_config import AppAppSandboxConfigPulumiConfig from .app_app_sandbox_config_variables import AppAppSandboxConfigVariables from .app_app_secret import AppAppSecret from .app_app_secret_config import AppAppSecretConfig +from .app_app_secret_kubernetes_sync_target import AppAppSecretKubernetesSyncTarget from .app_app_secrets_config import AppAppSecretsConfig from .app_app_stack_config import AppAppStackConfig from .app_aws_account import AppAWSAccount @@ -264,6 +266,7 @@ from .config_app_policy_type import ConfigAppPolicyType from .config_custom_nested_stack import ConfigCustomNestedStack from .config_custom_nested_stack_parameters import ConfigCustomNestedStackParameters +from .config_custom_nested_stack_status import ConfigCustomNestedStackStatus from .config_helm_repo_config import ConfigHelmRepoConfig from .configs_oci_registry_auth import ConfigsOCIRegistryAuth from .configs_oci_registry_repository import ConfigsOCIRegistryRepository @@ -338,9 +341,12 @@ from .plantypes_kubernetes_manifest_deploy_plan import PlantypesKubernetesManifestDeployPlan from .plantypes_kubernetes_sandbox_mode import PlantypesKubernetesSandboxMode from .plantypes_kubernetes_secret_sync import PlantypesKubernetesSecretSync +from .plantypes_kubernetes_secret_sync_target import PlantypesKubernetesSecretSyncTarget from .plantypes_kustomize_build_config import PlantypesKustomizeBuildConfig from .plantypes_noop_deploy_plan import PlantypesNoopDeployPlan from .plantypes_oci_artifact_reference import PlantypesOCIArtifactReference +from .plantypes_pulumi_backend import PlantypesPulumiBackend +from .plantypes_pulumi_backend_config import PlantypesPulumiBackendConfig from .plantypes_pulumi_build_plan import PlantypesPulumiBuildPlan from .plantypes_pulumi_build_plan_labels import PlantypesPulumiBuildPlanLabels from .plantypes_pulumi_deploy_plan import PlantypesPulumiDeployPlan @@ -443,6 +449,7 @@ from .service_create_app_sandbox_config_request_operation_roles import ( ServiceCreateAppSandboxConfigRequestOperationRoles, ) +from .service_create_app_sandbox_config_request_pulumi_config import ServiceCreateAppSandboxConfigRequestPulumiConfig from .service_create_app_sandbox_config_request_variables import ServiceCreateAppSandboxConfigRequestVariables from .service_create_app_secret_request import ServiceCreateAppSecretRequest from .service_create_app_secrets_config_request import ServiceCreateAppSecretsConfigRequest @@ -556,12 +563,12 @@ from .service_install_group_request import ServiceInstallGroupRequest from .service_install_permissions_role_status import ServiceInstallPermissionsRoleStatus from .service_install_phone_home_request import ServiceInstallPhoneHomeRequest +from .service_kubernetes_sync_target import ServiceKubernetesSyncTarget from .service_kustomize_config_request import ServiceKustomizeConfigRequest from .service_latest_runner_heart_beats import ServiceLatestRunnerHeartBeats from .service_list_channels_response import ServiceListChannelsResponse from .service_log_stream_span import ServiceLogStreamSpan from .service_log_stream_span_attributes import ServiceLogStreamSpanAttributes -from .service_mng_fetch_token_request import ServiceMngFetchTokenRequest from .service_mng_restart_request import ServiceMngRestartRequest from .service_mng_shut_down_request import ServiceMngShutDownRequest from .service_mng_update_request import ServiceMngUpdateRequest @@ -711,9 +718,11 @@ "AppAppSandboxConfig", "AppAppSandboxConfigEnvVars", "AppAppSandboxConfigOperationRoles", + "AppAppSandboxConfigPulumiConfig", "AppAppSandboxConfigVariables", "AppAppSecret", "AppAppSecretConfig", + "AppAppSecretKubernetesSyncTarget", "AppAppSecretsConfig", "AppAppStackConfig", "AppAWSAccount", @@ -934,6 +943,7 @@ "ConfigAppPolicyType", "ConfigCustomNestedStack", "ConfigCustomNestedStackParameters", + "ConfigCustomNestedStackStatus", "ConfigHelmRepoConfig", "ConfigsOCIRegistryAuth", "ConfigsOCIRegistryRepository", @@ -1006,9 +1016,12 @@ "PlantypesKubernetesManifestDeployPlan", "PlantypesKubernetesSandboxMode", "PlantypesKubernetesSecretSync", + "PlantypesKubernetesSecretSyncTarget", "PlantypesKustomizeBuildConfig", "PlantypesNoopDeployPlan", "PlantypesOCIArtifactReference", + "PlantypesPulumiBackend", + "PlantypesPulumiBackendConfig", "PlantypesPulumiBuildPlan", "PlantypesPulumiBuildPlanLabels", "PlantypesPulumiDeployPlan", @@ -1105,6 +1118,7 @@ "ServiceCreateAppSandboxConfigRequest", "ServiceCreateAppSandboxConfigRequestEnvVars", "ServiceCreateAppSandboxConfigRequestOperationRoles", + "ServiceCreateAppSandboxConfigRequestPulumiConfig", "ServiceCreateAppSandboxConfigRequestVariables", "ServiceCreateAppSecretRequest", "ServiceCreateAppSecretsConfigRequest", @@ -1194,12 +1208,12 @@ "ServiceInstallGroupRequest", "ServiceInstallPermissionsRoleStatus", "ServiceInstallPhoneHomeRequest", + "ServiceKubernetesSyncTarget", "ServiceKustomizeConfigRequest", "ServiceLatestRunnerHeartBeats", "ServiceListChannelsResponse", "ServiceLogStreamSpan", "ServiceLogStreamSpanAttributes", - "ServiceMngFetchTokenRequest", "ServiceMngRestartRequest", "ServiceMngShutDownRequest", "ServiceMngUpdateRequest", diff --git a/nuon/models/app_app_runner_config.py b/nuon/models/app_app_runner_config.py index a4644fbf..86300870 100644 --- a/nuon/models/app_app_runner_config.py +++ b/nuon/models/app_app_runner_config.py @@ -32,6 +32,8 @@ class AppAppRunnerConfig: id (str | Unset): init_script (str | Unset): takes a URL to a bash script ⤵ which will be `curl | bash`-ed on the VM. usually via user-data or equivalent. + instance_type (str | Unset): InstanceType is the cloud machine/instance type for the install runner host, mapped + per cloud platform. org_id (str | Unset): updated_at (str | Unset): """ @@ -46,6 +48,7 @@ class AppAppRunnerConfig: helm_driver: str | Unset = UNSET id: str | Unset = UNSET init_script: str | Unset = UNSET + instance_type: str | Unset = UNSET org_id: str | Unset = UNSET updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -77,6 +80,8 @@ def to_dict(self) -> dict[str, Any]: init_script = self.init_script + instance_type = self.instance_type + org_id = self.org_id updated_at = self.updated_at @@ -104,6 +109,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["id"] = id if init_script is not UNSET: field_dict["init_script"] = init_script + if instance_type is not UNSET: + field_dict["instance_type"] = instance_type if org_id is not UNSET: field_dict["org_id"] = org_id if updated_at is not UNSET: @@ -151,6 +158,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: init_script = d.pop("init_script", UNSET) + instance_type = d.pop("instance_type", UNSET) + org_id = d.pop("org_id", UNSET) updated_at = d.pop("updated_at", UNSET) @@ -166,6 +175,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: helm_driver=helm_driver, id=id, init_script=init_script, + instance_type=instance_type, org_id=org_id, updated_at=updated_at, ) diff --git a/nuon/models/app_app_sandbox_config.py b/nuon/models/app_app_sandbox_config.py index 04b6cf40..50e92b37 100644 --- a/nuon/models/app_app_sandbox_config.py +++ b/nuon/models/app_app_sandbox_config.py @@ -11,6 +11,7 @@ if TYPE_CHECKING: from ..models.app_app_sandbox_config_env_vars import AppAppSandboxConfigEnvVars from ..models.app_app_sandbox_config_operation_roles import AppAppSandboxConfigOperationRoles + from ..models.app_app_sandbox_config_pulumi_config import AppAppSandboxConfigPulumiConfig from ..models.app_app_sandbox_config_variables import AppAppSandboxConfigVariables from ..models.app_connected_github_vcs_config import AppConnectedGithubVCSConfig from ..models.app_public_git_vcs_config import AppPublicGitVCSConfig @@ -39,10 +40,14 @@ class AppAppSandboxConfig: operation_roles (AppAppSandboxConfigOperationRoles | Unset): Operation roles map: operation type -> role name org_id (str | Unset): public_git_vcs_config (AppPublicGitVCSConfig | Unset): + pulumi_config (AppAppSandboxConfigPulumiConfig | Unset): + pulumi_version (str | Unset): references (list[str] | Unset): refs (list[RefsRef] | Unset): + runtime (str | Unset): skip_noops (bool | Unset): terraform_version (str | Unset): + type_ (str | Unset): updated_at (str | Unset): variables (AppAppSandboxConfigVariables | Unset): variables_files (list[str] | Unset): @@ -63,10 +68,14 @@ class AppAppSandboxConfig: operation_roles: AppAppSandboxConfigOperationRoles | Unset = UNSET org_id: str | Unset = UNSET public_git_vcs_config: AppPublicGitVCSConfig | Unset = UNSET + pulumi_config: AppAppSandboxConfigPulumiConfig | Unset = UNSET + pulumi_version: str | Unset = UNSET references: list[str] | Unset = UNSET refs: list[RefsRef] | Unset = UNSET + runtime: str | Unset = UNSET skip_noops: bool | Unset = UNSET terraform_version: str | Unset = UNSET + type_: str | Unset = UNSET updated_at: str | Unset = UNSET variables: AppAppSandboxConfigVariables | Unset = UNSET variables_files: list[str] | Unset = UNSET @@ -111,6 +120,12 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.public_git_vcs_config, Unset): public_git_vcs_config = self.public_git_vcs_config.to_dict() + pulumi_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.pulumi_config, Unset): + pulumi_config = self.pulumi_config.to_dict() + + pulumi_version = self.pulumi_version + references: list[str] | Unset = UNSET if not isinstance(self.references, Unset): references = self.references @@ -122,10 +137,14 @@ def to_dict(self) -> dict[str, Any]: refs_item = refs_item_data.to_dict() refs.append(refs_item) + runtime = self.runtime + skip_noops = self.skip_noops terraform_version = self.terraform_version + type_ = self.type_ + updated_at = self.updated_at variables: dict[str, Any] | Unset = UNSET @@ -169,14 +188,22 @@ def to_dict(self) -> dict[str, Any]: field_dict["org_id"] = org_id if public_git_vcs_config is not UNSET: field_dict["public_git_vcs_config"] = public_git_vcs_config + if pulumi_config is not UNSET: + field_dict["pulumi_config"] = pulumi_config + if pulumi_version is not UNSET: + field_dict["pulumi_version"] = pulumi_version if references is not UNSET: field_dict["references"] = references if refs is not UNSET: field_dict["refs"] = refs + if runtime is not UNSET: + field_dict["runtime"] = runtime if skip_noops is not UNSET: field_dict["skip_noops"] = skip_noops if terraform_version is not UNSET: field_dict["terraform_version"] = terraform_version + if type_ is not UNSET: + field_dict["type"] = type_ if updated_at is not UNSET: field_dict["updated_at"] = updated_at if variables is not UNSET: @@ -190,6 +217,7 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_app_sandbox_config_env_vars import AppAppSandboxConfigEnvVars from ..models.app_app_sandbox_config_operation_roles import AppAppSandboxConfigOperationRoles + from ..models.app_app_sandbox_config_pulumi_config import AppAppSandboxConfigPulumiConfig from ..models.app_app_sandbox_config_variables import AppAppSandboxConfigVariables from ..models.app_connected_github_vcs_config import AppConnectedGithubVCSConfig from ..models.app_public_git_vcs_config import AppPublicGitVCSConfig @@ -246,6 +274,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: public_git_vcs_config = AppPublicGitVCSConfig.from_dict(_public_git_vcs_config) + _pulumi_config = d.pop("pulumi_config", UNSET) + pulumi_config: AppAppSandboxConfigPulumiConfig | Unset + if isinstance(_pulumi_config, Unset): + pulumi_config = UNSET + else: + pulumi_config = AppAppSandboxConfigPulumiConfig.from_dict(_pulumi_config) + + pulumi_version = d.pop("pulumi_version", UNSET) + references = cast(list[str], d.pop("references", UNSET)) _refs = d.pop("refs", UNSET) @@ -257,10 +294,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: refs.append(refs_item) + runtime = d.pop("runtime", UNSET) + skip_noops = d.pop("skip_noops", UNSET) terraform_version = d.pop("terraform_version", UNSET) + type_ = d.pop("type", UNSET) + updated_at = d.pop("updated_at", UNSET) _variables = d.pop("variables", UNSET) @@ -288,10 +329,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operation_roles=operation_roles, org_id=org_id, public_git_vcs_config=public_git_vcs_config, + pulumi_config=pulumi_config, + pulumi_version=pulumi_version, references=references, refs=refs, + runtime=runtime, skip_noops=skip_noops, terraform_version=terraform_version, + type_=type_, updated_at=updated_at, variables=variables, variables_files=variables_files, diff --git a/nuon/models/app_app_sandbox_config_pulumi_config.py b/nuon/models/app_app_sandbox_config_pulumi_config.py new file mode 100644 index 00000000..d83e1bc2 --- /dev/null +++ b/nuon/models/app_app_sandbox_config_pulumi_config.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="AppAppSandboxConfigPulumiConfig") + + +@_attrs_define +class AppAppSandboxConfigPulumiConfig: + """ """ + + additional_properties: dict[str, str] = _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_app_sandbox_config_pulumi_config = cls() + + app_app_sandbox_config_pulumi_config.additional_properties = d + return app_app_sandbox_config_pulumi_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> 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_app_secret_config.py b/nuon/models/app_app_secret_config.py index b5b913a7..f426d8d4 100644 --- a/nuon/models/app_app_secret_config.py +++ b/nuon/models/app_app_secret_config.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_app_secret_kubernetes_sync_target import AppAppSecretKubernetesSyncTarget + + T = TypeVar("T", bound="AppAppSecretConfig") @@ -31,6 +35,9 @@ class AppAppSecretConfig: kubernetes_secret_name (str | Unset): kubernetes_secret_namespace (str | Unset): kubernetes_sync (bool | Unset): for syncing into kubernetes + kubernetes_sync_targets (list[AppAppSecretKubernetesSyncTarget] | Unset): kubernetes sync v2: when present, the + secret syncs to each of these targets (namespaces x name x key). The + single-valued Kubernetes* fields above remain for backwards compatibility. name (str | Unset): org_id (str | Unset): required (bool | Unset): @@ -53,6 +60,7 @@ class AppAppSecretConfig: kubernetes_secret_name: str | Unset = UNSET kubernetes_secret_namespace: str | Unset = UNSET kubernetes_sync: bool | Unset = UNSET + kubernetes_sync_targets: list[AppAppSecretKubernetesSyncTarget] | Unset = UNSET name: str | Unset = UNSET org_id: str | Unset = UNSET required: bool | Unset = UNSET @@ -92,6 +100,13 @@ def to_dict(self) -> dict[str, Any]: kubernetes_sync = self.kubernetes_sync + kubernetes_sync_targets: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.kubernetes_sync_targets, Unset): + kubernetes_sync_targets = [] + for kubernetes_sync_targets_item_data in self.kubernetes_sync_targets: + kubernetes_sync_targets_item = kubernetes_sync_targets_item_data.to_dict() + kubernetes_sync_targets.append(kubernetes_sync_targets_item) + name = self.name org_id = self.org_id @@ -135,6 +150,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["kubernetes_secret_namespace"] = kubernetes_secret_namespace if kubernetes_sync is not UNSET: field_dict["kubernetes_sync"] = kubernetes_sync + if kubernetes_sync_targets is not UNSET: + field_dict["kubernetes_sync_targets"] = kubernetes_sync_targets if name is not UNSET: field_dict["name"] = name if org_id is not UNSET: @@ -148,6 +165,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_app_secret_kubernetes_sync_target import AppAppSecretKubernetesSyncTarget + d = dict(src_dict) app_config_id = d.pop("app_config_id", UNSET) @@ -181,6 +200,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kubernetes_sync = d.pop("kubernetes_sync", UNSET) + _kubernetes_sync_targets = d.pop("kubernetes_sync_targets", UNSET) + kubernetes_sync_targets: list[AppAppSecretKubernetesSyncTarget] | Unset = UNSET + if _kubernetes_sync_targets is not UNSET: + kubernetes_sync_targets = [] + for kubernetes_sync_targets_item_data in _kubernetes_sync_targets: + kubernetes_sync_targets_item = AppAppSecretKubernetesSyncTarget.from_dict( + kubernetes_sync_targets_item_data + ) + + kubernetes_sync_targets.append(kubernetes_sync_targets_item) + name = d.pop("name", UNSET) org_id = d.pop("org_id", UNSET) @@ -206,6 +236,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kubernetes_secret_name=kubernetes_secret_name, kubernetes_secret_namespace=kubernetes_secret_namespace, kubernetes_sync=kubernetes_sync, + kubernetes_sync_targets=kubernetes_sync_targets, name=name, org_id=org_id, required=required, diff --git a/nuon/models/app_app_secret_kubernetes_sync_target.py b/nuon/models/app_app_secret_kubernetes_sync_target.py new file mode 100644 index 00000000..76e6908b --- /dev/null +++ b/nuon/models/app_app_secret_kubernetes_sync_target.py @@ -0,0 +1,135 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AppAppSecretKubernetesSyncTarget") + + +@_attrs_define +class AppAppSecretKubernetesSyncTarget: + """ + Attributes: + app_secret_config_id (str | Unset): + created_at (str | Unset): + created_by_id (str | Unset): + id (str | Unset): + key (str | Unset): + name (str | Unset): + namespaces (list[str] | Unset): + org_id (str | Unset): + updated_at (str | Unset): + """ + + app_secret_config_id: str | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + id: str | Unset = UNSET + key: str | Unset = UNSET + name: str | Unset = UNSET + namespaces: list[str] | Unset = UNSET + org_id: str | 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_secret_config_id = self.app_secret_config_id + + created_at = self.created_at + + created_by_id = self.created_by_id + + id = self.id + + key = self.key + + name = self.name + + namespaces: list[str] | Unset = UNSET + if not isinstance(self.namespaces, Unset): + namespaces = self.namespaces + + org_id = self.org_id + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_secret_config_id is not UNSET: + field_dict["app_secret_config_id"] = app_secret_config_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 id is not UNSET: + field_dict["id"] = id + if key is not UNSET: + field_dict["key"] = key + if name is not UNSET: + field_dict["name"] = name + if namespaces is not UNSET: + field_dict["namespaces"] = namespaces + if org_id is not UNSET: + field_dict["org_id"] = org_id + 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: + d = dict(src_dict) + app_secret_config_id = d.pop("app_secret_config_id", UNSET) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + id = d.pop("id", UNSET) + + key = d.pop("key", UNSET) + + name = d.pop("name", UNSET) + + namespaces = cast(list[str], d.pop("namespaces", UNSET)) + + org_id = d.pop("org_id", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + app_app_secret_kubernetes_sync_target = cls( + app_secret_config_id=app_secret_config_id, + created_at=created_at, + created_by_id=created_by_id, + id=id, + key=key, + name=name, + namespaces=namespaces, + org_id=org_id, + updated_at=updated_at, + ) + + app_app_secret_kubernetes_sync_target.additional_properties = d + return app_app_secret_kubernetes_sync_target + + @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/config_custom_nested_stack.py b/nuon/models/config_custom_nested_stack.py index f7d45f5b..288cbbe6 100644 --- a/nuon/models/config_custom_nested_stack.py +++ b/nuon/models/config_custom_nested_stack.py @@ -6,6 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.config_custom_nested_stack_status import ConfigCustomNestedStackStatus from ..types import UNSET, Unset if TYPE_CHECKING: @@ -24,6 +25,7 @@ class ConfigCustomNestedStack: index (int | Unset): name (str | Unset): parameters (ConfigCustomNestedStackParameters | Unset): + status (ConfigCustomNestedStackStatus | Unset): template_url (str | Unset): """ @@ -32,6 +34,7 @@ class ConfigCustomNestedStack: index: int | Unset = UNSET name: str | Unset = UNSET parameters: ConfigCustomNestedStackParameters | Unset = UNSET + status: ConfigCustomNestedStackStatus | Unset = UNSET template_url: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -48,6 +51,10 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.parameters, Unset): parameters = self.parameters.to_dict() + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + template_url = self.template_url field_dict: dict[str, Any] = {} @@ -63,6 +70,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if parameters is not UNSET: field_dict["parameters"] = parameters + if status is not UNSET: + field_dict["status"] = status if template_url is not UNSET: field_dict["template_url"] = template_url @@ -88,6 +97,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: parameters = ConfigCustomNestedStackParameters.from_dict(_parameters) + _status = d.pop("status", UNSET) + status: ConfigCustomNestedStackStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = ConfigCustomNestedStackStatus(_status) + template_url = d.pop("template_url", UNSET) config_custom_nested_stack = cls( @@ -96,6 +112,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: index=index, name=name, parameters=parameters, + status=status, template_url=template_url, ) diff --git a/nuon/models/config_custom_nested_stack_status.py b/nuon/models/config_custom_nested_stack_status.py new file mode 100644 index 00000000..679def0f --- /dev/null +++ b/nuon/models/config_custom_nested_stack_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class ConfigCustomNestedStackStatus(str, Enum): + ERROR = "error" + PENDING = "pending" + READY = "ready" + + def __str__(self) -> str: + return str(self.value) diff --git a/nuon/models/plantypes_kubernetes_secret_sync.py b/nuon/models/plantypes_kubernetes_secret_sync.py index 156002fe..9f10a22f 100644 --- a/nuon/models/plantypes_kubernetes_secret_sync.py +++ b/nuon/models/plantypes_kubernetes_secret_sync.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.plantypes_kubernetes_secret_sync_target import PlantypesKubernetesSecretSyncTarget + + T = TypeVar("T", bound="PlantypesKubernetesSecretSync") @@ -22,9 +26,12 @@ class PlantypesKubernetesSecretSync: gcp_secret_name (str | Unset): projects/{project}/secrets/{id}/versions/latest key_name (str | Unset): name (str | Unset): - namespace (str | Unset): + namespace (str | Unset): v1 destination (single). Used when Targets is empty. secret_arn (str | Unset): secret_name (str | Unset): the name of the secret from the config + targets (list[PlantypesKubernetesSecretSyncTarget] | Unset): v2 destinations: when len(Targets) > 0 the runner + uses the v2 path and fans the shared source out across each + target's namespaces. The v1 fields above are ignored in that case. """ azure_key_vault_secret_id: str | Unset = UNSET @@ -35,6 +42,7 @@ class PlantypesKubernetesSecretSync: namespace: str | Unset = UNSET secret_arn: str | Unset = UNSET secret_name: str | Unset = UNSET + targets: list[PlantypesKubernetesSecretSyncTarget] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,6 +62,13 @@ def to_dict(self) -> dict[str, Any]: secret_name = self.secret_name + targets: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.targets, Unset): + targets = [] + for targets_item_data in self.targets: + targets_item = targets_item_data.to_dict() + targets.append(targets_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -73,11 +88,15 @@ def to_dict(self) -> dict[str, Any]: field_dict["secret_arn"] = secret_arn if secret_name is not UNSET: field_dict["secret_name"] = secret_name + if targets is not UNSET: + field_dict["targets"] = targets return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.plantypes_kubernetes_secret_sync_target import PlantypesKubernetesSecretSyncTarget + d = dict(src_dict) azure_key_vault_secret_id = d.pop("azure_key_vault_secret_id", UNSET) @@ -95,6 +114,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret_name = d.pop("secret_name", UNSET) + _targets = d.pop("targets", UNSET) + targets: list[PlantypesKubernetesSecretSyncTarget] | Unset = UNSET + if _targets is not UNSET: + targets = [] + for targets_item_data in _targets: + targets_item = PlantypesKubernetesSecretSyncTarget.from_dict(targets_item_data) + + targets.append(targets_item) + plantypes_kubernetes_secret_sync = cls( azure_key_vault_secret_id=azure_key_vault_secret_id, format_=format_, @@ -104,6 +132,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: namespace=namespace, secret_arn=secret_arn, secret_name=secret_name, + targets=targets, ) plantypes_kubernetes_secret_sync.additional_properties = d diff --git a/nuon/models/plantypes_kubernetes_secret_sync_target.py b/nuon/models/plantypes_kubernetes_secret_sync_target.py new file mode 100644 index 00000000..d097be4e --- /dev/null +++ b/nuon/models/plantypes_kubernetes_secret_sync_target.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PlantypesKubernetesSecretSyncTarget") + + +@_attrs_define +class PlantypesKubernetesSecretSyncTarget: + """ + Attributes: + key (str | Unset): + name (str | Unset): + namespaces (list[str] | Unset): + """ + + key: str | Unset = UNSET + name: str | Unset = UNSET + namespaces: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + key = self.key + + name = self.name + + namespaces: list[str] | Unset = UNSET + if not isinstance(self.namespaces, Unset): + namespaces = self.namespaces + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if key is not UNSET: + field_dict["key"] = key + if name is not UNSET: + field_dict["name"] = name + if namespaces is not UNSET: + field_dict["namespaces"] = namespaces + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + key = d.pop("key", UNSET) + + name = d.pop("name", UNSET) + + namespaces = cast(list[str], d.pop("namespaces", UNSET)) + + plantypes_kubernetes_secret_sync_target = cls( + key=key, + name=name, + namespaces=namespaces, + ) + + plantypes_kubernetes_secret_sync_target.additional_properties = d + return plantypes_kubernetes_secret_sync_target + + @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/plantypes_pulumi_backend.py b/nuon/models/plantypes_pulumi_backend.py new file mode 100644 index 00000000..7733370f --- /dev/null +++ b/nuon/models/plantypes_pulumi_backend.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.plantypes_pulumi_backend_config import PlantypesPulumiBackendConfig + + +T = TypeVar("T", bound="PlantypesPulumiBackend") + + +@_attrs_define +class PlantypesPulumiBackend: + """ + Attributes: + runtime (str): + stack_name (str): + workspace_id (str): + config (PlantypesPulumiBackendConfig | Unset): + pulumi_version (str | Unset): + update_plans (bool | Unset): + """ + + runtime: str + stack_name: str + workspace_id: str + config: PlantypesPulumiBackendConfig | Unset = UNSET + pulumi_version: str | Unset = UNSET + update_plans: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + runtime = self.runtime + + stack_name = self.stack_name + + workspace_id = self.workspace_id + + config: dict[str, Any] | Unset = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + pulumi_version = self.pulumi_version + + update_plans = self.update_plans + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "runtime": runtime, + "stack_name": stack_name, + "workspace_id": workspace_id, + } + ) + if config is not UNSET: + field_dict["config"] = config + if pulumi_version is not UNSET: + field_dict["pulumi_version"] = pulumi_version + if update_plans is not UNSET: + field_dict["update_plans"] = update_plans + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.plantypes_pulumi_backend_config import PlantypesPulumiBackendConfig + + d = dict(src_dict) + runtime = d.pop("runtime") + + stack_name = d.pop("stack_name") + + workspace_id = d.pop("workspace_id") + + _config = d.pop("config", UNSET) + config: PlantypesPulumiBackendConfig | Unset + if isinstance(_config, Unset): + config = UNSET + else: + config = PlantypesPulumiBackendConfig.from_dict(_config) + + pulumi_version = d.pop("pulumi_version", UNSET) + + update_plans = d.pop("update_plans", UNSET) + + plantypes_pulumi_backend = cls( + runtime=runtime, + stack_name=stack_name, + workspace_id=workspace_id, + config=config, + pulumi_version=pulumi_version, + update_plans=update_plans, + ) + + plantypes_pulumi_backend.additional_properties = d + return plantypes_pulumi_backend + + @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_mng_fetch_token_request.py b/nuon/models/plantypes_pulumi_backend_config.py similarity index 68% rename from nuon/models/service_mng_fetch_token_request.py rename to nuon/models/plantypes_pulumi_backend_config.py index 368212f9..06abea7a 100644 --- a/nuon/models/service_mng_fetch_token_request.py +++ b/nuon/models/plantypes_pulumi_backend_config.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="ServiceMngFetchTokenRequest") +T = TypeVar("T", bound="PlantypesPulumiBackendConfig") @_attrs_define -class ServiceMngFetchTokenRequest: +class PlantypesPulumiBackendConfig: """ """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -25,19 +25,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - service_mng_fetch_token_request = cls() + plantypes_pulumi_backend_config = cls() - service_mng_fetch_token_request.additional_properties = d - return service_mng_fetch_token_request + plantypes_pulumi_backend_config.additional_properties = d + return plantypes_pulumi_backend_config @property def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: + def __getitem__(self, key: str) -> str: return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: + def __setitem__(self, key: str, value: str) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/nuon/models/plantypes_pulumi_deploy_plan.py b/nuon/models/plantypes_pulumi_deploy_plan.py index d4f5dee5..6019e451 100644 --- a/nuon/models/plantypes_pulumi_deploy_plan.py +++ b/nuon/models/plantypes_pulumi_deploy_plan.py @@ -39,6 +39,7 @@ class PlantypesPulumiDeployPlan: runtime (str | Unset): stack_name (str | Unset): state (GithubComNuoncoNuonPkgTypesStateState | Unset): + update_plans (bool | Unset): workspace_id (str | Unset): Reuse workspace concept for state storage """ @@ -54,6 +55,7 @@ class PlantypesPulumiDeployPlan: runtime: str | Unset = UNSET stack_name: str | Unset = UNSET state: GithubComNuoncoNuonPkgTypesStateState | Unset = UNSET + update_plans: bool | Unset = UNSET workspace_id: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -98,6 +100,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.state, Unset): state = self.state.to_dict() + update_plans = self.update_plans + workspace_id = self.workspace_id field_dict: dict[str, Any] = {} @@ -127,6 +131,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["stack_name"] = stack_name if state is not UNSET: field_dict["state"] = state + if update_plans is not UNSET: + field_dict["update_plans"] = update_plans if workspace_id is not UNSET: field_dict["workspace_id"] = workspace_id @@ -208,6 +214,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: state = GithubComNuoncoNuonPkgTypesStateState.from_dict(_state) + update_plans = d.pop("update_plans", UNSET) + workspace_id = d.pop("workspace_id", UNSET) plantypes_pulumi_deploy_plan = cls( @@ -223,6 +231,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: runtime=runtime, stack_name=stack_name, state=state, + update_plans=update_plans, workspace_id=workspace_id, ) diff --git a/nuon/models/plantypes_pulumi_sandbox_mode.py b/nuon/models/plantypes_pulumi_sandbox_mode.py index 386ad58a..ddf649c6 100644 --- a/nuon/models/plantypes_pulumi_sandbox_mode.py +++ b/nuon/models/plantypes_pulumi_sandbox_mode.py @@ -17,10 +17,12 @@ class PlantypesPulumiSandboxMode: Attributes: plan_contents (str | Unset): plan_display_contents (str | Unset): + workspace_id (str | Unset): """ plan_contents: str | Unset = UNSET plan_display_contents: str | Unset = UNSET + workspace_id: str | 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]: plan_display_contents = self.plan_display_contents + workspace_id = self.workspace_id + 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["plan_contents"] = plan_contents if plan_display_contents is not UNSET: field_dict["plan_display_contents"] = plan_display_contents + if workspace_id is not UNSET: + field_dict["workspace_id"] = workspace_id return field_dict @@ -45,9 +51,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: plan_display_contents = d.pop("plan_display_contents", UNSET) + workspace_id = d.pop("workspace_id", UNSET) + plantypes_pulumi_sandbox_mode = cls( plan_contents=plan_contents, plan_display_contents=plan_display_contents, + workspace_id=workspace_id, ) plantypes_pulumi_sandbox_mode.additional_properties = d diff --git a/nuon/models/plantypes_sandbox_run_plan.py b/nuon/models/plantypes_sandbox_run_plan.py index 4e4deeec..cd56694e 100644 --- a/nuon/models/plantypes_sandbox_run_plan.py +++ b/nuon/models/plantypes_sandbox_run_plan.py @@ -16,6 +16,7 @@ from ..models.github_com_nuonco_nuon_pkg_gcp_credentials_config import GithubComNuoncoNuonPkgGcpCredentialsConfig from ..models.github_com_nuonco_nuon_pkg_types_state_state import GithubComNuoncoNuonPkgTypesStateState from ..models.plantypes_git_source import PlantypesGitSource + from ..models.plantypes_pulumi_backend import PlantypesPulumiBackend from ..models.plantypes_sandbox_mode import PlantypesSandboxMode from ..models.plantypes_sandbox_run_plan_env_vars import PlantypesSandboxRunPlanEnvVars from ..models.plantypes_sandbox_run_plan_policies import PlantypesSandboxRunPlanPolicies @@ -47,6 +48,7 @@ class PlantypesSandboxRunPlan: kyverno_policies_dir (str | Unset): local_archive (PlantypesTerraformLocalArchive | Unset): policies (PlantypesSandboxRunPlanPolicies | Unset): + pulumi_backend (PlantypesPulumiBackend | Unset): sandbox_mode (PlantypesSandboxMode | Unset): state (GithubComNuoncoNuonPkgTypesStateState | Unset): terraform_backend (PlantypesTerraformBackend | Unset): @@ -68,6 +70,7 @@ class PlantypesSandboxRunPlan: kyverno_policies_dir: str | Unset = UNSET local_archive: PlantypesTerraformLocalArchive | Unset = UNSET policies: PlantypesSandboxRunPlanPolicies | Unset = UNSET + pulumi_backend: PlantypesPulumiBackend | Unset = UNSET sandbox_mode: PlantypesSandboxMode | Unset = UNSET state: GithubComNuoncoNuonPkgTypesStateState | Unset = UNSET terraform_backend: PlantypesTerraformBackend | Unset = UNSET @@ -122,6 +125,10 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.policies, Unset): policies = self.policies.to_dict() + pulumi_backend: dict[str, Any] | Unset = UNSET + if not isinstance(self.pulumi_backend, Unset): + pulumi_backend = self.pulumi_backend.to_dict() + sandbox_mode: dict[str, Any] | Unset = UNSET if not isinstance(self.sandbox_mode, Unset): sandbox_mode = self.sandbox_mode.to_dict() @@ -173,6 +180,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["local_archive"] = local_archive if policies is not UNSET: field_dict["policies"] = policies + if pulumi_backend is not UNSET: + field_dict["pulumi_backend"] = pulumi_backend if sandbox_mode is not UNSET: field_dict["sandbox_mode"] = sandbox_mode if state is not UNSET: @@ -199,6 +208,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) from ..models.github_com_nuonco_nuon_pkg_types_state_state import GithubComNuoncoNuonPkgTypesStateState from ..models.plantypes_git_source import PlantypesGitSource + from ..models.plantypes_pulumi_backend import PlantypesPulumiBackend from ..models.plantypes_sandbox_mode import PlantypesSandboxMode from ..models.plantypes_sandbox_run_plan_env_vars import PlantypesSandboxRunPlanEnvVars from ..models.plantypes_sandbox_run_plan_policies import PlantypesSandboxRunPlanPolicies @@ -276,6 +286,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: policies = PlantypesSandboxRunPlanPolicies.from_dict(_policies) + _pulumi_backend = d.pop("pulumi_backend", UNSET) + pulumi_backend: PlantypesPulumiBackend | Unset + if isinstance(_pulumi_backend, Unset): + pulumi_backend = UNSET + else: + pulumi_backend = PlantypesPulumiBackend.from_dict(_pulumi_backend) + _sandbox_mode = d.pop("sandbox_mode", UNSET) sandbox_mode: PlantypesSandboxMode | Unset if isinstance(_sandbox_mode, Unset): @@ -321,6 +338,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kyverno_policies_dir=kyverno_policies_dir, local_archive=local_archive, policies=policies, + pulumi_backend=pulumi_backend, sandbox_mode=sandbox_mode, state=state, terraform_backend=terraform_backend, diff --git a/nuon/models/service_app_secret_config.py b/nuon/models/service_app_secret_config.py index d79ab592..d660f7cb 100644 --- a/nuon/models/service_app_secret_config.py +++ b/nuon/models/service_app_secret_config.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.service_kubernetes_sync_target import ServiceKubernetesSyncTarget + + T = TypeVar("T", bound="ServiceAppSecretConfig") @@ -24,6 +28,7 @@ class ServiceAppSecretConfig: kubernetes_secret_name (str | Unset): kubernetes_secret_namespace (str | Unset): kubernetes_sync (bool | Unset): + kubernetes_sync_targets (list[ServiceKubernetesSyncTarget] | Unset): required (bool | Unset): """ @@ -36,6 +41,7 @@ class ServiceAppSecretConfig: kubernetes_secret_name: str | Unset = UNSET kubernetes_secret_namespace: str | Unset = UNSET kubernetes_sync: bool | Unset = UNSET + kubernetes_sync_targets: list[ServiceKubernetesSyncTarget] | Unset = UNSET required: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -58,6 +64,13 @@ def to_dict(self) -> dict[str, Any]: kubernetes_sync = self.kubernetes_sync + kubernetes_sync_targets: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.kubernetes_sync_targets, Unset): + kubernetes_sync_targets = [] + for kubernetes_sync_targets_item_data in self.kubernetes_sync_targets: + kubernetes_sync_targets_item = kubernetes_sync_targets_item_data.to_dict() + kubernetes_sync_targets.append(kubernetes_sync_targets_item) + required = self.required field_dict: dict[str, Any] = {} @@ -81,6 +94,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["kubernetes_secret_namespace"] = kubernetes_secret_namespace if kubernetes_sync is not UNSET: field_dict["kubernetes_sync"] = kubernetes_sync + if kubernetes_sync_targets is not UNSET: + field_dict["kubernetes_sync_targets"] = kubernetes_sync_targets if required is not UNSET: field_dict["required"] = required @@ -88,6 +103,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_kubernetes_sync_target import ServiceKubernetesSyncTarget + d = dict(src_dict) description = d.pop("description") @@ -107,6 +124,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kubernetes_sync = d.pop("kubernetes_sync", UNSET) + _kubernetes_sync_targets = d.pop("kubernetes_sync_targets", UNSET) + kubernetes_sync_targets: list[ServiceKubernetesSyncTarget] | Unset = UNSET + if _kubernetes_sync_targets is not UNSET: + kubernetes_sync_targets = [] + for kubernetes_sync_targets_item_data in _kubernetes_sync_targets: + kubernetes_sync_targets_item = ServiceKubernetesSyncTarget.from_dict(kubernetes_sync_targets_item_data) + + kubernetes_sync_targets.append(kubernetes_sync_targets_item) + required = d.pop("required", UNSET) service_app_secret_config = cls( @@ -119,6 +145,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kubernetes_secret_name=kubernetes_secret_name, kubernetes_secret_namespace=kubernetes_secret_namespace, kubernetes_sync=kubernetes_sync, + kubernetes_sync_targets=kubernetes_sync_targets, required=required, ) diff --git a/nuon/models/service_create_app_runner_config_request.py b/nuon/models/service_create_app_runner_config_request.py index cd5270e0..66253dcd 100644 --- a/nuon/models/service_create_app_runner_config_request.py +++ b/nuon/models/service_create_app_runner_config_request.py @@ -26,6 +26,7 @@ class ServiceCreateAppRunnerConfigRequest: env_vars (ServiceCreateAppRunnerConfigRequestEnvVars | Unset): helm_driver (AppAppRunnerConfigHelmDriverType | Unset): init_script_url (str | Unset): + instance_type (str | Unset): """ type_: AppAppRunnerType @@ -33,6 +34,7 @@ class ServiceCreateAppRunnerConfigRequest: env_vars: ServiceCreateAppRunnerConfigRequestEnvVars | Unset = UNSET helm_driver: AppAppRunnerConfigHelmDriverType | Unset = UNSET init_script_url: str | Unset = UNSET + instance_type: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,6 +52,8 @@ def to_dict(self) -> dict[str, Any]: init_script_url = self.init_script_url + instance_type = self.instance_type + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -65,6 +69,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["helm_driver"] = helm_driver if init_script_url is not UNSET: field_dict["init_script_url"] = init_script_url + if instance_type is not UNSET: + field_dict["instance_type"] = instance_type return field_dict @@ -95,12 +101,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: init_script_url = d.pop("init_script_url", UNSET) + instance_type = d.pop("instance_type", UNSET) + service_create_app_runner_config_request = cls( type_=type_, app_config_id=app_config_id, env_vars=env_vars, helm_driver=helm_driver, init_script_url=init_script_url, + instance_type=instance_type, ) service_create_app_runner_config_request.additional_properties = d diff --git a/nuon/models/service_create_app_sandbox_config_request.py b/nuon/models/service_create_app_sandbox_config_request.py index 674ee7f1..81bf37eb 100644 --- a/nuon/models/service_create_app_sandbox_config_request.py +++ b/nuon/models/service_create_app_sandbox_config_request.py @@ -15,6 +15,9 @@ from ..models.service_create_app_sandbox_config_request_operation_roles import ( ServiceCreateAppSandboxConfigRequestOperationRoles, ) + from ..models.service_create_app_sandbox_config_request_pulumi_config import ( + ServiceCreateAppSandboxConfigRequestPulumiConfig, + ) from ..models.service_create_app_sandbox_config_request_variables import ( ServiceCreateAppSandboxConfigRequestVariables, ) @@ -28,7 +31,6 @@ class ServiceCreateAppSandboxConfigRequest: """ Attributes: env_vars (ServiceCreateAppSandboxConfigRequestEnvVars): - terraform_version (str): variables (ServiceCreateAppSandboxConfigRequestVariables): app_config_id (str | Unset): auto_approve_on_policies_passing (bool | Unset): @@ -37,13 +39,17 @@ class ServiceCreateAppSandboxConfigRequest: max_auto_retries (int | Unset): operation_roles (ServiceCreateAppSandboxConfigRequestOperationRoles | Unset): public_git_vcs_config (HelpersPublicGitVCSConfigRequest | Unset): + pulumi_config (ServiceCreateAppSandboxConfigRequestPulumiConfig | Unset): + pulumi_version (str | Unset): references (list[str] | Unset): + runtime (str | Unset): skip_noops (bool | Unset): + terraform_version (str | Unset): + type_ (str | Unset): variables_files (list[str] | Unset): """ env_vars: ServiceCreateAppSandboxConfigRequestEnvVars - terraform_version: str variables: ServiceCreateAppSandboxConfigRequestVariables app_config_id: str | Unset = UNSET auto_approve_on_policies_passing: bool | Unset = UNSET @@ -52,16 +58,19 @@ class ServiceCreateAppSandboxConfigRequest: max_auto_retries: int | Unset = UNSET operation_roles: ServiceCreateAppSandboxConfigRequestOperationRoles | Unset = UNSET public_git_vcs_config: HelpersPublicGitVCSConfigRequest | Unset = UNSET + pulumi_config: ServiceCreateAppSandboxConfigRequestPulumiConfig | Unset = UNSET + pulumi_version: str | Unset = UNSET references: list[str] | Unset = UNSET + runtime: str | Unset = UNSET skip_noops: bool | Unset = UNSET + terraform_version: str | Unset = UNSET + type_: str | Unset = UNSET variables_files: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: env_vars = self.env_vars.to_dict() - terraform_version = self.terraform_version - variables = self.variables.to_dict() app_config_id = self.app_config_id @@ -84,12 +93,24 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.public_git_vcs_config, Unset): public_git_vcs_config = self.public_git_vcs_config.to_dict() + pulumi_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.pulumi_config, Unset): + pulumi_config = self.pulumi_config.to_dict() + + pulumi_version = self.pulumi_version + references: list[str] | Unset = UNSET if not isinstance(self.references, Unset): references = self.references + runtime = self.runtime + skip_noops = self.skip_noops + terraform_version = self.terraform_version + + type_ = self.type_ + variables_files: list[str] | Unset = UNSET if not isinstance(self.variables_files, Unset): variables_files = self.variables_files @@ -99,7 +120,6 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "env_vars": env_vars, - "terraform_version": terraform_version, "variables": variables, } ) @@ -117,10 +137,20 @@ def to_dict(self) -> dict[str, Any]: field_dict["operation_roles"] = operation_roles if public_git_vcs_config is not UNSET: field_dict["public_git_vcs_config"] = public_git_vcs_config + if pulumi_config is not UNSET: + field_dict["pulumi_config"] = pulumi_config + if pulumi_version is not UNSET: + field_dict["pulumi_version"] = pulumi_version if references is not UNSET: field_dict["references"] = references + if runtime is not UNSET: + field_dict["runtime"] = runtime if skip_noops is not UNSET: field_dict["skip_noops"] = skip_noops + if terraform_version is not UNSET: + field_dict["terraform_version"] = terraform_version + if type_ is not UNSET: + field_dict["type"] = type_ if variables_files is not UNSET: field_dict["variables_files"] = variables_files @@ -136,6 +166,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.service_create_app_sandbox_config_request_operation_roles import ( ServiceCreateAppSandboxConfigRequestOperationRoles, ) + from ..models.service_create_app_sandbox_config_request_pulumi_config import ( + ServiceCreateAppSandboxConfigRequestPulumiConfig, + ) from ..models.service_create_app_sandbox_config_request_variables import ( ServiceCreateAppSandboxConfigRequestVariables, ) @@ -143,8 +176,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) env_vars = ServiceCreateAppSandboxConfigRequestEnvVars.from_dict(d.pop("env_vars")) - terraform_version = d.pop("terraform_version") - variables = ServiceCreateAppSandboxConfigRequestVariables.from_dict(d.pop("variables")) app_config_id = d.pop("app_config_id", UNSET) @@ -176,15 +207,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: public_git_vcs_config = HelpersPublicGitVCSConfigRequest.from_dict(_public_git_vcs_config) + _pulumi_config = d.pop("pulumi_config", UNSET) + pulumi_config: ServiceCreateAppSandboxConfigRequestPulumiConfig | Unset + if isinstance(_pulumi_config, Unset): + pulumi_config = UNSET + else: + pulumi_config = ServiceCreateAppSandboxConfigRequestPulumiConfig.from_dict(_pulumi_config) + + pulumi_version = d.pop("pulumi_version", UNSET) + references = cast(list[str], d.pop("references", UNSET)) + runtime = d.pop("runtime", UNSET) + skip_noops = d.pop("skip_noops", UNSET) + terraform_version = d.pop("terraform_version", UNSET) + + type_ = d.pop("type", UNSET) + variables_files = cast(list[str], d.pop("variables_files", UNSET)) service_create_app_sandbox_config_request = cls( env_vars=env_vars, - terraform_version=terraform_version, variables=variables, app_config_id=app_config_id, auto_approve_on_policies_passing=auto_approve_on_policies_passing, @@ -193,8 +238,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: max_auto_retries=max_auto_retries, operation_roles=operation_roles, public_git_vcs_config=public_git_vcs_config, + pulumi_config=pulumi_config, + pulumi_version=pulumi_version, references=references, + runtime=runtime, skip_noops=skip_noops, + terraform_version=terraform_version, + type_=type_, variables_files=variables_files, ) diff --git a/nuon/models/service_create_app_sandbox_config_request_pulumi_config.py b/nuon/models/service_create_app_sandbox_config_request_pulumi_config.py new file mode 100644 index 00000000..fb030b17 --- /dev/null +++ b/nuon/models/service_create_app_sandbox_config_request_pulumi_config.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="ServiceCreateAppSandboxConfigRequestPulumiConfig") + + +@_attrs_define +class ServiceCreateAppSandboxConfigRequestPulumiConfig: + """ """ + + additional_properties: dict[str, str] = _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) + service_create_app_sandbox_config_request_pulumi_config = cls() + + service_create_app_sandbox_config_request_pulumi_config.additional_properties = d + return service_create_app_sandbox_config_request_pulumi_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> 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_kubernetes_sync_target.py b/nuon/models/service_kubernetes_sync_target.py new file mode 100644 index 00000000..8ed8f7d1 --- /dev/null +++ b/nuon/models/service_kubernetes_sync_target.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ServiceKubernetesSyncTarget") + + +@_attrs_define +class ServiceKubernetesSyncTarget: + """ + Attributes: + key (str): + name (str): + namespaces (list[str]): + """ + + key: str + name: str + namespaces: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + key = self.key + + name = self.name + + namespaces = self.namespaces + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "key": key, + "name": name, + "namespaces": namespaces, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + key = d.pop("key") + + name = d.pop("name") + + namespaces = cast(list[str], d.pop("namespaces")) + + service_kubernetes_sync_target = cls( + key=key, + name=name, + namespaces=namespaces, + ) + + service_kubernetes_sync_target.additional_properties = d + return service_kubernetes_sync_target + + @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_update_install_inputs_request.py b/nuon/models/service_update_install_inputs_request.py index cfc6a0d2..862be24e 100644 --- a/nuon/models/service_update_install_inputs_request.py +++ b/nuon/models/service_update_install_inputs_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 @@ -20,19 +20,23 @@ class ServiceUpdateInstallInputsRequest: """ Attributes: inputs (ServiceUpdateInstallInputsRequestInputs): - deploy_dependents (bool | Unset): + deploy_dependents (bool | None | Unset): role (str | Unset): """ inputs: ServiceUpdateInstallInputsRequestInputs - deploy_dependents: bool | Unset = UNSET + deploy_dependents: bool | None | Unset = UNSET role: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: inputs = self.inputs.to_dict() - deploy_dependents = self.deploy_dependents + deploy_dependents: bool | None | Unset + if isinstance(self.deploy_dependents, Unset): + deploy_dependents = UNSET + else: + deploy_dependents = self.deploy_dependents role = self.role @@ -57,7 +61,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) inputs = ServiceUpdateInstallInputsRequestInputs.from_dict(d.pop("inputs")) - deploy_dependents = d.pop("deploy_dependents", UNSET) + def _parse_deploy_dependents(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + deploy_dependents = _parse_deploy_dependents(d.pop("deploy_dependents", UNSET)) role = d.pop("role", UNSET) diff --git a/pyproject.toml b/pyproject.toml index c4e5c65c..d759508f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.985" +version = "0.19.987" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index 37f07e26..b970383d 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.985 +0.19.987