diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index bf73d42a..62b7c44c 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -199,97 +199,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_app_app.py -test/test_app_app_input.py -test/test_app_app_input_config.py -test/test_app_app_installer.py -test/test_app_app_installer_metadata.py -test/test_app_app_runner_config.py -test/test_app_app_runner_type.py -test/test_app_app_sandbox_config.py -test/test_app_aws_account.py -test/test_app_awsecr_image_config.py -test/test_app_component.py -test/test_app_component_build.py -test/test_app_component_config_connection.py -test/test_app_component_release.py -test/test_app_component_release_step.py -test/test_app_connected_github_vcs_config.py -test/test_app_docker_build_component_config.py -test/test_app_external_image_component_config.py -test/test_app_helm_component_config.py -test/test_app_install.py -test/test_app_install_component.py -test/test_app_install_deploy.py -test/test_app_install_deploy_type.py -test/test_app_install_inputs.py -test/test_app_install_sandbox_run.py -test/test_app_job_component_config.py -test/test_app_org.py -test/test_app_public_git_vcs_config.py -test/test_app_sandbox.py -test/test_app_sandbox_release.py -test/test_app_sandbox_run_type.py -test/test_app_terraform_module_component_config.py -test/test_app_user_org.py -test/test_app_user_token.py -test/test_app_vcs_connection.py -test/test_app_vcs_connection_commit.py -test/test_apps_api.py -test/test_components_api.py -test/test_general_api.py -test/test_installs_api.py -test/test_metrics_decr.py -test/test_metrics_event.py -test/test_metrics_incr.py -test/test_metrics_timing.py -test/test_orgs_api.py -test/test_planv1_plan.py -test/test_releases_api.py -test/test_sandboxes_api.py -test/test_service_app_input_request.py -test/test_service_app_installer.py -test/test_service_aws_ecr_image_config_request.py -test/test_service_cli_config.py -test/test_service_connected_github_vcs_config_request.py -test/test_service_connected_github_vcs_sandbox_config_request.py -test/test_service_create_app_input_config_request.py -test/test_service_create_app_installer_request.py -test/test_service_create_app_installer_request_links.py -test/test_service_create_app_request.py -test/test_service_create_app_runner_config_request.py -test/test_service_create_app_sandbox_config_request.py -test/test_service_create_component_build_request.py -test/test_service_create_component_release_request.py -test/test_service_create_component_release_request_strategy.py -test/test_service_create_component_request.py -test/test_service_create_connection_callback_request.py -test/test_service_create_connection_request.py -test/test_service_create_docker_build_component_config_request.py -test/test_service_create_external_image_component_config_request.py -test/test_service_create_helm_component_config_request.py -test/test_service_create_install_deploy_request.py -test/test_service_create_install_inputs_request.py -test/test_service_create_install_request.py -test/test_service_create_install_request_aws_account.py -test/test_service_create_job_component_config_request.py -test/test_service_create_org_request.py -test/test_service_create_org_user_request.py -test/test_service_create_terraform_module_component_config_request.py -test/test_service_installer_create_install_request.py -test/test_service_public_git_vcs_config_request.py -test/test_service_public_git_vcs_sandbox_config_request.py -test/test_service_publish_metric_input.py -test/test_service_repository.py -test/test_service_update_app_installer_request.py -test/test_service_update_app_installer_request_links.py -test/test_service_update_app_request.py -test/test_service_update_component_request.py -test/test_service_update_install_request.py -test/test_service_update_org_request.py -test/test_statsd_event.py -test/test_statsd_event_alert_type.py -test/test_statsd_event_priority.py -test/test_stderr_err_response.py -test/test_vcs_api.py tox.ini diff --git a/docs/AppsApi.md b/docs/AppsApi.md index b28bc96d..712adda2 100644 --- a/docs/AppsApi.md +++ b/docs/AppsApi.md @@ -36,6 +36,8 @@ create an app * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app import AppApp from nuon.models.service_create_app_request import ServiceCreateAppRequest @@ -126,6 +128,8 @@ Name | Type | Description | Notes * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_input_config import AppAppInputConfig from nuon.models.service_create_app_input_config_request import ServiceCreateAppInputConfigRequest @@ -217,6 +221,8 @@ create an app installer * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_installer import AppAppInstaller from nuon.models.service_create_app_installer_request import ServiceCreateAppInstallerRequest @@ -309,6 +315,8 @@ create an app runner config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_runner_config import AppAppRunnerConfig from nuon.models.service_create_app_runner_config_request import ServiceCreateAppRunnerConfigRequest @@ -401,6 +409,8 @@ create an app sandbox config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_sandbox_config import AppAppSandboxConfig from nuon.models.service_create_app_sandbox_config_request import ServiceCreateAppSandboxConfigRequest @@ -493,6 +503,8 @@ delete an app * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -581,6 +593,8 @@ delete an app installer * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -669,6 +683,8 @@ get an app * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app import AppApp from nuon.rest import ApiException @@ -758,6 +774,8 @@ get app input configs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_input_config import AppAppInputConfig from nuon.rest import ApiException @@ -847,6 +865,8 @@ get latest app input config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_input_config import AppAppInputConfig from nuon.rest import ApiException @@ -936,6 +956,8 @@ get an app installer * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_installer import AppAppInstaller from nuon.rest import ApiException @@ -1025,6 +1047,8 @@ get app runner configs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_runner_config import AppAppRunnerConfig from nuon.rest import ApiException @@ -1114,6 +1138,8 @@ get latest app runner config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_runner_config import AppAppRunnerConfig from nuon.rest import ApiException @@ -1203,6 +1229,8 @@ get app sandbox configs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_sandbox_config import AppAppSandboxConfig from nuon.rest import ApiException @@ -1292,6 +1320,8 @@ get latest app sandbox config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_sandbox_config import AppAppSandboxConfig from nuon.rest import ApiException @@ -1381,6 +1411,8 @@ get all apps for the current org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app import AppApp from nuon.rest import ApiException @@ -1464,6 +1496,8 @@ render an app installer ```python +import time +import os import nuon from nuon.models.service_app_installer import ServiceAppInstaller from nuon.rest import ApiException @@ -1537,6 +1571,8 @@ update an app * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app import AppApp from nuon.models.service_update_app_request import ServiceUpdateAppRequest @@ -1629,6 +1665,8 @@ update an app installer * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_app_installer import AppAppInstaller from nuon.models.service_update_app_installer_request import ServiceUpdateAppInstallerRequest diff --git a/docs/ComponentsApi.md b/docs/ComponentsApi.md index bf749a68..8c7cb059 100644 --- a/docs/ComponentsApi.md +++ b/docs/ComponentsApi.md @@ -37,6 +37,8 @@ create a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component import AppComponent from nuon.models.service_create_component_request import ServiceCreateComponentRequest @@ -129,6 +131,8 @@ create component build * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_build import AppComponentBuild from nuon.models.service_create_component_build_request import ServiceCreateComponentBuildRequest @@ -221,6 +225,8 @@ create a docker build component config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_docker_build_component_config import AppDockerBuildComponentConfig from nuon.models.service_create_docker_build_component_config_request import ServiceCreateDockerBuildComponentConfigRequest @@ -313,6 +319,8 @@ create an external image component config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_external_image_component_config import AppExternalImageComponentConfig from nuon.models.service_create_external_image_component_config_request import ServiceCreateExternalImageComponentConfigRequest @@ -405,6 +413,8 @@ create a helm component config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_helm_component_config import AppHelmComponentConfig from nuon.models.service_create_helm_component_config_request import ServiceCreateHelmComponentConfigRequest @@ -497,6 +507,8 @@ create a job component config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_job_component_config import AppJobComponentConfig from nuon.models.service_create_job_component_config_request import ServiceCreateJobComponentConfigRequest @@ -589,6 +601,8 @@ create a terraform component config * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_terraform_module_component_config import AppTerraformModuleComponentConfig from nuon.models.service_create_terraform_module_component_config_request import ServiceCreateTerraformModuleComponentConfigRequest @@ -681,6 +695,8 @@ delete a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -769,6 +785,8 @@ get all components for an app * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component import AppComponent from nuon.rest import ApiException @@ -858,6 +876,8 @@ get a build * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_build import AppComponentBuild from nuon.rest import ApiException @@ -947,6 +967,8 @@ get a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component import AppComponent from nuon.rest import ApiException @@ -1036,6 +1058,8 @@ get a build for a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_build import AppComponentBuild from nuon.rest import ApiException @@ -1127,6 +1151,8 @@ get component build logs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -1217,6 +1243,8 @@ get component build plan * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.planv1_plan import Planv1Plan from nuon.rest import ApiException @@ -1308,6 +1336,8 @@ get all builds for a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_build import AppComponentBuild from nuon.rest import ApiException @@ -1397,6 +1427,8 @@ get all configs for a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_config_connection import AppComponentConfigConnection from nuon.rest import ApiException @@ -1486,6 +1518,8 @@ get latest build for a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_build import AppComponentBuild from nuon.rest import ApiException @@ -1575,6 +1609,8 @@ get latest config for a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_config_connection import AppComponentConfigConnection from nuon.rest import ApiException @@ -1664,6 +1700,8 @@ get all components for an org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component import AppComponent from nuon.rest import ApiException @@ -1749,6 +1787,8 @@ update a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component import AppComponent from nuon.models.service_update_component_request import ServiceUpdateComponentRequest diff --git a/docs/GeneralApi.md b/docs/GeneralApi.md index 731bd643..900d9ba2 100644 --- a/docs/GeneralApi.md +++ b/docs/GeneralApi.md @@ -18,6 +18,8 @@ Get config for cli ```python +import time +import os import nuon from nuon.models.service_cli_config import ServiceCLIConfig from nuon.rest import ApiException @@ -86,6 +88,8 @@ Get current user * Api Key Authentication (APIKey): ```python +import time +import os import nuon from nuon.models.app_user_token import AppUserToken from nuon.rest import ApiException @@ -164,6 +168,8 @@ Publish a metric from different Nuon clients for telemetry purposes. * Api Key Authentication (APIKey): ```python +import time +import os import nuon from nuon.models.service_publish_metric_input import ServicePublishMetricInput from nuon.rest import ApiException diff --git a/docs/InstallsApi.md b/docs/InstallsApi.md index 4eb5515c..948ced8a 100644 --- a/docs/InstallsApi.md +++ b/docs/InstallsApi.md @@ -41,6 +41,8 @@ create an app install * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install import AppInstall from nuon.models.service_create_install_request import ServiceCreateInstallRequest @@ -133,6 +135,8 @@ deploy a build to an install * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_deploy import AppInstallDeploy from nuon.models.service_create_install_deploy_request import ServiceCreateInstallDeployRequest @@ -225,6 +229,8 @@ create install inputs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_inputs import AppInstallInputs from nuon.models.service_create_install_inputs_request import ServiceCreateInstallInputsRequest @@ -317,6 +323,8 @@ delete an install * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -405,6 +413,8 @@ get all installs for an app * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install import AppInstall from nuon.rest import ApiException @@ -494,6 +504,8 @@ get an installs current inputs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_inputs import AppInstallInputs from nuon.rest import ApiException @@ -583,6 +595,8 @@ get an install * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install import AppInstall from nuon.rest import ApiException @@ -672,6 +686,8 @@ get an install component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_component import AppInstallComponent from nuon.rest import ApiException @@ -763,6 +779,8 @@ get an install components deploys * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_deploy import AppInstallDeploy from nuon.rest import ApiException @@ -854,6 +872,8 @@ get the latest deploy for an install component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_deploy import AppInstallDeploy from nuon.rest import ApiException @@ -945,6 +965,8 @@ get an installs components * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_component import AppInstallComponent from nuon.rest import ApiException @@ -1034,6 +1056,8 @@ get an install deploy * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_deploy import AppInstallDeploy from nuon.rest import ApiException @@ -1125,6 +1149,8 @@ get install deploy logs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -1215,6 +1241,8 @@ get install deploy plan * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.planv1_plan import Planv1Plan from nuon.rest import ApiException @@ -1306,6 +1334,8 @@ get all deploys to an install * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_deploy import AppInstallDeploy from nuon.rest import ApiException @@ -1395,6 +1425,8 @@ get an installs inputs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_inputs import AppInstallInputs from nuon.rest import ApiException @@ -1484,6 +1516,8 @@ get an install deploy * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_deploy import AppInstallDeploy from nuon.rest import ApiException @@ -1573,6 +1607,8 @@ get install sandbox run logs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -1663,6 +1699,8 @@ get an installs sandbox runs * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_sandbox_run import AppInstallSandboxRun from nuon.rest import ApiException @@ -1752,6 +1790,8 @@ get all installs for an org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install import AppInstall from nuon.rest import ApiException @@ -1835,6 +1875,8 @@ create an app install from an installer ```python +import time +import os import nuon from nuon.models.app_install import AppInstall from nuon.models.service_installer_create_install_request import ServiceInstallerCreateInstallRequest @@ -1909,6 +1951,8 @@ get an installer install ```python +import time +import os import nuon from nuon.models.app_install import AppInstall from nuon.rest import ApiException @@ -1984,6 +2028,8 @@ teardown an install component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install_deploy import AppInstallDeploy from nuon.rest import ApiException @@ -2075,6 +2121,8 @@ update an install * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_install import AppInstall from nuon.models.service_update_install_request import ServiceUpdateInstallRequest diff --git a/docs/OrgsApi.md b/docs/OrgsApi.md index 5696d034..575850c7 100644 --- a/docs/OrgsApi.md +++ b/docs/OrgsApi.md @@ -23,6 +23,8 @@ Add a user to the current org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_user_org import AppUserOrg from nuon.models.service_create_org_user_request import ServiceCreateOrgUserRequest @@ -112,6 +114,8 @@ create a new org * Api Key Authentication (APIKey): ```python +import time +import os import nuon from nuon.models.app_org import AppOrg from nuon.models.service_create_org_request import ServiceCreateOrgRequest @@ -196,6 +200,8 @@ Delete an org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.rest import ApiException from pprint import pprint @@ -280,6 +286,8 @@ Get an org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_org import AppOrg from nuon.rest import ApiException @@ -364,6 +372,8 @@ Return current user's orgs * Api Key Authentication (APIKey): ```python +import time +import os import nuon from nuon.models.app_org import AppOrg from nuon.rest import ApiException @@ -443,6 +453,8 @@ Update current org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_org import AppOrg from nuon.models.service_update_org_request import ServiceUpdateOrgRequest diff --git a/docs/ReleasesApi.md b/docs/ReleasesApi.md index 7d8a13a4..dc73df07 100644 --- a/docs/ReleasesApi.md +++ b/docs/ReleasesApi.md @@ -22,6 +22,8 @@ create a release * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_release import AppComponentRelease from nuon.models.service_create_component_release_request import ServiceCreateComponentReleaseRequest @@ -114,6 +116,8 @@ get all releases for an app * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_release import AppComponentRelease from nuon.rest import ApiException @@ -203,6 +207,8 @@ get all releases for a component * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_release import AppComponentRelease from nuon.rest import ApiException @@ -292,6 +298,8 @@ get a release * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_release import AppComponentRelease from nuon.rest import ApiException @@ -381,6 +389,8 @@ get a release * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_component_release_step import AppComponentReleaseStep from nuon.rest import ApiException diff --git a/docs/SandboxesApi.md b/docs/SandboxesApi.md index ba185f7b..b0137ce7 100644 --- a/docs/SandboxesApi.md +++ b/docs/SandboxesApi.md @@ -19,6 +19,8 @@ get a sandbox * Api Key Authentication (APIKey): ```python +import time +import os import nuon from nuon.models.app_sandbox import AppSandbox from nuon.rest import ApiException @@ -101,6 +103,8 @@ get sandbox releases * Api Key Authentication (APIKey): ```python +import time +import os import nuon from nuon.models.app_sandbox_release import AppSandboxRelease from nuon.rest import ApiException @@ -182,6 +186,8 @@ get all sandboxes ```python +import time +import os import nuon from nuon.models.app_sandbox import AppSandbox from nuon.rest import ApiException diff --git a/docs/VcsApi.md b/docs/VcsApi.md index 7205405d..be4927ad 100644 --- a/docs/VcsApi.md +++ b/docs/VcsApi.md @@ -22,6 +22,8 @@ create a vcs connection for Github * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_vcs_connection import AppVCSConnection from nuon.models.service_create_connection_request import ServiceCreateConnectionRequest @@ -110,6 +112,8 @@ public connection to create a vcs connection via a callback ```python +import time +import os import nuon from nuon.models.app_vcs_connection import AppVCSConnection from nuon.models.service_create_connection_callback_request import ServiceCreateConnectionCallbackRequest @@ -184,6 +188,8 @@ get all vcs connected repos for an org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.service_repository import ServiceRepository from nuon.rest import ApiException @@ -269,6 +275,8 @@ get vcs connection for an org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_vcs_connection import AppVCSConnection from nuon.rest import ApiException @@ -354,6 +362,8 @@ returns a vcs connection for an org * Api Key Authentication (OrgID): ```python +import time +import os import nuon from nuon.models.app_vcs_connection import AppVCSConnection from nuon.rest import ApiException diff --git a/nuon/__init__.py b/nuon/__init__.py index 083bf85c..b37c22a3 100644 --- a/nuon/__init__.py +++ b/nuon/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "1.0.0" +__version__ = "0.19.15" # import apis into sdk package from nuon.api.apps_api import AppsApi diff --git a/nuon/api/apps_api.py b/nuon/api/apps_api.py index 4070cba4..ca5d7b1c 100644 --- a/nuon/api/apps_api.py +++ b/nuon/api/apps_api.py @@ -12,10 +12,17 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field, StrictStr from typing_extensions import Annotated @@ -33,7 +40,7 @@ from nuon.models.service_update_app_installer_request import ServiceUpdateAppInstallerRequest from nuon.models.service_update_app_request import ServiceUpdateAppRequest -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -267,7 +274,7 @@ def _create_app_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -564,7 +571,7 @@ def _create_app_input_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -863,7 +870,7 @@ def _create_app_installer_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1162,7 +1169,7 @@ def _create_app_runner_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1461,7 +1468,7 @@ def _create_app_sandbox_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1747,7 +1754,7 @@ def _delete_app_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2018,7 +2025,7 @@ def _delete_app_installer_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2289,7 +2296,7 @@ def _get_app_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2560,7 +2567,7 @@ def _get_app_input_configs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2831,7 +2838,7 @@ def _get_app_input_latest_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3102,7 +3109,7 @@ def _get_app_installer_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3373,7 +3380,7 @@ def _get_app_runner_configs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3644,7 +3651,7 @@ def _get_app_runner_latest_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3915,7 +3922,7 @@ def _get_app_sandbox_configs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4186,7 +4193,7 @@ def _get_app_sandbox_latest_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4444,7 +4451,7 @@ def _get_apps_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4713,7 +4720,7 @@ def _render_app_installer_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4995,7 +5002,7 @@ def _update_app_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5294,7 +5301,7 @@ def _update_app_installer_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api/components_api.py b/nuon/api/components_api.py index a110a813..a008c254 100644 --- a/nuon/api/components_api.py +++ b/nuon/api/components_api.py @@ -12,10 +12,17 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field, StrictStr from typing_extensions import Annotated @@ -37,7 +44,7 @@ from nuon.models.service_create_terraform_module_component_config_request import ServiceCreateTerraformModuleComponentConfigRequest from nuon.models.service_update_component_request import ServiceUpdateComponentRequest -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -284,7 +291,7 @@ def _create_component_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -583,7 +590,7 @@ def _create_component_build_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -882,7 +889,7 @@ def _create_docker_build_component_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1181,7 +1188,7 @@ def _create_external_image_component_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1480,7 +1487,7 @@ def _create_helm_component_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1779,7 +1786,7 @@ def _create_job_component_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2078,7 +2085,7 @@ def _create_terraform_module_component_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2364,7 +2371,7 @@ def _delete_component_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2635,7 +2642,7 @@ def _get_app_components_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2906,7 +2913,7 @@ def _get_build_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3177,7 +3184,7 @@ def _get_component_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3461,7 +3468,7 @@ def _get_component_build_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3747,7 +3754,7 @@ def _get_component_build_logs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4033,7 +4040,7 @@ def _get_component_build_plan_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4306,7 +4313,7 @@ def _get_component_builds_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4577,7 +4584,7 @@ def _get_component_configs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4848,7 +4855,7 @@ def _get_component_latest_build_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5119,7 +5126,7 @@ def _get_component_latest_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5377,7 +5384,7 @@ def _get_org_components_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5659,7 +5666,7 @@ def _update_component_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api/general_api.py b/nuon/api/general_api.py index dab9cb63..489128b4 100644 --- a/nuon/api/general_api.py +++ b/nuon/api/general_api.py @@ -12,10 +12,17 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field from typing import List @@ -24,7 +31,7 @@ from nuon.models.service_cli_config import ServiceCLIConfig from nuon.models.service_publish_metric_input import ServicePublishMetricInput -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -245,7 +252,7 @@ def _get_cli_config_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -499,7 +506,7 @@ def _get_current_user_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -767,7 +774,7 @@ def _publish_metrics_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api/installs_api.py b/nuon/api/installs_api.py index e15c8c1f..be6fbda4 100644 --- a/nuon/api/installs_api.py +++ b/nuon/api/installs_api.py @@ -12,10 +12,17 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field, StrictStr from typing_extensions import Annotated @@ -31,7 +38,7 @@ from nuon.models.service_installer_create_install_request import ServiceInstallerCreateInstallRequest from nuon.models.service_update_install_request import ServiceUpdateInstallRequest -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -278,7 +285,7 @@ def _create_install_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -577,7 +584,7 @@ def _create_install_deploy_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -876,7 +883,7 @@ def _create_install_inputs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1162,7 +1169,7 @@ def _delete_install_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1433,7 +1440,7 @@ def _get_app_installs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1704,7 +1711,7 @@ def _get_current_install_inputs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1975,7 +1982,7 @@ def _get_install_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2259,7 +2266,7 @@ def _get_install_component_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2545,7 +2552,7 @@ def _get_install_component_deploys_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -2831,7 +2838,7 @@ def _get_install_component_latest_deploy_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3104,7 +3111,7 @@ def _get_install_components_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3388,7 +3395,7 @@ def _get_install_deploy_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3674,7 +3681,7 @@ def _get_install_deploy_logs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -3960,7 +3967,7 @@ def _get_install_deploy_plan_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4233,7 +4240,7 @@ def _get_install_deploys_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4504,7 +4511,7 @@ def _get_install_inputs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -4775,7 +4782,7 @@ def _get_install_latest_deploy_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5059,7 +5066,7 @@ def _get_install_sandbox_run_logs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5332,7 +5339,7 @@ def _get_install_sandbox_runs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5590,7 +5597,7 @@ def _get_org_installs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -5872,7 +5879,7 @@ def _installer_create_installer_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -6169,7 +6176,7 @@ def _installer_get_install_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -6453,7 +6460,7 @@ def _teardown_install_component_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -6739,7 +6746,7 @@ def _update_install_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api/orgs_api.py b/nuon/api/orgs_api.py index 1000f666..40a7d6bc 100644 --- a/nuon/api/orgs_api.py +++ b/nuon/api/orgs_api.py @@ -12,10 +12,17 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field from typing_extensions import Annotated @@ -25,7 +32,7 @@ from nuon.models.service_create_org_user_request import ServiceCreateOrgUserRequest from nuon.models.service_update_org_request import ServiceUpdateOrgRequest -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -259,7 +266,7 @@ def _add_user_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -543,7 +550,7 @@ def _create_org_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -813,7 +820,7 @@ def _delete_org_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1069,7 +1076,7 @@ def _get_org_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1325,7 +1332,7 @@ def _get_orgs_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1593,7 +1600,7 @@ def _update_org_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api/releases_api.py b/nuon/api/releases_api.py index ee83e094..6e4f5aa6 100644 --- a/nuon/api/releases_api.py +++ b/nuon/api/releases_api.py @@ -12,10 +12,17 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field, StrictStr from typing_extensions import Annotated @@ -23,7 +30,7 @@ from nuon.models.app_component_release_step import AppComponentReleaseStep from nuon.models.service_create_component_release_request import ServiceCreateComponentReleaseRequest -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -270,7 +277,7 @@ def _create_component_release_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -556,7 +563,7 @@ def _get_app_releases_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -827,7 +834,7 @@ def _get_component_releases_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1098,7 +1105,7 @@ def _get_release_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1369,7 +1376,7 @@ def _get_release_steps_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api/sandboxes_api.py b/nuon/api/sandboxes_api.py index 409a2687..e88e5c65 100644 --- a/nuon/api/sandboxes_api.py +++ b/nuon/api/sandboxes_api.py @@ -12,17 +12,24 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field, StrictStr from typing_extensions import Annotated from nuon.models.app_sandbox import AppSandbox from nuon.models.app_sandbox_release import AppSandboxRelease -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -256,7 +263,7 @@ def _get_sandbox_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -526,7 +533,7 @@ def _get_sandbox_releases_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -768,7 +775,7 @@ def _get_sandboxes_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api/vcs_api.py b/nuon/api/vcs_api.py index 232609dc..93c6dc06 100644 --- a/nuon/api/vcs_api.py +++ b/nuon/api/vcs_api.py @@ -12,10 +12,17 @@ Do not edit the class manually. """ # noqa: E501 + +import io import warnings + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated from pydantic import Field, StrictStr from typing_extensions import Annotated @@ -24,7 +31,7 @@ from nuon.models.service_create_connection_request import ServiceCreateConnectionRequest from nuon.models.service_repository import ServiceRepository -from nuon.api_client import ApiClient, RequestSerialized +from nuon.api_client import ApiClient from nuon.api_response import ApiResponse from nuon.rest import RESTResponseType @@ -258,7 +265,7 @@ def _create_vcs_connection_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -542,7 +549,7 @@ def _create_vcs_connection_callback_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -811,7 +818,7 @@ def _get_all_vcs_connected_repos_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1067,7 +1074,7 @@ def _get_org_vcs_connections_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None @@ -1336,7 +1343,7 @@ def _get_vcs_connection_serialize( _content_type, _headers, _host_index, - ) -> RequestSerialized: + ) -> Tuple: _host = None diff --git a/nuon/api_client.py b/nuon/api_client.py index 380dea82..ecdaaa03 100644 --- a/nuon/api_client.py +++ b/nuon/api_client.py @@ -13,6 +13,7 @@ """ # noqa: E501 +import atexit import datetime from dateutil.parser import parse import json @@ -22,10 +23,10 @@ import tempfile from urllib.parse import quote -from typing import Tuple, Optional, List, Dict +from typing import Tuple, Optional, List from nuon.configuration import Configuration -from nuon.api_response import ApiResponse, T as ApiResponseT +from nuon.api_response import ApiResponse import nuon.models from nuon import rest from nuon.exceptions import ( @@ -38,7 +39,6 @@ ServiceException ) -RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: """Generic API client for OpenAPI client library builds. @@ -87,7 +87,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.user_agent = 'OpenAPI-Generator/0.19.15/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -148,7 +148,7 @@ def param_serialize( collection_formats=None, _host=None, _request_auth=None - ) -> RequestSerialized: + ) -> Tuple: """Builds the HTTP request params needed by the request. :param method: Method to call. @@ -274,23 +274,23 @@ def call_api( ) except ApiException as e: + if e.body: + e.body = e.body.decode('utf-8') raise e return response_data def response_deserialize( self, - response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]]=None - ) -> ApiResponse[ApiResponseT]: + response_data: rest.RESTResponse = None, + response_types_map=None + ) -> ApiResponse: """Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. :param response_types_map: dict of response types. :return: ApiResponse """ - msg = "RESTResponse.read() must be called before passing it to response_deserialize()" - assert response_data.data is not None, msg response_type = response_types_map.get(str(response_data.status), None) if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: @@ -403,16 +403,12 @@ def __deserialize(self, data, klass): if isinstance(klass, str): if klass.startswith('List['): - m = re.match(r'List\[(.*)]', klass) - assert m is not None, "Malformed List type definition" - sub_kls = m.group(1) + sub_kls = re.match(r'List\[(.*)]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('Dict['): - m = re.match(r'Dict\[([^,]*), (.*)]', klass) - assert m is not None, "Malformed Dict type definition" - sub_kls = m.group(2) + sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} @@ -440,7 +436,7 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params: List[Tuple[str, str]] = [] + new_params = [] if collection_formats is None: collection_formats = {} for k, v in params.items() if isinstance(params, dict) else params: @@ -470,7 +466,7 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params: List[Tuple[str, str]] = [] + new_params = [] if collection_formats is None: collection_formats = {} for k, v in params.items() if isinstance(params, dict) else params: @@ -655,12 +651,10 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - m = re.search( + filename = re.search( r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition - ) - assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) + ).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: diff --git a/nuon/api_response.py b/nuon/api_response.py index 9bc7c11f..2ac1ada6 100644 --- a/nuon/api_response.py +++ b/nuon/api_response.py @@ -1,8 +1,8 @@ """API response object.""" from __future__ import annotations -from typing import Optional, Generic, Mapping, TypeVar -from pydantic import Field, StrictInt, StrictBytes, BaseModel +from typing import Any, Dict, Optional, Generic, TypeVar +from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel T = TypeVar("T") @@ -12,7 +12,7 @@ class ApiResponse(BaseModel, Generic[T]): """ status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") data: T = Field(description="Deserialized data given the data type") raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") diff --git a/nuon/configuration.py b/nuon/configuration.py index 4a6ca914..aa6701f8 100644 --- a/nuon/configuration.py +++ b/nuon/configuration.py @@ -15,10 +15,8 @@ import copy import logging -from logging import FileHandler import multiprocessing import sys -from typing import Optional import urllib3 import http.client as httplib @@ -138,7 +136,7 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler: Optional[FileHandler] = None + self.logger_file_handler = None """Log file handler """ self.logger_file = None @@ -178,7 +176,7 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy: Optional[str] = None + self.proxy = None """Proxy URL """ self.proxy_headers = None @@ -409,7 +407,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.19.15\n"\ - "SDK Package Version: 1.0.0".\ + "SDK Package Version: 0.19.15".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/nuon/exceptions.py b/nuon/exceptions.py index f95cca7b..3cb662e1 100644 --- a/nuon/exceptions.py +++ b/nuon/exceptions.py @@ -13,6 +13,7 @@ """ # noqa: E501 from typing import Any, Optional + from typing_extensions import Self class OpenApiException(Exception): diff --git a/nuon/models/app_app.py b/nuon/models/app_app.py index 4d64dd88..eed138b0 100644 --- a/nuon/models/app_app.py +++ b/nuon/models/app_app.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppApp(BaseModel): """ @@ -54,7 +59,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppApp from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,18 +73,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppApp from a dict""" if obj is None: return None diff --git a/nuon/models/app_app_input.py b/nuon/models/app_app_input.py index 7b7f1c9d..ee3220bb 100644 --- a/nuon/models/app_app_input.py +++ b/nuon/models/app_app_input.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAppInput(BaseModel): """ @@ -56,7 +61,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAppInput from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -70,18 +75,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAppInput from a dict""" if obj is None: return None diff --git a/nuon/models/app_app_input_config.py b/nuon/models/app_app_input_config.py index 81d5edc3..2d9ed832 100644 --- a/nuon/models/app_app_input_config.py +++ b/nuon/models/app_app_input_config.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_app_input import AppAppInput -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAppInputConfig(BaseModel): """ @@ -54,7 +59,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAppInputConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,12 +73,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in app_inputs (list) @@ -86,7 +89,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAppInputConfig from a dict""" if obj is None: return None @@ -96,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "app_id": obj.get("app_id"), - "app_inputs": [AppAppInput.from_dict(_item) for _item in obj["app_inputs"]] if obj.get("app_inputs") is not None else None, + "app_inputs": [AppAppInput.from_dict(_item) for _item in obj.get("app_inputs")] if obj.get("app_inputs") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), diff --git a/nuon/models/app_app_installer.py b/nuon/models/app_app_installer.py index bab8df9f..2845f12d 100644 --- a/nuon/models/app_app_installer.py +++ b/nuon/models/app_app_installer.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_app import AppApp from nuon.models.app_app_installer_metadata import AppAppInstallerMetadata -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAppInstaller(BaseModel): """ @@ -57,7 +62,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAppInstaller from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,12 +76,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of app @@ -88,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAppInstaller from a dict""" if obj is None: return None @@ -97,9 +100,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "app": AppApp.from_dict(obj["app"]) if obj.get("app") is not None else None, + "app": AppApp.from_dict(obj.get("app")) if obj.get("app") is not None else None, "app_id": obj.get("app_id"), - "app_installer_metadata": AppAppInstallerMetadata.from_dict(obj["app_installer_metadata"]) if obj.get("app_installer_metadata") is not None else None, + "app_installer_metadata": AppAppInstallerMetadata.from_dict(obj.get("app_installer_metadata")) if obj.get("app_installer_metadata") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), diff --git a/nuon/models/app_app_installer_metadata.py b/nuon/models/app_app_installer_metadata.py index 8c1285e2..1f52a4e1 100644 --- a/nuon/models/app_app_installer_metadata.py +++ b/nuon/models/app_app_installer_metadata.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAppInstallerMetadata(BaseModel): """ @@ -59,7 +64,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAppInstallerMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -73,18 +78,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAppInstallerMetadata from a dict""" if obj is None: return None diff --git a/nuon/models/app_app_runner_config.py b/nuon/models/app_app_runner_config.py index fe2d2d8c..c5b80bcf 100644 --- a/nuon/models/app_app_runner_config.py +++ b/nuon/models/app_app_runner_config.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_app_runner_type import AppAppRunnerType -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAppRunnerConfig(BaseModel): """ @@ -55,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAppRunnerConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,18 +74,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAppRunnerConfig from a dict""" if obj is None: return None diff --git a/nuon/models/app_app_runner_type.py b/nuon/models/app_app_runner_type.py index f14aaee4..58fae5c9 100644 --- a/nuon/models/app_app_runner_type.py +++ b/nuon/models/app_app_runner_type.py @@ -15,8 +15,16 @@ from __future__ import annotations import json +import pprint +import re # noqa: F401 from enum import Enum -from typing_extensions import Self + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAppRunnerType(str, Enum): diff --git a/nuon/models/app_app_sandbox_config.py b/nuon/models/app_app_sandbox_config.py index e56455f0..0278bb75 100644 --- a/nuon/models/app_app_sandbox_config.py +++ b/nuon/models/app_app_sandbox_config.py @@ -18,13 +18,18 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_connected_github_vcs_config import AppConnectedGithubVCSConfig from nuon.models.app_public_git_vcs_config import AppPublicGitVCSConfig from nuon.models.app_sandbox_release import AppSandboxRelease -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAppSandboxConfig(BaseModel): """ @@ -61,7 +66,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAppSandboxConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -75,12 +80,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -95,7 +98,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAppSandboxConfig from a dict""" if obj is None: return None @@ -105,13 +108,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "app_id": obj.get("app_id"), - "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, + "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), "org_id": obj.get("org_id"), - "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, - "sandbox_release": AppSandboxRelease.from_dict(obj["sandbox_release"]) if obj.get("sandbox_release") is not None else None, + "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, + "sandbox_release": AppSandboxRelease.from_dict(obj.get("sandbox_release")) if obj.get("sandbox_release") is not None else None, "sandbox_release_id": obj.get("sandbox_release_id"), "terraform_version": obj.get("terraform_version"), "updated_at": obj.get("updated_at"), diff --git a/nuon/models/app_aws_account.py b/nuon/models/app_aws_account.py index a9888c37..9b6817a1 100644 --- a/nuon/models/app_aws_account.py +++ b/nuon/models/app_aws_account.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAWSAccount(BaseModel): """ @@ -52,7 +57,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAWSAccount from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -66,18 +71,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAWSAccount from a dict""" if obj is None: return None diff --git a/nuon/models/app_awsecr_image_config.py b/nuon/models/app_awsecr_image_config.py index 0b76732a..e217785f 100644 --- a/nuon/models/app_awsecr_image_config.py +++ b/nuon/models/app_awsecr_image_config.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppAWSECRImageConfig(BaseModel): """ @@ -54,7 +59,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppAWSECRImageConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,18 +73,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppAWSECRImageConfig from a dict""" if obj is None: return None diff --git a/nuon/models/app_component.py b/nuon/models/app_component.py index cf9bb6d4..1cd300ac 100644 --- a/nuon/models/app_component.py +++ b/nuon/models/app_component.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppComponent(BaseModel): """ @@ -56,7 +61,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppComponent from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -70,18 +75,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppComponent from a dict""" if obj is None: return None diff --git a/nuon/models/app_component_build.py b/nuon/models/app_component_build.py index 1aa8cd42..8a99b784 100644 --- a/nuon/models/app_component_build.py +++ b/nuon/models/app_component_build.py @@ -18,13 +18,18 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_component_release import AppComponentRelease from nuon.models.app_install_deploy import AppInstallDeploy from nuon.models.app_vcs_connection_commit import AppVCSConnectionCommit -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppComponentBuild(BaseModel): """ @@ -61,7 +66,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppComponentBuild from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -75,12 +80,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in install_deploys (list) @@ -103,7 +106,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppComponentBuild from a dict""" if obj is None: return None @@ -118,12 +121,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "created_by_id": obj.get("created_by_id"), "git_ref": obj.get("git_ref"), "id": obj.get("id"), - "install_deploys": [AppInstallDeploy.from_dict(_item) for _item in obj["install_deploys"]] if obj.get("install_deploys") is not None else None, - "releases": [AppComponentRelease.from_dict(_item) for _item in obj["releases"]] if obj.get("releases") is not None else None, + "install_deploys": [AppInstallDeploy.from_dict(_item) for _item in obj.get("install_deploys")] if obj.get("install_deploys") is not None else None, + "releases": [AppComponentRelease.from_dict(_item) for _item in obj.get("releases")] if obj.get("releases") is not None else None, "status": obj.get("status"), "status_description": obj.get("status_description"), "updated_at": obj.get("updated_at"), - "vcs_connection_commit": AppVCSConnectionCommit.from_dict(obj["vcs_connection_commit"]) if obj.get("vcs_connection_commit") is not None else None + "vcs_connection_commit": AppVCSConnectionCommit.from_dict(obj.get("vcs_connection_commit")) if obj.get("vcs_connection_commit") is not None else None }) return _obj diff --git a/nuon/models/app_component_config_connection.py b/nuon/models/app_component_config_connection.py index 02ee9b02..8d44e5bd 100644 --- a/nuon/models/app_component_config_connection.py +++ b/nuon/models/app_component_config_connection.py @@ -18,6 +18,9 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_docker_build_component_config import AppDockerBuildComponentConfig @@ -25,8 +28,10 @@ from nuon.models.app_helm_component_config import AppHelmComponentConfig from nuon.models.app_job_component_config import AppJobComponentConfig from nuon.models.app_terraform_module_component_config import AppTerraformModuleComponentConfig -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppComponentConfigConnection(BaseModel): """ @@ -61,7 +66,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppComponentConfigConnection from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -75,12 +80,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of docker_build @@ -101,7 +104,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppComponentConfigConnection from a dict""" if obj is None: return None @@ -113,12 +116,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "component_id": obj.get("component_id"), "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), - "docker_build": AppDockerBuildComponentConfig.from_dict(obj["docker_build"]) if obj.get("docker_build") is not None else None, - "external_image": AppExternalImageComponentConfig.from_dict(obj["external_image"]) if obj.get("external_image") is not None else None, - "helm": AppHelmComponentConfig.from_dict(obj["helm"]) if obj.get("helm") is not None else None, + "docker_build": AppDockerBuildComponentConfig.from_dict(obj.get("docker_build")) if obj.get("docker_build") is not None else None, + "external_image": AppExternalImageComponentConfig.from_dict(obj.get("external_image")) if obj.get("external_image") is not None else None, + "helm": AppHelmComponentConfig.from_dict(obj.get("helm")) if obj.get("helm") is not None else None, "id": obj.get("id"), - "job": AppJobComponentConfig.from_dict(obj["job"]) if obj.get("job") is not None else None, - "terraform_module": AppTerraformModuleComponentConfig.from_dict(obj["terraform_module"]) if obj.get("terraform_module") is not None else None, + "job": AppJobComponentConfig.from_dict(obj.get("job")) if obj.get("job") is not None else None, + "terraform_module": AppTerraformModuleComponentConfig.from_dict(obj.get("terraform_module")) if obj.get("terraform_module") is not None else None, "updated_at": obj.get("updated_at") }) return _obj diff --git a/nuon/models/app_component_release.py b/nuon/models/app_component_release.py index f64e6668..cc786705 100644 --- a/nuon/models/app_component_release.py +++ b/nuon/models/app_component_release.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_component_release_step import AppComponentReleaseStep -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppComponentRelease(BaseModel): """ @@ -56,7 +61,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppComponentRelease from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -70,12 +75,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in release_steps (list) @@ -88,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppComponentRelease from a dict""" if obj is None: return None @@ -101,7 +104,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), - "release_steps": [AppComponentReleaseStep.from_dict(_item) for _item in obj["release_steps"]] if obj.get("release_steps") is not None else None, + "release_steps": [AppComponentReleaseStep.from_dict(_item) for _item in obj.get("release_steps")] if obj.get("release_steps") is not None else None, "status": obj.get("status"), "status_description": obj.get("status_description"), "total_release_steps": obj.get("total_release_steps"), diff --git a/nuon/models/app_component_release_step.py b/nuon/models/app_component_release_step.py index 65f85155..2b12794d 100644 --- a/nuon/models/app_component_release_step.py +++ b/nuon/models/app_component_release_step.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_install_deploy import AppInstallDeploy -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppComponentReleaseStep(BaseModel): """ @@ -57,7 +62,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppComponentReleaseStep from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,12 +76,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in install_deploys (list) @@ -89,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppComponentReleaseStep from a dict""" if obj is None: return None @@ -103,7 +106,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "created_by_id": obj.get("created_by_id"), "delay": obj.get("delay"), "id": obj.get("id"), - "install_deploys": [AppInstallDeploy.from_dict(_item) for _item in obj["install_deploys"]] if obj.get("install_deploys") is not None else None, + "install_deploys": [AppInstallDeploy.from_dict(_item) for _item in obj.get("install_deploys")] if obj.get("install_deploys") is not None else None, "requested_install_ids": obj.get("requested_install_ids"), "status": obj.get("status"), "status_description": obj.get("status_description"), diff --git a/nuon/models/app_connected_github_vcs_config.py b/nuon/models/app_connected_github_vcs_config.py index 7cb2833e..ffd6f0d6 100644 --- a/nuon/models/app_connected_github_vcs_config.py +++ b/nuon/models/app_connected_github_vcs_config.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_vcs_connection import AppVCSConnection -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppConnectedGithubVCSConfig(BaseModel): """ @@ -60,7 +65,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppConnectedGithubVCSConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -74,12 +79,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of vcs_connection @@ -88,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppConnectedGithubVCSConfig from a dict""" if obj is None: return None @@ -108,7 +111,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "repo_name": obj.get("repo_name"), "repo_owner": obj.get("repo_owner"), "updated_at": obj.get("updated_at"), - "vcs_connection": AppVCSConnection.from_dict(obj["vcs_connection"]) if obj.get("vcs_connection") is not None else None, + "vcs_connection": AppVCSConnection.from_dict(obj.get("vcs_connection")) if obj.get("vcs_connection") is not None else None, "vcs_connection_id": obj.get("vcs_connection_id") }) return _obj diff --git a/nuon/models/app_docker_build_component_config.py b/nuon/models/app_docker_build_component_config.py index 446ee74c..2add2dbe 100644 --- a/nuon/models/app_docker_build_component_config.py +++ b/nuon/models/app_docker_build_component_config.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_connected_github_vcs_config import AppConnectedGithubVCSConfig from nuon.models.app_public_git_vcs_config import AppPublicGitVCSConfig -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppDockerBuildComponentConfig(BaseModel): """ @@ -59,7 +64,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppDockerBuildComponentConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -73,12 +78,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -90,7 +93,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppDockerBuildComponentConfig from a dict""" if obj is None: return None @@ -101,13 +104,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "build_args": obj.get("build_args"), "component_config_connection_id": obj.get("component_config_connection_id"), - "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, + "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "dockerfile": obj.get("dockerfile"), "env_vars": obj.get("env_vars"), "id": obj.get("id"), - "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, + "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, "target": obj.get("target"), "updated_at": obj.get("updated_at") }) diff --git a/nuon/models/app_external_image_component_config.py b/nuon/models/app_external_image_component_config.py index 7cbf95da..91b7c26e 100644 --- a/nuon/models/app_external_image_component_config.py +++ b/nuon/models/app_external_image_component_config.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_awsecr_image_config import AppAWSECRImageConfig -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppExternalImageComponentConfig(BaseModel): """ @@ -55,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppExternalImageComponentConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,12 +74,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of aws_ecr_image_config @@ -83,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppExternalImageComponentConfig from a dict""" if obj is None: return None @@ -92,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "aws_ecr_image_config": AppAWSECRImageConfig.from_dict(obj["aws_ecr_image_config"]) if obj.get("aws_ecr_image_config") is not None else None, + "aws_ecr_image_config": AppAWSECRImageConfig.from_dict(obj.get("aws_ecr_image_config")) if obj.get("aws_ecr_image_config") is not None else None, "component_config_connection_id": obj.get("component_config_connection_id"), "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), diff --git a/nuon/models/app_helm_component_config.py b/nuon/models/app_helm_component_config.py index 4b06f552..27eb9b21 100644 --- a/nuon/models/app_helm_component_config.py +++ b/nuon/models/app_helm_component_config.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_connected_github_vcs_config import AppConnectedGithubVCSConfig from nuon.models.app_public_git_vcs_config import AppPublicGitVCSConfig -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppHelmComponentConfig(BaseModel): """ @@ -57,7 +62,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppHelmComponentConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,12 +76,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -88,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppHelmComponentConfig from a dict""" if obj is None: return None @@ -99,11 +102,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "chart_name": obj.get("chart_name"), "component_config_connection_id": obj.get("component_config_connection_id"), - "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, + "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), - "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, + "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, "updated_at": obj.get("updated_at"), "values": obj.get("values") }) diff --git a/nuon/models/app_install.py b/nuon/models/app_install.py index 74024bfc..5a699a9e 100644 --- a/nuon/models/app_install.py +++ b/nuon/models/app_install.py @@ -18,6 +18,9 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_app_runner_config import AppAppRunnerConfig @@ -26,8 +29,10 @@ from nuon.models.app_install_component import AppInstallComponent from nuon.models.app_install_inputs import AppInstallInputs from nuon.models.app_install_sandbox_run import AppInstallSandboxRun -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppInstall(BaseModel): """ @@ -66,7 +71,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppInstall from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -80,12 +85,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of app_runner_config @@ -121,7 +124,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppInstall from a dict""" if obj is None: return None @@ -131,15 +134,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "app_id": obj.get("app_id"), - "app_runner_config": AppAppRunnerConfig.from_dict(obj["app_runner_config"]) if obj.get("app_runner_config") is not None else None, - "app_sandbox_config": AppAppSandboxConfig.from_dict(obj["app_sandbox_config"]) if obj.get("app_sandbox_config") is not None else None, - "aws_account": AppAWSAccount.from_dict(obj["aws_account"]) if obj.get("aws_account") is not None else None, + "app_runner_config": AppAppRunnerConfig.from_dict(obj.get("app_runner_config")) if obj.get("app_runner_config") is not None else None, + "app_sandbox_config": AppAppSandboxConfig.from_dict(obj.get("app_sandbox_config")) if obj.get("app_sandbox_config") is not None else None, + "aws_account": AppAWSAccount.from_dict(obj.get("aws_account")) if obj.get("aws_account") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), - "install_components": [AppInstallComponent.from_dict(_item) for _item in obj["install_components"]] if obj.get("install_components") is not None else None, - "install_inputs": [AppInstallInputs.from_dict(_item) for _item in obj["install_inputs"]] if obj.get("install_inputs") is not None else None, - "install_sandbox_runs": [AppInstallSandboxRun.from_dict(_item) for _item in obj["install_sandbox_runs"]] if obj.get("install_sandbox_runs") is not None else None, + "install_components": [AppInstallComponent.from_dict(_item) for _item in obj.get("install_components")] if obj.get("install_components") is not None else None, + "install_inputs": [AppInstallInputs.from_dict(_item) for _item in obj.get("install_inputs")] if obj.get("install_inputs") is not None else None, + "install_sandbox_runs": [AppInstallSandboxRun.from_dict(_item) for _item in obj.get("install_sandbox_runs")] if obj.get("install_sandbox_runs") is not None else None, "name": obj.get("name"), "status": obj.get("status"), "status_description": obj.get("status_description"), diff --git a/nuon/models/app_install_component.py b/nuon/models/app_install_component.py index 553e8be9..ba7864e8 100644 --- a/nuon/models/app_install_component.py +++ b/nuon/models/app_install_component.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_component import AppComponent from nuon.models.app_install_deploy import AppInstallDeploy -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppInstallComponent(BaseModel): """ @@ -56,7 +61,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppInstallComponent from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -70,12 +75,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of component @@ -91,7 +94,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppInstallComponent from a dict""" if obj is None: return None @@ -100,12 +103,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "component": AppComponent.from_dict(obj["component"]) if obj.get("component") is not None else None, + "component": AppComponent.from_dict(obj.get("component")) if obj.get("component") is not None else None, "component_id": obj.get("component_id"), "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), - "install_deploys": [AppInstallDeploy.from_dict(_item) for _item in obj["install_deploys"]] if obj.get("install_deploys") is not None else None, + "install_deploys": [AppInstallDeploy.from_dict(_item) for _item in obj.get("install_deploys")] if obj.get("install_deploys") is not None else None, "install_id": obj.get("install_id"), "updated_at": obj.get("updated_at") }) diff --git a/nuon/models/app_install_deploy.py b/nuon/models/app_install_deploy.py index b5dcd5e6..1b1254ce 100644 --- a/nuon/models/app_install_deploy.py +++ b/nuon/models/app_install_deploy.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_install_deploy_type import AppInstallDeployType -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppInstallDeploy(BaseModel): """ @@ -60,7 +65,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppInstallDeploy from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -74,18 +79,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppInstallDeploy from a dict""" if obj is None: return None diff --git a/nuon/models/app_install_deploy_type.py b/nuon/models/app_install_deploy_type.py index a232879f..9acf8de5 100644 --- a/nuon/models/app_install_deploy_type.py +++ b/nuon/models/app_install_deploy_type.py @@ -15,8 +15,16 @@ from __future__ import annotations import json +import pprint +import re # noqa: F401 from enum import Enum -from typing_extensions import Self + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppInstallDeployType(str, Enum): diff --git a/nuon/models/app_install_inputs.py b/nuon/models/app_install_inputs.py index 16684dd0..dd0d6c05 100644 --- a/nuon/models/app_install_inputs.py +++ b/nuon/models/app_install_inputs.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppInstallInputs(BaseModel): """ @@ -53,7 +58,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppInstallInputs from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,18 +72,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppInstallInputs from a dict""" if obj is None: return None diff --git a/nuon/models/app_install_sandbox_run.py b/nuon/models/app_install_sandbox_run.py index 2182307c..5590e629 100644 --- a/nuon/models/app_install_sandbox_run.py +++ b/nuon/models/app_install_sandbox_run.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_app_sandbox_config import AppAppSandboxConfig from nuon.models.app_sandbox_run_type import AppSandboxRunType -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppInstallSandboxRun(BaseModel): """ @@ -57,7 +62,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppInstallSandboxRun from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -71,12 +76,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of app_sandbox_config @@ -85,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppInstallSandboxRun from a dict""" if obj is None: return None @@ -94,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "app_sandbox_config": AppAppSandboxConfig.from_dict(obj["app_sandbox_config"]) if obj.get("app_sandbox_config") is not None else None, + "app_sandbox_config": AppAppSandboxConfig.from_dict(obj.get("app_sandbox_config")) if obj.get("app_sandbox_config") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "id": obj.get("id"), diff --git a/nuon/models/app_job_component_config.py b/nuon/models/app_job_component_config.py index 08b5ca32..b963c2e1 100644 --- a/nuon/models/app_job_component_config.py +++ b/nuon/models/app_job_component_config.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppJobComponentConfig(BaseModel): """ @@ -56,7 +61,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppJobComponentConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -70,18 +75,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppJobComponentConfig from a dict""" if obj is None: return None diff --git a/nuon/models/app_org.py b/nuon/models/app_org.py index 2df00d8d..01ba02aa 100644 --- a/nuon/models/app_org.py +++ b/nuon/models/app_org.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_user_org import AppUserOrg from nuon.models.app_vcs_connection import AppVCSConnection -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppOrg(BaseModel): """ @@ -59,7 +64,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppOrg from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -73,12 +78,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in users (list) @@ -98,7 +101,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppOrg from a dict""" if obj is None: return None @@ -116,8 +119,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "status_description": obj.get("status_description"), "updated_at": obj.get("updated_at"), - "users": [AppUserOrg.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None, - "vcs_connections": [AppVCSConnection.from_dict(_item) for _item in obj["vcs_connections"]] if obj.get("vcs_connections") is not None else None + "users": [AppUserOrg.from_dict(_item) for _item in obj.get("users")] if obj.get("users") is not None else None, + "vcs_connections": [AppVCSConnection.from_dict(_item) for _item in obj.get("vcs_connections")] if obj.get("vcs_connections") is not None else None }) return _obj diff --git a/nuon/models/app_public_git_vcs_config.py b/nuon/models/app_public_git_vcs_config.py index 37f33d05..21fd485d 100644 --- a/nuon/models/app_public_git_vcs_config.py +++ b/nuon/models/app_public_git_vcs_config.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppPublicGitVCSConfig(BaseModel): """ @@ -55,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppPublicGitVCSConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,18 +74,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppPublicGitVCSConfig from a dict""" if obj is None: return None diff --git a/nuon/models/app_sandbox.py b/nuon/models/app_sandbox.py index 34fb9d26..a457370e 100644 --- a/nuon/models/app_sandbox.py +++ b/nuon/models/app_sandbox.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_sandbox_release import AppSandboxRelease -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppSandbox(BaseModel): """ @@ -54,7 +59,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppSandbox from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,12 +73,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in releases (list) @@ -86,7 +89,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppSandbox from a dict""" if obj is None: return None @@ -100,7 +103,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "description": obj.get("description"), "id": obj.get("id"), "name": obj.get("name"), - "releases": [AppSandboxRelease.from_dict(_item) for _item in obj["releases"]] if obj.get("releases") is not None else None, + "releases": [AppSandboxRelease.from_dict(_item) for _item in obj.get("releases")] if obj.get("releases") is not None else None, "updated_at": obj.get("updated_at") }) return _obj diff --git a/nuon/models/app_sandbox_release.py b/nuon/models/app_sandbox_release.py index c52e8e2f..9aafd68c 100644 --- a/nuon/models/app_sandbox_release.py +++ b/nuon/models/app_sandbox_release.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppSandboxRelease(BaseModel): """ @@ -55,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppSandboxRelease from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,18 +74,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppSandboxRelease from a dict""" if obj is None: return None diff --git a/nuon/models/app_sandbox_run_type.py b/nuon/models/app_sandbox_run_type.py index 889a6a50..7270d3ef 100644 --- a/nuon/models/app_sandbox_run_type.py +++ b/nuon/models/app_sandbox_run_type.py @@ -15,8 +15,16 @@ from __future__ import annotations import json +import pprint +import re # noqa: F401 from enum import Enum -from typing_extensions import Self + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppSandboxRunType(str, Enum): diff --git a/nuon/models/app_terraform_module_component_config.py b/nuon/models/app_terraform_module_component_config.py index 99c465e1..bdb2f2bb 100644 --- a/nuon/models/app_terraform_module_component_config.py +++ b/nuon/models/app_terraform_module_component_config.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_connected_github_vcs_config import AppConnectedGithubVCSConfig from nuon.models.app_public_git_vcs_config import AppPublicGitVCSConfig -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppTerraformModuleComponentConfig(BaseModel): """ @@ -58,7 +63,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppTerraformModuleComponentConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -72,12 +77,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -89,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppTerraformModuleComponentConfig from a dict""" if obj is None: return None @@ -99,12 +102,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "component_config_connection_id": obj.get("component_config_connection_id"), - "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, + "connected_github_vcs_config": AppConnectedGithubVCSConfig.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, "created_at": obj.get("created_at"), "created_by_id": obj.get("created_by_id"), "env_vars": obj.get("env_vars"), "id": obj.get("id"), - "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, + "public_git_vcs_config": AppPublicGitVCSConfig.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, "updated_at": obj.get("updated_at"), "variables": obj.get("variables"), "version": obj.get("version") diff --git a/nuon/models/app_user_org.py b/nuon/models/app_user_org.py index 7aaffb8f..ca278e58 100644 --- a/nuon/models/app_user_org.py +++ b/nuon/models/app_user_org.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppUserOrg(BaseModel): """ @@ -52,7 +57,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppUserOrg from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -66,18 +71,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppUserOrg from a dict""" if obj is None: return None diff --git a/nuon/models/app_user_token.py b/nuon/models/app_user_token.py index 9780ceab..ba28aca3 100644 --- a/nuon/models/app_user_token.py +++ b/nuon/models/app_user_token.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppUserToken(BaseModel): """ @@ -55,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppUserToken from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,18 +74,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppUserToken from a dict""" if obj is None: return None diff --git a/nuon/models/app_vcs_connection.py b/nuon/models/app_vcs_connection.py index 79cab443..b0e909da 100644 --- a/nuon/models/app_vcs_connection.py +++ b/nuon/models/app_vcs_connection.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_vcs_connection_commit import AppVCSConnectionCommit -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppVCSConnection(BaseModel): """ @@ -53,7 +58,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppVCSConnection from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,12 +72,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each item in vcs_connection_commit (list) @@ -85,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppVCSConnection from a dict""" if obj is None: return None @@ -99,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "github_install_id": obj.get("github_install_id"), "id": obj.get("id"), "updated_at": obj.get("updated_at"), - "vcs_connection_commit": [AppVCSConnectionCommit.from_dict(_item) for _item in obj["vcs_connection_commit"]] if obj.get("vcs_connection_commit") is not None else None + "vcs_connection_commit": [AppVCSConnectionCommit.from_dict(_item) for _item in obj.get("vcs_connection_commit")] if obj.get("vcs_connection_commit") is not None else None }) return _obj diff --git a/nuon/models/app_vcs_connection_commit.py b/nuon/models/app_vcs_connection_commit.py index 65a8a04b..31e8ecaa 100644 --- a/nuon/models/app_vcs_connection_commit.py +++ b/nuon/models/app_vcs_connection_commit.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class AppVCSConnectionCommit(BaseModel): """ @@ -55,7 +60,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of AppVCSConnectionCommit from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -69,18 +74,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of AppVCSConnectionCommit from a dict""" if obj is None: return None diff --git a/nuon/models/metrics_decr.py b/nuon/models/metrics_decr.py index adbcee1f..cb9f5477 100644 --- a/nuon/models/metrics_decr.py +++ b/nuon/models/metrics_decr.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class MetricsDecr(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of MetricsDecr from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of MetricsDecr from a dict""" if obj is None: return None diff --git a/nuon/models/metrics_event.py b/nuon/models/metrics_event.py index 0be92eb6..56b4ba24 100644 --- a/nuon/models/metrics_event.py +++ b/nuon/models/metrics_event.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel from typing import Any, ClassVar, Dict, List, Optional from nuon.models.statsd_event import StatsdEvent -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class MetricsEvent(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of MetricsEvent from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,12 +67,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of event @@ -76,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of MetricsEvent from a dict""" if obj is None: return None @@ -85,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "event": StatsdEvent.from_dict(obj["event"]) if obj.get("event") is not None else None + "event": StatsdEvent.from_dict(obj.get("event")) if obj.get("event") is not None else None }) return _obj diff --git a/nuon/models/metrics_incr.py b/nuon/models/metrics_incr.py index 2cac1d8b..d8dff4b9 100644 --- a/nuon/models/metrics_incr.py +++ b/nuon/models/metrics_incr.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class MetricsIncr(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of MetricsIncr from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of MetricsIncr from a dict""" if obj is None: return None diff --git a/nuon/models/metrics_timing.py b/nuon/models/metrics_timing.py index 02bdc229..eaf2c2cc 100644 --- a/nuon/models/metrics_timing.py +++ b/nuon/models/metrics_timing.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class MetricsTiming(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of MetricsTiming from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of MetricsTiming from a dict""" if obj is None: return None diff --git a/nuon/models/planv1_plan.py b/nuon/models/planv1_plan.py index adf0b31f..b5385af5 100644 --- a/nuon/models/planv1_plan.py +++ b/nuon/models/planv1_plan.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class Planv1Plan(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of Planv1Plan from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,12 +66,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # set to None if actual (nullable) is None @@ -77,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of Planv1Plan from a dict""" if obj is None: return None diff --git a/nuon/models/service_app_input_request.py b/nuon/models/service_app_input_request.py index 4b6c76b4..a3708ef5 100644 --- a/nuon/models/service_app_input_request.py +++ b/nuon/models/service_app_input_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceAppInputRequest(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceAppInputRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceAppInputRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_app_installer.py b/nuon/models/service_app_installer.py index 36d2b350..ab1c4f54 100644 --- a/nuon/models/service_app_installer.py +++ b/nuon/models/service_app_installer.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictBool from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_app import AppApp from nuon.models.app_app_installer_metadata import AppAppInstallerMetadata -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceAppInstaller(BaseModel): """ @@ -51,7 +56,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceAppInstaller from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -65,12 +70,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of app @@ -82,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceAppInstaller from a dict""" if obj is None: return None @@ -91,8 +94,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "app": AppApp.from_dict(obj["app"]) if obj.get("app") is not None else None, - "metadata": AppAppInstallerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "app": AppApp.from_dict(obj.get("app")) if obj.get("app") is not None else None, + "metadata": AppAppInstallerMetadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None, "sandbox_mode": obj.get("sandbox_mode") }) return _obj diff --git a/nuon/models/service_aws_ecr_image_config_request.py b/nuon/models/service_aws_ecr_image_config_request.py index ce4a3f2f..194cb786 100644 --- a/nuon/models/service_aws_ecr_image_config_request.py +++ b/nuon/models/service_aws_ecr_image_config_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceAwsECRImageConfigRequest(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceAwsECRImageConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,18 +67,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceAwsECRImageConfigRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_cli_config.py b/nuon/models/service_cli_config.py index 66063165..51a8f972 100644 --- a/nuon/models/service_cli_config.py +++ b/nuon/models/service_cli_config.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCLIConfig(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCLIConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCLIConfig from a dict""" if obj is None: return None diff --git a/nuon/models/service_connected_github_vcs_config_request.py b/nuon/models/service_connected_github_vcs_config_request.py index 11ba2197..bb0f1f57 100644 --- a/nuon/models/service_connected_github_vcs_config_request.py +++ b/nuon/models/service_connected_github_vcs_config_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceConnectedGithubVCSConfigRequest(BaseModel): """ @@ -50,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceConnectedGithubVCSConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,18 +69,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceConnectedGithubVCSConfigRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_connected_github_vcs_sandbox_config_request.py b/nuon/models/service_connected_github_vcs_sandbox_config_request.py index fae9b181..db731acc 100644 --- a/nuon/models/service_connected_github_vcs_sandbox_config_request.py +++ b/nuon/models/service_connected_github_vcs_sandbox_config_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceConnectedGithubVCSSandboxConfigRequest(BaseModel): """ @@ -50,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceConnectedGithubVCSSandboxConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,18 +69,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceConnectedGithubVCSSandboxConfigRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_app_input_config_request.py b/nuon/models/service_create_app_input_config_request.py index d2bfdd91..d6731036 100644 --- a/nuon/models/service_create_app_input_config_request.py +++ b/nuon/models/service_create_app_input_config_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel from typing import Any, ClassVar, Dict, List from nuon.models.service_app_input_request import ServiceAppInputRequest -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateAppInputConfigRequest(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateAppInputConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,12 +67,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of each value in inputs (dict) @@ -80,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateAppInputConfigRequest from a dict""" if obj is None: return None @@ -91,7 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "inputs": dict( (_k, ServiceAppInputRequest.from_dict(_v)) - for _k, _v in obj["inputs"].items() + for _k, _v in obj.get("inputs").items() ) if obj.get("inputs") is not None else None diff --git a/nuon/models/service_create_app_installer_request.py b/nuon/models/service_create_app_installer_request.py index 81fcb489..3a51cdca 100644 --- a/nuon/models/service_create_app_installer_request.py +++ b/nuon/models/service_create_app_installer_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_create_app_installer_request_links import ServiceCreateAppInstallerRequestLinks -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateAppInstallerRequest(BaseModel): """ @@ -51,7 +56,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateAppInstallerRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -65,12 +70,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of links @@ -79,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateAppInstallerRequest from a dict""" if obj is None: return None @@ -89,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "description": obj.get("description"), - "links": ServiceCreateAppInstallerRequestLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, + "links": ServiceCreateAppInstallerRequestLinks.from_dict(obj.get("links")) if obj.get("links") is not None else None, "name": obj.get("name"), "slug": obj.get("slug") }) diff --git a/nuon/models/service_create_app_installer_request_links.py b/nuon/models/service_create_app_installer_request_links.py index 6148513d..0e90ca0d 100644 --- a/nuon/models/service_create_app_installer_request_links.py +++ b/nuon/models/service_create_app_installer_request_links.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateAppInstallerRequestLinks(BaseModel): """ @@ -52,7 +57,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateAppInstallerRequestLinks from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -66,18 +71,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateAppInstallerRequestLinks from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_app_request.py b/nuon/models/service_create_app_request.py index 5648f0bf..28e30fa3 100644 --- a/nuon/models/service_create_app_request.py +++ b/nuon/models/service_create_app_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateAppRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateAppRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateAppRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_app_runner_config_request.py b/nuon/models/service_create_app_runner_config_request.py index 3550ca92..5e5ab8a4 100644 --- a/nuon/models/service_create_app_runner_config_request.py +++ b/nuon/models/service_create_app_runner_config_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.app_app_runner_type import AppAppRunnerType -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateAppRunnerConfigRequest(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateAppRunnerConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateAppRunnerConfigRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_app_sandbox_config_request.py b/nuon/models/service_create_app_sandbox_config_request.py index 90442a1b..7d0859a1 100644 --- a/nuon/models/service_create_app_sandbox_config_request.py +++ b/nuon/models/service_create_app_sandbox_config_request.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_connected_github_vcs_sandbox_config_request import ServiceConnectedGithubVCSSandboxConfigRequest from nuon.models.service_public_git_vcs_sandbox_config_request import ServicePublicGitVCSSandboxConfigRequest -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateAppSandboxConfigRequest(BaseModel): """ @@ -53,7 +58,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateAppSandboxConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,12 +72,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -84,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateAppSandboxConfigRequest from a dict""" if obj is None: return None @@ -93,8 +96,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "connected_github_vcs_config": ServiceConnectedGithubVCSSandboxConfigRequest.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, - "public_git_vcs_config": ServicePublicGitVCSSandboxConfigRequest.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, + "connected_github_vcs_config": ServiceConnectedGithubVCSSandboxConfigRequest.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, + "public_git_vcs_config": ServicePublicGitVCSSandboxConfigRequest.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, "sandbox_inputs": obj.get("sandbox_inputs"), "sandbox_release_id": obj.get("sandbox_release_id"), "terraform_version": obj.get("terraform_version") diff --git a/nuon/models/service_create_component_build_request.py b/nuon/models/service_create_component_build_request.py index bd60c46c..afa99ab1 100644 --- a/nuon/models/service_create_component_build_request.py +++ b/nuon/models/service_create_component_build_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateComponentBuildRequest(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateComponentBuildRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,18 +67,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateComponentBuildRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_component_release_request.py b/nuon/models/service_create_component_release_request.py index b8215bf7..320fabd0 100644 --- a/nuon/models/service_create_component_release_request.py +++ b/nuon/models/service_create_component_release_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_create_component_release_request_strategy import ServiceCreateComponentReleaseRequestStrategy -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateComponentReleaseRequest(BaseModel): """ @@ -50,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateComponentReleaseRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,12 +69,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of strategy @@ -78,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateComponentReleaseRequest from a dict""" if obj is None: return None @@ -89,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "auto_build": obj.get("auto_build"), "build_id": obj.get("build_id"), - "strategy": ServiceCreateComponentReleaseRequestStrategy.from_dict(obj["strategy"]) if obj.get("strategy") is not None else None + "strategy": ServiceCreateComponentReleaseRequestStrategy.from_dict(obj.get("strategy")) if obj.get("strategy") is not None else None }) return _obj diff --git a/nuon/models/service_create_component_release_request_strategy.py b/nuon/models/service_create_component_release_request_strategy.py index 4e531e11..a1efb983 100644 --- a/nuon/models/service_create_component_release_request_strategy.py +++ b/nuon/models/service_create_component_release_request_strategy.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateComponentReleaseRequestStrategy(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateComponentReleaseRequestStrategy from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,18 +67,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateComponentReleaseRequestStrategy from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_component_request.py b/nuon/models/service_create_component_request.py index a168671e..d543ea7b 100644 --- a/nuon/models/service_create_component_request.py +++ b/nuon/models/service_create_component_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateComponentRequest(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateComponentRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,18 +67,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateComponentRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_connection_callback_request.py b/nuon/models/service_create_connection_callback_request.py index d78080b9..3ea0e555 100644 --- a/nuon/models/service_create_connection_callback_request.py +++ b/nuon/models/service_create_connection_callback_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateConnectionCallbackRequest(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateConnectionCallbackRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,18 +67,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateConnectionCallbackRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_connection_request.py b/nuon/models/service_create_connection_request.py index baa9f91d..790fcefd 100644 --- a/nuon/models/service_create_connection_request.py +++ b/nuon/models/service_create_connection_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateConnectionRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateConnectionRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateConnectionRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_docker_build_component_config_request.py b/nuon/models/service_create_docker_build_component_config_request.py index d7c493e2..de3ed072 100644 --- a/nuon/models/service_create_docker_build_component_config_request.py +++ b/nuon/models/service_create_docker_build_component_config_request.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_connected_github_vcs_config_request import ServiceConnectedGithubVCSConfigRequest from nuon.models.service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateDockerBuildComponentConfigRequest(BaseModel): """ @@ -54,7 +59,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateDockerBuildComponentConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,12 +73,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -85,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateDockerBuildComponentConfigRequest from a dict""" if obj is None: return None @@ -95,10 +98,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "build_args": obj.get("build_args"), - "connected_github_vcs_config": ServiceConnectedGithubVCSConfigRequest.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, + "connected_github_vcs_config": ServiceConnectedGithubVCSConfigRequest.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, "dockerfile": obj.get("dockerfile"), "env_vars": obj.get("env_vars"), - "public_git_vcs_config": ServicePublicGitVCSConfigRequest.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, + "public_git_vcs_config": ServicePublicGitVCSConfigRequest.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, "target": obj.get("target") }) return _obj diff --git a/nuon/models/service_create_external_image_component_config_request.py b/nuon/models/service_create_external_image_component_config_request.py index dff14754..d3da2458 100644 --- a/nuon/models/service_create_external_image_component_config_request.py +++ b/nuon/models/service_create_external_image_component_config_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_aws_ecr_image_config_request import ServiceAwsECRImageConfigRequest -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateExternalImageComponentConfigRequest(BaseModel): """ @@ -50,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateExternalImageComponentConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,12 +69,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of aws_ecr_image_config @@ -78,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateExternalImageComponentConfigRequest from a dict""" if obj is None: return None @@ -87,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "aws_ecr_image_config": ServiceAwsECRImageConfigRequest.from_dict(obj["aws_ecr_image_config"]) if obj.get("aws_ecr_image_config") is not None else None, + "aws_ecr_image_config": ServiceAwsECRImageConfigRequest.from_dict(obj.get("aws_ecr_image_config")) if obj.get("aws_ecr_image_config") is not None else None, "image_url": obj.get("image_url"), "tag": obj.get("tag") }) diff --git a/nuon/models/service_create_helm_component_config_request.py b/nuon/models/service_create_helm_component_config_request.py index 3dd575ca..821dd84e 100644 --- a/nuon/models/service_create_helm_component_config_request.py +++ b/nuon/models/service_create_helm_component_config_request.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_connected_github_vcs_config_request import ServiceConnectedGithubVCSConfigRequest from nuon.models.service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateHelmComponentConfigRequest(BaseModel): """ @@ -52,7 +57,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateHelmComponentConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -66,12 +71,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -83,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateHelmComponentConfigRequest from a dict""" if obj is None: return None @@ -93,8 +96,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "chart_name": obj.get("chart_name"), - "connected_github_vcs_config": ServiceConnectedGithubVCSConfigRequest.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, - "public_git_vcs_config": ServicePublicGitVCSConfigRequest.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, + "connected_github_vcs_config": ServiceConnectedGithubVCSConfigRequest.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, + "public_git_vcs_config": ServicePublicGitVCSConfigRequest.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, "values": obj.get("values") }) return _obj diff --git a/nuon/models/service_create_install_deploy_request.py b/nuon/models/service_create_install_deploy_request.py index 9f80cded..c7ac6ecc 100644 --- a/nuon/models/service_create_install_deploy_request.py +++ b/nuon/models/service_create_install_deploy_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateInstallDeployRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateInstallDeployRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateInstallDeployRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_install_inputs_request.py b/nuon/models/service_create_install_inputs_request.py index 9e9de243..d66aab69 100644 --- a/nuon/models/service_create_install_inputs_request.py +++ b/nuon/models/service_create_install_inputs_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateInstallInputsRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateInstallInputsRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateInstallInputsRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_install_request.py b/nuon/models/service_create_install_request.py index c3069360..e5bb1f08 100644 --- a/nuon/models/service_create_install_request.py +++ b/nuon/models/service_create_install_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List from nuon.models.service_create_install_request_aws_account import ServiceCreateInstallRequestAwsAccount -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateInstallRequest(BaseModel): """ @@ -50,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateInstallRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,12 +69,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of aws_account @@ -78,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateInstallRequest from a dict""" if obj is None: return None @@ -87,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "aws_account": ServiceCreateInstallRequestAwsAccount.from_dict(obj["aws_account"]) if obj.get("aws_account") is not None else None, + "aws_account": ServiceCreateInstallRequestAwsAccount.from_dict(obj.get("aws_account")) if obj.get("aws_account") is not None else None, "inputs": obj.get("inputs"), "name": obj.get("name") }) diff --git a/nuon/models/service_create_install_request_aws_account.py b/nuon/models/service_create_install_request_aws_account.py index 848f7ae8..69ce5f8b 100644 --- a/nuon/models/service_create_install_request_aws_account.py +++ b/nuon/models/service_create_install_request_aws_account.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateInstallRequestAwsAccount(BaseModel): """ @@ -58,7 +63,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateInstallRequestAwsAccount from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -72,18 +77,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateInstallRequestAwsAccount from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_job_component_config_request.py b/nuon/models/service_create_job_component_config_request.py index f72fde82..1070cd4d 100644 --- a/nuon/models/service_create_job_component_config_request.py +++ b/nuon/models/service_create_job_component_config_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateJobComponentConfigRequest(BaseModel): """ @@ -51,7 +56,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateJobComponentConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -65,18 +70,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateJobComponentConfigRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_org_request.py b/nuon/models/service_create_org_request.py index be01bf33..cf18a2f0 100644 --- a/nuon/models/service_create_org_request.py +++ b/nuon/models/service_create_org_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateOrgRequest(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateOrgRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateOrgRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_org_user_request.py b/nuon/models/service_create_org_user_request.py index a8ed66e7..b8b8b0c8 100644 --- a/nuon/models/service_create_org_user_request.py +++ b/nuon/models/service_create_org_user_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateOrgUserRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateOrgUserRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateOrgUserRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_create_terraform_module_component_config_request.py b/nuon/models/service_create_terraform_module_component_config_request.py index 6ef6a2a7..b0ef16d1 100644 --- a/nuon/models/service_create_terraform_module_component_config_request.py +++ b/nuon/models/service_create_terraform_module_component_config_request.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_connected_github_vcs_config_request import ServiceConnectedGithubVCSConfigRequest from nuon.models.service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceCreateTerraformModuleComponentConfigRequest(BaseModel): """ @@ -53,7 +58,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceCreateTerraformModuleComponentConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,12 +72,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of connected_github_vcs_config @@ -84,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceCreateTerraformModuleComponentConfigRequest from a dict""" if obj is None: return None @@ -93,9 +96,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "connected_github_vcs_config": ServiceConnectedGithubVCSConfigRequest.from_dict(obj["connected_github_vcs_config"]) if obj.get("connected_github_vcs_config") is not None else None, + "connected_github_vcs_config": ServiceConnectedGithubVCSConfigRequest.from_dict(obj.get("connected_github_vcs_config")) if obj.get("connected_github_vcs_config") is not None else None, "env_vars": obj.get("env_vars"), - "public_git_vcs_config": ServicePublicGitVCSConfigRequest.from_dict(obj["public_git_vcs_config"]) if obj.get("public_git_vcs_config") is not None else None, + "public_git_vcs_config": ServicePublicGitVCSConfigRequest.from_dict(obj.get("public_git_vcs_config")) if obj.get("public_git_vcs_config") is not None else None, "variables": obj.get("variables"), "version": obj.get("version") }) diff --git a/nuon/models/service_installer_create_install_request.py b/nuon/models/service_installer_create_install_request.py index 6b5bf8eb..53517d89 100644 --- a/nuon/models/service_installer_create_install_request.py +++ b/nuon/models/service_installer_create_install_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List from nuon.models.service_create_install_request_aws_account import ServiceCreateInstallRequestAwsAccount -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceInstallerCreateInstallRequest(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceInstallerCreateInstallRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,12 +68,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of aws_account @@ -77,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceInstallerCreateInstallRequest from a dict""" if obj is None: return None @@ -86,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "aws_account": ServiceCreateInstallRequestAwsAccount.from_dict(obj["aws_account"]) if obj.get("aws_account") is not None else None, + "aws_account": ServiceCreateInstallRequestAwsAccount.from_dict(obj.get("aws_account")) if obj.get("aws_account") is not None else None, "name": obj.get("name") }) return _obj diff --git a/nuon/models/service_public_git_vcs_config_request.py b/nuon/models/service_public_git_vcs_config_request.py index 125e0e08..e2b33326 100644 --- a/nuon/models/service_public_git_vcs_config_request.py +++ b/nuon/models/service_public_git_vcs_config_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServicePublicGitVCSConfigRequest(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServicePublicGitVCSConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServicePublicGitVCSConfigRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_public_git_vcs_sandbox_config_request.py b/nuon/models/service_public_git_vcs_sandbox_config_request.py index 3d9556b7..a44f61e3 100644 --- a/nuon/models/service_public_git_vcs_sandbox_config_request.py +++ b/nuon/models/service_public_git_vcs_sandbox_config_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServicePublicGitVCSSandboxConfigRequest(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServicePublicGitVCSSandboxConfigRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServicePublicGitVCSSandboxConfigRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_publish_metric_input.py b/nuon/models/service_publish_metric_input.py index eebd37a9..a9d672be 100644 --- a/nuon/models/service_publish_metric_input.py +++ b/nuon/models/service_publish_metric_input.py @@ -18,14 +18,19 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel from typing import Any, ClassVar, Dict, List, Optional from nuon.models.metrics_decr import MetricsDecr from nuon.models.metrics_event import MetricsEvent from nuon.models.metrics_incr import MetricsIncr from nuon.models.metrics_timing import MetricsTiming -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServicePublishMetricInput(BaseModel): """ @@ -54,7 +59,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServicePublishMetricInput from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -68,12 +73,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of decr @@ -91,7 +94,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServicePublishMetricInput from a dict""" if obj is None: return None @@ -100,10 +103,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "decr": MetricsDecr.from_dict(obj["decr"]) if obj.get("decr") is not None else None, - "event": MetricsEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, - "incr": MetricsIncr.from_dict(obj["incr"]) if obj.get("incr") is not None else None, - "timing": MetricsTiming.from_dict(obj["timing"]) if obj.get("timing") is not None else None + "decr": MetricsDecr.from_dict(obj.get("decr")) if obj.get("decr") is not None else None, + "event": MetricsEvent.from_dict(obj.get("event")) if obj.get("event") is not None else None, + "incr": MetricsIncr.from_dict(obj.get("incr")) if obj.get("incr") is not None else None, + "timing": MetricsTiming.from_dict(obj.get("timing")) if obj.get("timing") is not None else None }) return _obj diff --git a/nuon/models/service_repository.py b/nuon/models/service_repository.py index 21cf1bfb..349c44cf 100644 --- a/nuon/models/service_repository.py +++ b/nuon/models/service_repository.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceRepository(BaseModel): """ @@ -53,7 +58,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceRepository from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -67,18 +72,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceRepository from a dict""" if obj is None: return None diff --git a/nuon/models/service_update_app_installer_request.py b/nuon/models/service_update_app_installer_request.py index 99d9172c..628baeeb 100644 --- a/nuon/models/service_update_app_installer_request.py +++ b/nuon/models/service_update_app_installer_request.py @@ -18,11 +18,16 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.service_update_app_installer_request_links import ServiceUpdateAppInstallerRequestLinks -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceUpdateAppInstallerRequest(BaseModel): """ @@ -50,7 +55,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceUpdateAppInstallerRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -64,12 +69,10 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) # override the default output from pydantic by calling `to_dict()` of links @@ -78,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceUpdateAppInstallerRequest from a dict""" if obj is None: return None @@ -88,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "description": obj.get("description"), - "links": ServiceUpdateAppInstallerRequestLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, + "links": ServiceUpdateAppInstallerRequestLinks.from_dict(obj.get("links")) if obj.get("links") is not None else None, "name": obj.get("name") }) return _obj diff --git a/nuon/models/service_update_app_installer_request_links.py b/nuon/models/service_update_app_installer_request_links.py index 384035c3..5dae97b7 100644 --- a/nuon/models/service_update_app_installer_request_links.py +++ b/nuon/models/service_update_app_installer_request_links.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceUpdateAppInstallerRequestLinks(BaseModel): """ @@ -52,7 +57,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceUpdateAppInstallerRequestLinks from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -66,18 +71,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceUpdateAppInstallerRequestLinks from a dict""" if obj is None: return None diff --git a/nuon/models/service_update_app_request.py b/nuon/models/service_update_app_request.py index 083f0856..f70a1bb7 100644 --- a/nuon/models/service_update_app_request.py +++ b/nuon/models/service_update_app_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceUpdateAppRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceUpdateAppRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceUpdateAppRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_update_component_request.py b/nuon/models/service_update_component_request.py index 78f454cd..93c6af56 100644 --- a/nuon/models/service_update_component_request.py +++ b/nuon/models/service_update_component_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceUpdateComponentRequest(BaseModel): """ @@ -48,7 +53,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceUpdateComponentRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -62,18 +67,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceUpdateComponentRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_update_install_request.py b/nuon/models/service_update_install_request.py index f5cdf26f..d8686a79 100644 --- a/nuon/models/service_update_install_request.py +++ b/nuon/models/service_update_install_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceUpdateInstallRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceUpdateInstallRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceUpdateInstallRequest from a dict""" if obj is None: return None diff --git a/nuon/models/service_update_org_request.py b/nuon/models/service_update_org_request.py index 8444370f..4ad97dd2 100644 --- a/nuon/models/service_update_org_request.py +++ b/nuon/models/service_update_org_request.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class ServiceUpdateOrgRequest(BaseModel): """ @@ -47,7 +52,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of ServiceUpdateOrgRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -61,18 +66,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of ServiceUpdateOrgRequest from a dict""" if obj is None: return None diff --git a/nuon/models/statsd_event.py b/nuon/models/statsd_event.py index 9d42c45d..24db73e8 100644 --- a/nuon/models/statsd_event.py +++ b/nuon/models/statsd_event.py @@ -18,12 +18,17 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from nuon.models.statsd_event_alert_type import StatsdEventAlertType from nuon.models.statsd_event_priority import StatsdEventPriority -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class StatsdEvent(BaseModel): """ @@ -58,7 +63,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of StatsdEvent from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -72,18 +77,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of StatsdEvent from a dict""" if obj is None: return None diff --git a/nuon/models/statsd_event_alert_type.py b/nuon/models/statsd_event_alert_type.py index 955b70c9..7a5eb14e 100644 --- a/nuon/models/statsd_event_alert_type.py +++ b/nuon/models/statsd_event_alert_type.py @@ -15,8 +15,16 @@ from __future__ import annotations import json +import pprint +import re # noqa: F401 from enum import Enum -from typing_extensions import Self + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self class StatsdEventAlertType(str, Enum): diff --git a/nuon/models/statsd_event_priority.py b/nuon/models/statsd_event_priority.py index 20763e1b..36c96e36 100644 --- a/nuon/models/statsd_event_priority.py +++ b/nuon/models/statsd_event_priority.py @@ -15,8 +15,16 @@ from __future__ import annotations import json +import pprint +import re # noqa: F401 from enum import Enum -from typing_extensions import Self + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self class StatsdEventPriority(str, Enum): diff --git a/nuon/models/stderr_err_response.py b/nuon/models/stderr_err_response.py index e220907e..55af6a07 100644 --- a/nuon/models/stderr_err_response.py +++ b/nuon/models/stderr_err_response.py @@ -18,10 +18,15 @@ import re # noqa: F401 import json + + + from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +try: + from typing import Self +except ImportError: + from typing_extensions import Self class StderrErrResponse(BaseModel): """ @@ -49,7 +54,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Self: """Create an instance of StderrErrResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -63,18 +68,16 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) - _dict = self.model_dump( by_alias=True, - exclude=excluded_fields, + exclude={ + }, exclude_none=True, ) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: Dict) -> Self: """Create an instance of StderrErrResponse from a dict""" if obj is None: return None diff --git a/nuon/rest.py b/nuon/rest.py index f7f30141..d8294e78 100644 --- a/nuon/rest.py +++ b/nuon/rest.py @@ -72,45 +72,56 @@ def __init__(self, configuration) -> None: else: cert_reqs = ssl.CERT_NONE - pool_args = { - "cert_reqs": cert_reqs, - "ca_certs": configuration.ssl_ca_cert, - "cert_file": configuration.cert_file, - "key_file": configuration.key_file, - } + addition_pool_args = {} if configuration.assert_hostname is not None: - pool_args['assert_hostname'] = ( + addition_pool_args['assert_hostname'] = ( configuration.assert_hostname ) if configuration.retries is not None: - pool_args['retries'] = configuration.retries + addition_pool_args['retries'] = configuration.retries if configuration.tls_server_name: - pool_args['server_hostname'] = configuration.tls_server_name + addition_pool_args['server_hostname'] = configuration.tls_server_name if configuration.socket_options is not None: - pool_args['socket_options'] = configuration.socket_options + addition_pool_args['socket_options'] = configuration.socket_options if configuration.connection_pool_maxsize is not None: - pool_args['maxsize'] = configuration.connection_pool_maxsize + addition_pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - self.pool_manager: urllib3.PoolManager - if configuration.proxy: if is_socks_proxy_url(configuration.proxy): from urllib3.contrib.socks import SOCKSProxyManager - pool_args["proxy_url"] = configuration.proxy - pool_args["headers"] = configuration.proxy_headers - self.pool_manager = SOCKSProxyManager(**pool_args) + self.pool_manager = SOCKSProxyManager( + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + headers=configuration.proxy_headers, + **addition_pool_args + ) else: - pool_args["proxy_url"] = configuration.proxy - pool_args["proxy_headers"] = configuration.proxy_headers - self.pool_manager = urllib3.ProxyManager(**pool_args) + self.pool_manager = urllib3.ProxyManager( + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) else: - self.pool_manager = urllib3.PoolManager(**pool_args) + self.pool_manager = urllib3.PoolManager( + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) def request( self, @@ -213,13 +224,14 @@ def request( preload_content=False ) # Pass a `string` parameter directly in the body to support - # other content types than JSON when `body` argument is - # provided in serialized form. + # other content types than Json when `body` argument is + # provided in serialized form elif isinstance(body, str) or isinstance(body, bytes): + request_body = body r = self.pool_manager.request( method, url, - body=body, + body=request_body, timeout=timeout, headers=headers, preload_content=False diff --git a/pyproject.toml b/pyproject.toml index 74f5c663..ae07348c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nuon" -version = "1.0.0" +version = "0.19.15" description = "Nuon" authors = ["Nuon Support "] license = "NoLicense" @@ -21,9 +21,6 @@ typing-extensions = ">=4.7.1" pytest = ">=7.2.1" tox = ">=3.9.0" flake8 = ">=4.0.0" -types-python-dateutil = ">=2.8.19.14" -mypy = "1.4.1" - [build-system] requires = ["setuptools"] @@ -31,41 +28,3 @@ build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" - -[tool.mypy] -files = [ - "nuon", - #"test", # auto-generated tests - "tests", # hand-written tests -] -# TODO: enable "strict" once all these individual checks are passing -# strict = true - -# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options -warn_unused_configs = true -warn_redundant_casts = true -warn_unused_ignores = true - -## Getting these passing should be easy -strict_equality = true -strict_concatenate = true - -## Strongly recommend enabling this one as soon as you can -check_untyped_defs = true - -## These shouldn't be too much additional work, but may be tricky to -## get passing if you use a lot of untyped libraries -disallow_subclassing_any = true -disallow_untyped_decorators = true -disallow_any_generics = true - -### These next few are various gradations of forcing use of type annotations -#disallow_untyped_calls = true -#disallow_incomplete_defs = true -#disallow_untyped_defs = true -# -### This one isn't too hard to get passing, but return on investment is lower -#no_implicit_reexport = true -# -### This one can be tricky to get passing if you use a lot of untyped libraries -#warn_return_any = true diff --git a/setup.py b/setup.py index 0403ae9d..7c432466 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "nuon" -VERSION = "1.0.0" +VERSION = "0.19.15" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", diff --git a/test-requirements.txt b/test-requirements.txt index 8e6d8cb1..3a0d0b93 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,3 @@ pytest~=7.1.3 pytest-cov>=2.8.1 pytest-randomly>=3.12.0 -mypy>=1.4.1 -types-python-dateutil>=2.8.19 diff --git a/version.txt b/version.txt index 3eefcb9d..44679272 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.0 +0.19.15