From ee80055163b0892a29d6ed800a07a7324228ea8c Mon Sep 17 00:00:00 2001 From: Srinivas Alluri Date: Wed, 21 May 2025 18:59:50 +0530 Subject: [PATCH 1/6] updated the description of the cli commands to support the az mcp --- .../aaz/latest/neon/postgres/__cmd_group.py | 2 +- .../latest/neon/postgres/branch/_create.py | 67 +- .../latest/neon/postgres/branch/_delete.py | 13 +- .../aaz/latest/neon/postgres/branch/_list.py | 41 +- .../aaz/latest/neon/postgres/branch/_show.py | 43 +- .../latest/neon/postgres/branch/_update.py | 137 ++-- .../aaz/latest/neon/postgres/branch/_wait.py | 41 +- .../{compute => endpoint}/__cmd_group.py | 4 +- .../{compute => endpoint}/__init__.py | 0 .../postgres/{compute => endpoint}/_list.py | 52 +- .../neon/postgres/neon_database/_list.py | 15 +- .../latest/neon/postgres/neon_role/_list.py | 15 +- .../neon/postgres/organization/_create.py | 388 +++++----- .../neon/postgres/organization/_delete.py | 12 +- .../neon/postgres/organization/_list.py | 455 +---------- .../neon/postgres/organization/_show.py | 316 +------- .../neon/postgres/organization/_update.py | 706 +++--------------- .../neon/postgres/organization/_wait.py | 308 +------- .../latest/neon/postgres/project/_create.py | 393 +++++----- .../latest/neon/postgres/project/_delete.py | 10 +- .../postgres/project/_get_connection_uri.py | 9 +- .../aaz/latest/neon/postgres/project/_list.py | 228 +++--- .../aaz/latest/neon/postgres/project/_show.py | 232 +++--- .../latest/neon/postgres/project/_update.py | 466 ++++++------ .../aaz/latest/neon/postgres/project/_wait.py | 229 +++--- 25 files changed, 1352 insertions(+), 2830 deletions(-) rename src/neon/azext_neon/aaz/latest/neon/postgres/{compute => endpoint}/__cmd_group.py (91%) rename src/neon/azext_neon/aaz/latest/neon/postgres/{compute => endpoint}/__init__.py (100%) rename src/neon/azext_neon/aaz/latest/neon/postgres/{compute => endpoint}/_list.py (86%) diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/postgres/__cmd_group.py index e9ac3488749..745e1d2f204 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/__cmd_group.py @@ -15,7 +15,7 @@ "neon postgres", ) class __CMDGroup(AAZCommandGroup): - """Manage Neon Postgres + """Manage Neon Serverless Postgres resources including organizations, projects, and branches. """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py index 1a8ef13ad15..9228207713a 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py @@ -15,7 +15,7 @@ "neon postgres branch create", ) class Create(AAZCommand): - """Create a Branch + """Create a new branch in a Neon project. :example: Create a Branch az neon postgres branch create --resource-group rgneon --organization-name org-cli-test --project-name old-frost-16758796 --branch-name test-branch --entity-name test-branch --role-name test_role --database-name testneondb @@ -47,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.branch_name = AAZStrArg( options=["-n", "--name", "--branch-name"], - help="The name of the Branch", + help="Name of the Neon branch.", required=True, fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", @@ -55,24 +55,27 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, fmt=AAZStrArgFormat( pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_name = AAZStrArg( options=["--project-name"], - help="The Id of the Neon Project.", + help="Name of the Neon project.", required=True, fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) @@ -107,31 +110,31 @@ def _build_arguments_schema(cls, *args, **kwargs): ) return cls._args_schema - _args_models_attributes_create = None + _args_attributes_create = None @classmethod - def _build_args_models_attributes_create(cls, _schema): - if cls._args_models_attributes_create is not None: - _schema.name = cls._args_models_attributes_create.name - _schema.value = cls._args_models_attributes_create.value + def _build_args_attributes_create(cls, _schema): + if cls._args_attributes_create is not None: + _schema.name = cls._args_attributes_create.name + _schema.value = cls._args_attributes_create.value return - cls._args_models_attributes_create = AAZObjectArg() + cls._args_attributes_create = AAZObjectArg() - models_attributes_create = cls._args_models_attributes_create - models_attributes_create.name = AAZStrArg( + attributes_create = cls._args_attributes_create + attributes_create.name = AAZStrArg( options=["name"], help="Name of the attribute", required=True, ) - models_attributes_create.value = AAZStrArg( + attributes_create.value = AAZStrArg( options=["value"], help="Value of the attribute", required=True, ) - _schema.name = cls._args_models_attributes_create.name - _schema.value = cls._args_models_attributes_create.value + _schema.name = cls._args_attributes_create.name + _schema.value = cls._args_attributes_create.value def _execute_operations(self): self.pre_operations() @@ -326,7 +329,7 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200_201.properties.databases databases.Element = AAZObjectType() @@ -357,7 +360,7 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.databases.Element.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) endpoints = cls._schema_on_200_201.properties.endpoints endpoints.Element = AAZObjectType() @@ -391,7 +394,7 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.endpoints.Element.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) roles = cls._schema_on_200_201.properties.roles roles.Element = AAZObjectType() @@ -423,7 +426,7 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.roles.Element.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) permissions = cls._schema_on_200_201.properties.roles.Element.permissions permissions.Element = AAZStrType() @@ -455,33 +458,33 @@ class _CreateHelper: """Helper class for Create""" @classmethod - def _build_schema_models_attributes_create(cls, _builder): + def _build_schema_attributes_create(cls, _builder): if _builder is None: return _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value __all__ = ["Create"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py index e4309be2b20..90db9caaa5c 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py @@ -16,7 +16,7 @@ confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): - """Delete a Branch + """Delete a branch from a Neon project. :example: Delete Branch az neon postgres branch delete --subscription 38a546de-5736-48e8-a69a-5cc636794112 --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr @@ -47,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.branch_id = AAZStrArg( options=["--branch-id"], - help="The id of the Neon Branch resource", + help="Id of the Neon branch", required=True, id_part="child_name_2", fmt=AAZStrArgFormat( @@ -56,7 +56,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -64,10 +64,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -75,7 +78,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py index a506cb3bbf6..8a0f31b2bf9 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py @@ -15,7 +15,7 @@ "neon postgres branch list", ) class List(AAZCommand): - """List Branch resources by Project + """List all branches in a Neon project. :example: List Branches under a Project az neon postgres branch list --subscription 38a546de-5736-48e8-a69a-5cc636794112 --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 @@ -47,24 +47,27 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, fmt=AAZStrArgFormat( pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -233,7 +236,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.value.Element.properties.attributes attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) + _ListHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200.value.Element.properties.databases databases.Element = AAZObjectType() @@ -264,7 +267,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.value.Element.properties.databases.Element.attributes attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) + _ListHelper._build_schema_attributes_read(attributes.Element) endpoints = cls._schema_on_200.value.Element.properties.endpoints endpoints.Element = AAZObjectType() @@ -298,7 +301,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.value.Element.properties.endpoints.Element.attributes attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) + _ListHelper._build_schema_attributes_read(attributes.Element) roles = cls._schema_on_200.value.Element.properties.roles roles.Element = AAZObjectType() @@ -330,7 +333,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.value.Element.properties.roles.Element.attributes attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) + _ListHelper._build_schema_attributes_read(attributes.Element) permissions = cls._schema_on_200.value.Element.properties.roles.Element.permissions permissions.Element = AAZStrType() @@ -361,27 +364,27 @@ def _build_schema_on_200(cls): class _ListHelper: """Helper class for List""" - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value __all__ = ["List"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py index 8c889b671d3..1188a7b36dd 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py @@ -15,7 +15,7 @@ "neon postgres branch show", ) class Show(AAZCommand): - """Get a Branch + """Retrieve details of a specific Neon branch. :example: Show Branch Details az neon postgres branch show --subscription 38a546de-5736-48e8-a69a-5cc636794112 --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr @@ -46,7 +46,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.branch_id = AAZStrArg( options=["--branch-id"], - help="The id of the Neon Branch resource", + help="Id of the Neon branch", required=True, id_part="child_name_2", fmt=AAZStrArgFormat( @@ -55,7 +55,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -63,10 +63,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -74,7 +77,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -235,7 +238,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.attributes attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) + _ShowHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200.properties.databases databases.Element = AAZObjectType() @@ -266,7 +269,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.databases.Element.attributes attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) + _ShowHelper._build_schema_attributes_read(attributes.Element) endpoints = cls._schema_on_200.properties.endpoints endpoints.Element = AAZObjectType() @@ -300,7 +303,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.endpoints.Element.attributes attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) + _ShowHelper._build_schema_attributes_read(attributes.Element) roles = cls._schema_on_200.properties.roles roles.Element = AAZObjectType() @@ -332,7 +335,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.roles.Element.attributes attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) + _ShowHelper._build_schema_attributes_read(attributes.Element) permissions = cls._schema_on_200.properties.roles.Element.permissions permissions.Element = AAZStrType() @@ -363,27 +366,27 @@ def _build_schema_on_200(cls): class _ShowHelper: """Helper class for Show""" - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value __all__ = ["Show"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py index 32955eeb5ce..26e0f2c3365 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py @@ -15,7 +15,7 @@ "neon postgres branch update", ) class Update(AAZCommand): - """Update a Branch + """Update a branch from a Neon project. :example: Update a Branch az neon postgres branch update --resource-group rgneon --organization-name org-cli-test --project-name old-frost-16758796 --project-id old-frost-16758796 --branch-name test-branch --entity-name test-branch2 --role-name test_role --database-name testneondb @@ -49,7 +49,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.branch_name = AAZStrArg( options=["-n", "--name", "--branch-name"], - help="The name of the Branch", + help="Name of the Neon branch.", required=True, id_part="child_name_2", fmt=AAZStrArgFormat( @@ -58,7 +58,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -66,10 +66,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_name = AAZStrArg( options=["--project-name"], - help="The Id of the Neon Project.", + help="Name of the Neon project.", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -77,7 +80,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) @@ -116,31 +119,31 @@ def _build_arguments_schema(cls, *args, **kwargs): ) return cls._args_schema - _args_models_attributes_update = None + _args_attributes_update = None @classmethod - def _build_args_models_attributes_update(cls, _schema): - if cls._args_models_attributes_update is not None: - _schema.name = cls._args_models_attributes_update.name - _schema.value = cls._args_models_attributes_update.value + def _build_args_attributes_update(cls, _schema): + if cls._args_attributes_update is not None: + _schema.name = cls._args_attributes_update.name + _schema.value = cls._args_attributes_update.value return - cls._args_models_attributes_update = AAZObjectArg( + cls._args_attributes_update = AAZObjectArg( nullable=True, ) - models_attributes_update = cls._args_models_attributes_update - models_attributes_update.name = AAZStrArg( + attributes_update = cls._args_attributes_update + attributes_update.name = AAZStrArg( options=["name"], help="Name of the attribute", ) - models_attributes_update.value = AAZStrArg( + attributes_update.value = AAZStrArg( options=["value"], help="Value of the attribute", ) - _schema.name = cls._args_models_attributes_update.name - _schema.value = cls._args_models_attributes_update.value + _schema.name = cls._args_attributes_update.name + _schema.value = cls._args_attributes_update.value def _execute_operations(self): self.pre_operations() @@ -259,7 +262,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_models_branch_read(cls._schema_on_200) + _UpdateHelper._build_schema_branch_read(cls._schema_on_200) return cls._schema_on_200 @@ -378,7 +381,7 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_models_branch_read(cls._schema_on_200_201) + _UpdateHelper._build_schema_branch_read(cls._schema_on_200_201) return cls._schema_on_200_201 @@ -417,65 +420,65 @@ class _UpdateHelper: """Helper class for Update""" @classmethod - def _build_schema_models_attributes_update(cls, _builder): + def _build_schema_attributes_update(cls, _builder): if _builder is None: return _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value - _schema_models_branch_read = None + _schema_branch_read = None @classmethod - def _build_schema_models_branch_read(cls, _schema): - if cls._schema_models_branch_read is not None: - _schema.id = cls._schema_models_branch_read.id - _schema.name = cls._schema_models_branch_read.name - _schema.properties = cls._schema_models_branch_read.properties - _schema.system_data = cls._schema_models_branch_read.system_data - _schema.type = cls._schema_models_branch_read.type + def _build_schema_branch_read(cls, _schema): + if cls._schema_branch_read is not None: + _schema.id = cls._schema_branch_read.id + _schema.name = cls._schema_branch_read.name + _schema.properties = cls._schema_branch_read.properties + _schema.system_data = cls._schema_branch_read.system_data + _schema.type = cls._schema_branch_read.type return - cls._schema_models_branch_read = _schema_models_branch_read = AAZObjectType() + cls._schema_branch_read = _schema_branch_read = AAZObjectType() - models_branch_read = _schema_models_branch_read - models_branch_read.id = AAZStrType( + branch_read = _schema_branch_read + branch_read.id = AAZStrType( flags={"read_only": True}, ) - models_branch_read.name = AAZStrType( + branch_read.name = AAZStrType( flags={"read_only": True}, ) - models_branch_read.properties = AAZObjectType() - models_branch_read.system_data = AAZObjectType( + branch_read.properties = AAZObjectType() + branch_read.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) - models_branch_read.type = AAZStrType( + branch_read.type = AAZStrType( flags={"read_only": True}, ) - properties = _schema_models_branch_read.properties + properties = _schema_branch_read.properties properties.attributes = AAZListType() properties.created_at = AAZStrType( serialized_name="createdAt", @@ -508,14 +511,14 @@ def _build_schema_models_branch_read(cls, _schema): ) properties.roles = AAZListType() - attributes = _schema_models_branch_read.properties.attributes + attributes = _schema_branch_read.properties.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - databases = _schema_models_branch_read.properties.databases + databases = _schema_branch_read.properties.databases databases.Element = AAZObjectType() - _element = _schema_models_branch_read.properties.databases.Element + _element = _schema_branch_read.properties.databases.Element _element.attributes = AAZListType() _element.branch_id = AAZStrType( serialized_name="branchId", @@ -539,14 +542,14 @@ def _build_schema_models_branch_read(cls, _schema): flags={"read_only": True}, ) - attributes = _schema_models_branch_read.properties.databases.Element.attributes + attributes = _schema_branch_read.properties.databases.Element.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - endpoints = _schema_models_branch_read.properties.endpoints + endpoints = _schema_branch_read.properties.endpoints endpoints.Element = AAZObjectType() - _element = _schema_models_branch_read.properties.endpoints.Element + _element = _schema_branch_read.properties.endpoints.Element _element.attributes = AAZListType() _element.branch_id = AAZStrType( serialized_name="branchId", @@ -573,14 +576,14 @@ def _build_schema_models_branch_read(cls, _schema): flags={"read_only": True}, ) - attributes = _schema_models_branch_read.properties.endpoints.Element.attributes + attributes = _schema_branch_read.properties.endpoints.Element.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - roles = _schema_models_branch_read.properties.roles + roles = _schema_branch_read.properties.roles roles.Element = AAZObjectType() - _element = _schema_models_branch_read.properties.roles.Element + _element = _schema_branch_read.properties.roles.Element _element.attributes = AAZListType() _element.branch_id = AAZStrType( serialized_name="branchId", @@ -605,14 +608,14 @@ def _build_schema_models_branch_read(cls, _schema): flags={"read_only": True}, ) - attributes = _schema_models_branch_read.properties.roles.Element.attributes + attributes = _schema_branch_read.properties.roles.Element.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - permissions = _schema_models_branch_read.properties.roles.Element.permissions + permissions = _schema_branch_read.properties.roles.Element.permissions permissions.Element = AAZStrType() - system_data = _schema_models_branch_read.system_data + system_data = _schema_branch_read.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) @@ -632,11 +635,11 @@ def _build_schema_models_branch_read(cls, _schema): serialized_name="lastModifiedByType", ) - _schema.id = cls._schema_models_branch_read.id - _schema.name = cls._schema_models_branch_read.name - _schema.properties = cls._schema_models_branch_read.properties - _schema.system_data = cls._schema_models_branch_read.system_data - _schema.type = cls._schema_models_branch_read.type + _schema.id = cls._schema_branch_read.id + _schema.name = cls._schema_branch_read.name + _schema.properties = cls._schema_branch_read.properties + _schema.system_data = cls._schema_branch_read.system_data + _schema.type = cls._schema_branch_read.type __all__ = ["Update"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_wait.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_wait.py index a156072267e..4289a454238 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_wait.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_wait.py @@ -42,7 +42,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.branch_id = AAZStrArg( options=["--branch-id"], - help="The id of the Neon Branch resource", + help="Id of the Neon branch", required=True, id_part="child_name_2", fmt=AAZStrArgFormat( @@ -51,7 +51,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -59,10 +59,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -70,7 +73,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -231,7 +234,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.attributes attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) + _WaitHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200.properties.databases databases.Element = AAZObjectType() @@ -262,7 +265,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.databases.Element.attributes attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) + _WaitHelper._build_schema_attributes_read(attributes.Element) endpoints = cls._schema_on_200.properties.endpoints endpoints.Element = AAZObjectType() @@ -296,7 +299,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.endpoints.Element.attributes attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) + _WaitHelper._build_schema_attributes_read(attributes.Element) roles = cls._schema_on_200.properties.roles roles.Element = AAZObjectType() @@ -328,7 +331,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.roles.Element.attributes attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) + _WaitHelper._build_schema_attributes_read(attributes.Element) permissions = cls._schema_on_200.properties.roles.Element.permissions permissions.Element = AAZStrType() @@ -359,27 +362,27 @@ def _build_schema_on_200(cls): class _WaitHelper: """Helper class for Wait""" - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value __all__ = ["Wait"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/compute/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/__cmd_group.py similarity index 91% rename from src/neon/azext_neon/aaz/latest/neon/postgres/compute/__cmd_group.py rename to src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/__cmd_group.py index 7bd7ec94991..582362e6762 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/compute/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/__cmd_group.py @@ -12,10 +12,10 @@ @register_command_group( - "neon postgres compute", + "neon postgres endpoint", ) class __CMDGroup(AAZCommandGroup): - """Manage Compute + """Manage Endpoint """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/compute/__init__.py b/src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/__init__.py similarity index 100% rename from src/neon/azext_neon/aaz/latest/neon/postgres/compute/__init__.py rename to src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/__init__.py diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/compute/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/_list.py similarity index 86% rename from src/neon/azext_neon/aaz/latest/neon/postgres/compute/_list.py rename to src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/_list.py index 87084268809..e4bb4d22bf2 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/compute/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/endpoint/_list.py @@ -12,16 +12,16 @@ @register_command( - "neon postgres compute list", + "neon postgres endpoint list", ) class List(AAZCommand): - """List Compute resources by Branch + """List all endpoints in a Neon branch. """ _aaz_info = { "version": "2025-03-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}/projects/{}/branches/{}/computes", "2025-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}/projects/{}/branches/{}/endpoints", "2025-03-01"], ] } @@ -42,41 +42,44 @@ def _build_arguments_schema(cls, *args, **kwargs): # define Arg Group "" _args_schema = cls._args_schema - _args_schema.branch_name = AAZStrArg( - options=["--branch-name"], - help="The name of the Branch", + _args_schema.branch_id = AAZStrArg( + options=["--branch-id"], + help="Id of the Neon branch", required=True, fmt=AAZStrArgFormat( - pattern="^[a-zA-Z0-9-]{3,24}$", + pattern="^\\S.{0,62}\\S$|^\\S$", ), ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, fmt=AAZStrArgFormat( pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) - _args_schema.project_id = AAZStrArg( - options=["--project-id"], - help="The name of the Neon Project resource.", + _args_schema.project_name = AAZStrArg( + options=["--project-name"], + help="Name of the Neon project.", required=True, fmt=AAZStrArgFormat( - pattern="^[a-zA-Z0-9-]{3,24}$", + pattern="^\\S.{0,62}\\S$|^\\S$", ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="Name of the Resource Group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema def _execute_operations(self): self.pre_operations() - self.ComputesList(ctx=self.ctx)() + self.EndpointsList(ctx=self.ctx)() self.post_operations() @register_callback @@ -92,7 +95,7 @@ def _output(self, *args, **kwargs): next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link - class ComputesList(AAZHttpOperation): + class EndpointsList(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -106,7 +109,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints", **self.url_parameters ) @@ -122,7 +125,7 @@ def error_format(self): def url_parameters(self): parameters = { **self.serialize_url_param( - "branchName", self.ctx.args.branch_name, + "branchName", self.ctx.args.branch_id, required=True, ), **self.serialize_url_param( @@ -130,7 +133,7 @@ def url_parameters(self): required=True, ), **self.serialize_url_param( - "projectName", self.ctx.args.project_id, + "projectName", self.ctx.args.project_name, required=True, ), **self.serialize_url_param( @@ -209,13 +212,16 @@ def _build_schema_on_200(cls): properties = cls._schema_on_200.value.Element.properties properties.attributes = AAZListType() - properties.cpu_cores = AAZIntType( - serialized_name="cpuCores", + properties.branch_id = AAZStrType( + serialized_name="branchId", ) properties.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) + properties.endpoint_type = AAZStrType( + serialized_name="endpointType", + ) properties.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, @@ -223,13 +229,13 @@ def _build_schema_on_200(cls): properties.entity_name = AAZStrType( serialized_name="entityName", ) - properties.memory = AAZIntType() + properties.project_id = AAZStrType( + serialized_name="projectId", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - properties.region = AAZStrType() - properties.status = AAZStrType() attributes = cls._schema_on_200.value.Element.properties.attributes attributes.Element = AAZObjectType() diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py index 1d679942e31..439e010b013 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py @@ -15,7 +15,7 @@ "neon postgres neon-database list", ) class List(AAZCommand): - """List NeonDatabase resources by Branch + """List all databases in a Neon branch. :example: List Neon Databases under a Branch az neon postgres neon-database list --resource-group rgneon --organization-name org-test-cli --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr @@ -47,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.branch_id = AAZStrArg( options=["--branch-id"], - help="The id of the Neon Branch resource", + help="Id of the Neon branch", required=True, fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", @@ -55,24 +55,27 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, fmt=AAZStrArgFormat( pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -109,7 +112,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neondatabases", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases", **self.url_parameters ) diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py index 8ca4d6f5cc3..a058344d775 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py @@ -15,7 +15,7 @@ "neon postgres neon-role list", ) class List(AAZCommand): - """List NeonRole resources by Branch + """List all roles in a Neon branch. :example: List Neon Roles under a Branch az neon postgres neon-role list --resource-group rgneon --organization-name org-test-cli --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr @@ -47,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.branch_id = AAZStrArg( options=["--branch-id"], - help="The id of the Neon Branch resource", + help="Id of the Neon branch", required=True, fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", @@ -55,24 +55,27 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, fmt=AAZStrArgFormat( pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -109,7 +112,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonroles", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles", **self.url_parameters ) diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_create.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_create.py index dff71f94fff..b542548bd6d 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_create.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_create.py @@ -15,7 +15,7 @@ "neon postgres organization create", ) class Create(AAZCommand): - """Create a Neon Postgres organization + """Create a new Neon organization within a specified Azure resource group in Azure. This is typically the first step in provisioning Neon Serverless Postgres. :example: Create Neon Postgres Organization az az neon postgres organization create --resource-group sralluri_rg --name Org-cli-test --location "Central US EUAP" --subscription 68a546de-5736-48e8-a69a-5cc636794112 --marketplace-details "{subscription-id:329b25d9-168d-48d5-de4b-28b2324db159,subscription-status:Pending-fullfilment,offer-details:{publisher-id:neon1722366567200,offer-id:neon_serverless_postgres_azure_prod,plan-id:neon_serverless_postgres_azure_prod_free,plan-name:'Free Plan',term-unit:P1M,term-id:gmz7xq9ge3py}}" --user-details "{first-name:User,last-name:Conotoso,email-address:contoso@outlook.com,upn:contoso@outlook.com,phone-number:''}" --company-details "{company-name:'',country:'',business-phone:''}" --partner-organization-properties "{organization-name:Org-cli-test}" --project-properties "{region:'Central US EUAP',pgVersion:17,branch:{branch-name:main,database-name:neondb,role-name:owner_role},project-name:Org-cli-test-project}" @@ -57,7 +57,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) @@ -297,176 +297,176 @@ def _build_arguments_schema(cls, *args, **kwargs): tags.Element = AAZStrArg() return cls._args_schema - _args_models_attributes_create = None + _args_attributes_create = None @classmethod - def _build_args_models_attributes_create(cls, _schema): - if cls._args_models_attributes_create is not None: - _schema.name = cls._args_models_attributes_create.name - _schema.value = cls._args_models_attributes_create.value + def _build_args_attributes_create(cls, _schema): + if cls._args_attributes_create is not None: + _schema.name = cls._args_attributes_create.name + _schema.value = cls._args_attributes_create.value return - cls._args_models_attributes_create = AAZObjectArg() + cls._args_attributes_create = AAZObjectArg() - models_attributes_create = cls._args_models_attributes_create - models_attributes_create.name = AAZStrArg( + attributes_create = cls._args_attributes_create + attributes_create.name = AAZStrArg( options=["name"], help="Name of the attribute", required=True, ) - models_attributes_create.value = AAZStrArg( + attributes_create.value = AAZStrArg( options=["value"], help="Value of the attribute", required=True, ) - _schema.name = cls._args_models_attributes_create.name - _schema.value = cls._args_models_attributes_create.value + _schema.name = cls._args_attributes_create.name + _schema.value = cls._args_attributes_create.value - _args_models_endpoint_properties_create = None + _args_endpoint_properties_create = None @classmethod - def _build_args_models_endpoint_properties_create(cls, _schema): - if cls._args_models_endpoint_properties_create is not None: - _schema.attributes = cls._args_models_endpoint_properties_create.attributes - _schema.branch_id = cls._args_models_endpoint_properties_create.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_create.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_create.entity_name - _schema.project_id = cls._args_models_endpoint_properties_create.project_id + def _build_args_endpoint_properties_create(cls, _schema): + if cls._args_endpoint_properties_create is not None: + _schema.attributes = cls._args_endpoint_properties_create.attributes + _schema.branch_id = cls._args_endpoint_properties_create.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_create.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_create.entity_name + _schema.project_id = cls._args_endpoint_properties_create.project_id return - cls._args_models_endpoint_properties_create = AAZObjectArg() + cls._args_endpoint_properties_create = AAZObjectArg() - models_endpoint_properties_create = cls._args_models_endpoint_properties_create - models_endpoint_properties_create.attributes = AAZListArg( + endpoint_properties_create = cls._args_endpoint_properties_create + endpoint_properties_create.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", ) - models_endpoint_properties_create.branch_id = AAZStrArg( + endpoint_properties_create.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this endpoint belongs to", ) - models_endpoint_properties_create.endpoint_type = AAZStrArg( + endpoint_properties_create.endpoint_type = AAZStrArg( options=["endpoint-type"], help="The type of the endpoint", enum={"read_only": "read_only", "read_write": "read_write"}, ) - models_endpoint_properties_create.entity_name = AAZStrArg( + endpoint_properties_create.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_endpoint_properties_create.project_id = AAZStrArg( + endpoint_properties_create.project_id = AAZStrArg( options=["project-id"], help="The ID of the project this endpoint belongs to", ) - attributes = cls._args_models_endpoint_properties_create.attributes + attributes = cls._args_endpoint_properties_create.attributes attributes.Element = AAZObjectArg() - cls._build_args_models_attributes_create(attributes.Element) + cls._build_args_attributes_create(attributes.Element) - _schema.attributes = cls._args_models_endpoint_properties_create.attributes - _schema.branch_id = cls._args_models_endpoint_properties_create.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_create.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_create.entity_name - _schema.project_id = cls._args_models_endpoint_properties_create.project_id + _schema.attributes = cls._args_endpoint_properties_create.attributes + _schema.branch_id = cls._args_endpoint_properties_create.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_create.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_create.entity_name + _schema.project_id = cls._args_endpoint_properties_create.project_id - _args_models_neon_database_properties_create = None + _args_neon_database_properties_create = None @classmethod - def _build_args_models_neon_database_properties_create(cls, _schema): - if cls._args_models_neon_database_properties_create is not None: - _schema.attributes = cls._args_models_neon_database_properties_create.attributes - _schema.branch_id = cls._args_models_neon_database_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_create.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_create.owner_name + def _build_args_neon_database_properties_create(cls, _schema): + if cls._args_neon_database_properties_create is not None: + _schema.attributes = cls._args_neon_database_properties_create.attributes + _schema.branch_id = cls._args_neon_database_properties_create.branch_id + _schema.entity_name = cls._args_neon_database_properties_create.entity_name + _schema.owner_name = cls._args_neon_database_properties_create.owner_name return - cls._args_models_neon_database_properties_create = AAZObjectArg() + cls._args_neon_database_properties_create = AAZObjectArg() - models_neon_database_properties_create = cls._args_models_neon_database_properties_create - models_neon_database_properties_create.attributes = AAZListArg( + neon_database_properties_create = cls._args_neon_database_properties_create + neon_database_properties_create.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", ) - models_neon_database_properties_create.branch_id = AAZStrArg( + neon_database_properties_create.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this database belongs to", ) - models_neon_database_properties_create.entity_name = AAZStrArg( + neon_database_properties_create.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_neon_database_properties_create.owner_name = AAZStrArg( + neon_database_properties_create.owner_name = AAZStrArg( options=["owner-name"], help="The name of the role that owns the database", ) - attributes = cls._args_models_neon_database_properties_create.attributes + attributes = cls._args_neon_database_properties_create.attributes attributes.Element = AAZObjectArg() - cls._build_args_models_attributes_create(attributes.Element) + cls._build_args_attributes_create(attributes.Element) - _schema.attributes = cls._args_models_neon_database_properties_create.attributes - _schema.branch_id = cls._args_models_neon_database_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_create.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_create.owner_name + _schema.attributes = cls._args_neon_database_properties_create.attributes + _schema.branch_id = cls._args_neon_database_properties_create.branch_id + _schema.entity_name = cls._args_neon_database_properties_create.entity_name + _schema.owner_name = cls._args_neon_database_properties_create.owner_name - _args_models_neon_role_properties_create = None + _args_neon_role_properties_create = None @classmethod - def _build_args_models_neon_role_properties_create(cls, _schema): - if cls._args_models_neon_role_properties_create is not None: - _schema.attributes = cls._args_models_neon_role_properties_create.attributes - _schema.branch_id = cls._args_models_neon_role_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_create.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_create.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_create.permissions + def _build_args_neon_role_properties_create(cls, _schema): + if cls._args_neon_role_properties_create is not None: + _schema.attributes = cls._args_neon_role_properties_create.attributes + _schema.branch_id = cls._args_neon_role_properties_create.branch_id + _schema.entity_name = cls._args_neon_role_properties_create.entity_name + _schema.is_super_user = cls._args_neon_role_properties_create.is_super_user + _schema.permissions = cls._args_neon_role_properties_create.permissions return - cls._args_models_neon_role_properties_create = AAZObjectArg() + cls._args_neon_role_properties_create = AAZObjectArg() - models_neon_role_properties_create = cls._args_models_neon_role_properties_create - models_neon_role_properties_create.attributes = AAZListArg( + neon_role_properties_create = cls._args_neon_role_properties_create + neon_role_properties_create.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", ) - models_neon_role_properties_create.branch_id = AAZStrArg( + neon_role_properties_create.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this role belongs to", ) - models_neon_role_properties_create.entity_name = AAZStrArg( + neon_role_properties_create.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_neon_role_properties_create.is_super_user = AAZBoolArg( + neon_role_properties_create.is_super_user = AAZBoolArg( options=["is-super-user"], help="Indicates whether the role has superuser privileges", ) - models_neon_role_properties_create.permissions = AAZListArg( + neon_role_properties_create.permissions = AAZListArg( options=["permissions"], help="Permissions assigned to the role", ) - attributes = cls._args_models_neon_role_properties_create.attributes + attributes = cls._args_neon_role_properties_create.attributes attributes.Element = AAZObjectArg() - cls._build_args_models_attributes_create(attributes.Element) + cls._build_args_attributes_create(attributes.Element) - permissions = cls._args_models_neon_role_properties_create.permissions + permissions = cls._args_neon_role_properties_create.permissions permissions.Element = AAZStrArg() - _schema.attributes = cls._args_models_neon_role_properties_create.attributes - _schema.branch_id = cls._args_models_neon_role_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_create.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_create.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_create.permissions + _schema.attributes = cls._args_neon_role_properties_create.attributes + _schema.branch_id = cls._args_neon_role_properties_create.branch_id + _schema.entity_name = cls._args_neon_role_properties_create.entity_name + _schema.is_super_user = cls._args_neon_role_properties_create.is_super_user + _schema.permissions = cls._args_neon_role_properties_create.permissions def _execute_operations(self): self.pre_operations() @@ -832,7 +832,7 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.project_properties.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) branch = cls._schema_on_200_201.properties.project_properties.branch branch.attributes = AAZListType() @@ -869,23 +869,23 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.project_properties.branch.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200_201.properties.project_properties.branch.databases databases.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_database_properties_read(databases.Element) + _CreateHelper._build_schema_neon_database_properties_read(databases.Element) endpoints = cls._schema_on_200_201.properties.project_properties.branch.endpoints endpoints.Element = AAZObjectType() - _CreateHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _CreateHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200_201.properties.project_properties.branch.roles roles.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_role_properties_read(roles.Element) + _CreateHelper._build_schema_neon_role_properties_read(roles.Element) databases = cls._schema_on_200_201.properties.project_properties.databases databases.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_database_properties_read(databases.Element) + _CreateHelper._build_schema_neon_database_properties_read(databases.Element) default_endpoint_settings = cls._schema_on_200_201.properties.project_properties.default_endpoint_settings default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( @@ -899,11 +899,11 @@ def _build_schema_on_200_201(cls): endpoints = cls._schema_on_200_201.properties.project_properties.endpoints endpoints.Element = AAZObjectType() - _CreateHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _CreateHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200_201.properties.project_properties.roles roles.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_role_properties_read(roles.Element) + _CreateHelper._build_schema_neon_role_properties_read(roles.Element) user_details = cls._schema_on_200_201.properties.user_details user_details.email_address = AAZStrType( @@ -950,14 +950,14 @@ class _CreateHelper: """Helper class for Create""" @classmethod - def _build_schema_models_attributes_create(cls, _builder): + def _build_schema_attributes_create(cls, _builder): if _builder is None: return _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) @classmethod - def _build_schema_models_endpoint_properties_create(cls, _builder): + def _build_schema_endpoint_properties_create(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -968,10 +968,10 @@ def _build_schema_models_endpoint_properties_create(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_create(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_create(attributes.set_elements(AAZObjectType, ".")) @classmethod - def _build_schema_models_neon_database_properties_create(cls, _builder): + def _build_schema_neon_database_properties_create(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -981,10 +981,10 @@ def _build_schema_models_neon_database_properties_create(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_create(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_create(attributes.set_elements(AAZObjectType, ".")) @classmethod - def _build_schema_models_neon_role_properties_create(cls, _builder): + def _build_schema_neon_role_properties_create(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -995,200 +995,200 @@ def _build_schema_models_neon_role_properties_create(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_create(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_create(attributes.set_elements(AAZObjectType, ".")) permissions = _builder.get(".permissions") if permissions is not None: permissions.set_elements(AAZStrType, ".") - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value - _schema_models_endpoint_properties_read = None + _schema_endpoint_properties_read = None @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state return - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_endpoint_properties_read.created_at = AAZStrType( + endpoint_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_endpoint_properties_read.endpoint_type = AAZStrType( + endpoint_properties_read.endpoint_type = AAZStrType( serialized_name="endpointType", ) - models_endpoint_properties_read.entity_id = AAZStrType( + endpoint_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_endpoint_properties_read.entity_name = AAZStrType( + endpoint_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_endpoint_properties_read.project_id = AAZStrType( + endpoint_properties_read.project_id = AAZStrType( serialized_name="projectId", ) - models_endpoint_properties_read.provisioning_state = AAZStrType( + endpoint_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_endpoint_properties_read.attributes + attributes = _schema_endpoint_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state - _schema_models_neon_database_properties_read = None + _schema_neon_database_properties_read = None @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state return - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_database_properties_read.created_at = AAZStrType( + neon_database_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_id = AAZStrType( + neon_database_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_name = AAZStrType( + neon_database_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_database_properties_read.owner_name = AAZStrType( + neon_database_properties_read.owner_name = AAZStrType( serialized_name="ownerName", ) - models_neon_database_properties_read.provisioning_state = AAZStrType( + neon_database_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_database_properties_read.attributes + attributes = _schema_neon_database_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state - _schema_models_neon_role_properties_read = None + _schema_neon_role_properties_read = None @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state return - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_role_properties_read.created_at = AAZStrType( + neon_role_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_id = AAZStrType( + neon_role_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_name = AAZStrType( + neon_role_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_role_properties_read.is_super_user = AAZBoolType( + neon_role_properties_read.is_super_user = AAZBoolType( serialized_name="isSuperUser", ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_role_properties_read.attributes + attributes = _schema_neon_role_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - permissions = _schema_models_neon_role_properties_read.permissions + permissions = _schema_neon_role_properties_read.permissions permissions.Element = AAZStrType() - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state __all__ = ["Create"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py index 805cd2682eb..8c784f680a2 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py @@ -17,16 +17,16 @@ confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): - """Delete a Neon Postgres Organization + """Delete an existing Neon organization. - :example: Delete Neon Postgres Organization + :example: Organizations_Delete az neon postgres organization delete --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup --name demoNeonResource """ _aaz_info = { - "version": "2025-03-01", + "version": "2024-08-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], ] } @@ -59,7 +59,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the resource group", required=True, ) return cls._args_schema @@ -150,7 +150,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2025-03-01", + "api-version", "2024-08-01-preview", required=True, ), } diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py index 4b5c81e0b6f..7a696a92546 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py @@ -16,17 +16,17 @@ is_preview=True, ) class List(AAZCommand): - """List Neon organizations by subscription ID + """List all Neon organizations under a subscription. - :example: List Neon Postgres Organization + :example: Organizations_ListBySubscription az neon postgres organization list --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup """ _aaz_info = { - "version": "2025-03-01", + "version": "2024-08-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/neon.postgres/organizations", "2025-03-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations", "2025-03-01"], + ["mgmt-plane", "/subscriptions/{}/providers/neon.postgres/organizations", "2024-08-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations", "2024-08-01-preview"], ] } @@ -48,18 +48,18 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the resource group", ) return cls._args_schema def _execute_operations(self): self.pre_operations() - condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True if condition_0: - self.OrganizationsListBySubscription(ctx=self.ctx)() - if condition_1: self.OrganizationsListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.OrganizationsListBySubscription(ctx=self.ctx)() self.post_operations() @register_callback @@ -75,7 +75,7 @@ def _output(self, *args, **kwargs): next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link - class OrganizationsListBySubscription(AAZHttpOperation): + class OrganizationsListByResourceGroup(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -89,7 +89,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Neon.Postgres/organizations", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations", **self.url_parameters ) @@ -104,6 +104,10 @@ def error_format(self): @property def url_parameters(self): parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, @@ -115,7 +119,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2025-03-01", + "api-version", "2024-08-01-preview", required=True, ), } @@ -190,9 +194,6 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) - properties.project_properties = AAZObjectType( - serialized_name="projectProperties", - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -282,116 +283,6 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.value.Element.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() - project_properties = cls._schema_on_200.value.Element.properties.project_properties - project_properties.attributes = AAZListType() - project_properties.branch = AAZObjectType() - project_properties.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - project_properties.databases = AAZListType() - project_properties.default_endpoint_settings = AAZObjectType( - serialized_name="defaultEndpointSettings", - ) - project_properties.endpoints = AAZListType() - project_properties.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - project_properties.entity_name = AAZStrType( - serialized_name="entityName", - ) - project_properties.history_retention = AAZIntType( - serialized_name="historyRetention", - ) - project_properties.pg_version = AAZIntType( - serialized_name="pgVersion", - ) - project_properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - project_properties.region_id = AAZStrType( - serialized_name="regionId", - ) - project_properties.roles = AAZListType() - project_properties.storage = AAZIntType() - - attributes = cls._schema_on_200.value.Element.properties.project_properties.attributes - attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) - - branch = cls._schema_on_200.value.Element.properties.project_properties.branch - branch.attributes = AAZListType() - branch.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - branch.database_name = AAZStrType( - serialized_name="databaseName", - ) - branch.databases = AAZListType() - branch.endpoints = AAZListType() - branch.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - branch.entity_name = AAZStrType( - serialized_name="entityName", - ) - branch.parent_id = AAZStrType( - serialized_name="parentId", - ) - branch.project_id = AAZStrType( - serialized_name="projectId", - ) - branch.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - branch.role_name = AAZStrType( - serialized_name="roleName", - ) - branch.roles = AAZListType() - - attributes = cls._schema_on_200.value.Element.properties.project_properties.branch.attributes - attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) - - databases = cls._schema_on_200.value.Element.properties.project_properties.branch.databases - databases.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_database_properties_read(databases.Element) - - endpoints = cls._schema_on_200.value.Element.properties.project_properties.branch.endpoints - endpoints.Element = AAZObjectType() - _ListHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.value.Element.properties.project_properties.branch.roles - roles.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_role_properties_read(roles.Element) - - databases = cls._schema_on_200.value.Element.properties.project_properties.databases - databases.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_database_properties_read(databases.Element) - - default_endpoint_settings = cls._schema_on_200.value.Element.properties.project_properties.default_endpoint_settings - default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( - serialized_name="autoscalingLimitMaxCu", - flags={"required": True}, - ) - default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( - serialized_name="autoscalingLimitMinCu", - flags={"required": True}, - ) - - endpoints = cls._schema_on_200.value.Element.properties.project_properties.endpoints - endpoints.Element = AAZObjectType() - _ListHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.value.Element.properties.project_properties.roles - roles.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_role_properties_read(roles.Element) - user_details = cls._schema_on_200.value.Element.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -432,7 +323,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 - class OrganizationsListByResourceGroup(AAZHttpOperation): + class OrganizationsListBySubscription(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -446,7 +337,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations", + "/subscriptions/{subscriptionId}/providers/Neon.Postgres/organizations", **self.url_parameters ) @@ -461,10 +352,6 @@ def error_format(self): @property def url_parameters(self): parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, @@ -476,7 +363,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2025-03-01", + "api-version", "2024-08-01-preview", required=True, ), } @@ -551,9 +438,6 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) - properties.project_properties = AAZObjectType( - serialized_name="projectProperties", - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -643,116 +527,6 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.value.Element.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() - project_properties = cls._schema_on_200.value.Element.properties.project_properties - project_properties.attributes = AAZListType() - project_properties.branch = AAZObjectType() - project_properties.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - project_properties.databases = AAZListType() - project_properties.default_endpoint_settings = AAZObjectType( - serialized_name="defaultEndpointSettings", - ) - project_properties.endpoints = AAZListType() - project_properties.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - project_properties.entity_name = AAZStrType( - serialized_name="entityName", - ) - project_properties.history_retention = AAZIntType( - serialized_name="historyRetention", - ) - project_properties.pg_version = AAZIntType( - serialized_name="pgVersion", - ) - project_properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - project_properties.region_id = AAZStrType( - serialized_name="regionId", - ) - project_properties.roles = AAZListType() - project_properties.storage = AAZIntType() - - attributes = cls._schema_on_200.value.Element.properties.project_properties.attributes - attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) - - branch = cls._schema_on_200.value.Element.properties.project_properties.branch - branch.attributes = AAZListType() - branch.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - branch.database_name = AAZStrType( - serialized_name="databaseName", - ) - branch.databases = AAZListType() - branch.endpoints = AAZListType() - branch.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - branch.entity_name = AAZStrType( - serialized_name="entityName", - ) - branch.parent_id = AAZStrType( - serialized_name="parentId", - ) - branch.project_id = AAZStrType( - serialized_name="projectId", - ) - branch.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - branch.role_name = AAZStrType( - serialized_name="roleName", - ) - branch.roles = AAZListType() - - attributes = cls._schema_on_200.value.Element.properties.project_properties.branch.attributes - attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) - - databases = cls._schema_on_200.value.Element.properties.project_properties.branch.databases - databases.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_database_properties_read(databases.Element) - - endpoints = cls._schema_on_200.value.Element.properties.project_properties.branch.endpoints - endpoints.Element = AAZObjectType() - _ListHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.value.Element.properties.project_properties.branch.roles - roles.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_role_properties_read(roles.Element) - - databases = cls._schema_on_200.value.Element.properties.project_properties.databases - databases.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_database_properties_read(databases.Element) - - default_endpoint_settings = cls._schema_on_200.value.Element.properties.project_properties.default_endpoint_settings - default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( - serialized_name="autoscalingLimitMaxCu", - flags={"required": True}, - ) - default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( - serialized_name="autoscalingLimitMinCu", - flags={"required": True}, - ) - - endpoints = cls._schema_on_200.value.Element.properties.project_properties.endpoints - endpoints.Element = AAZObjectType() - _ListHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.value.Element.properties.project_properties.roles - roles.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_role_properties_read(roles.Element) - user_details = cls._schema_on_200.value.Element.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -797,194 +571,5 @@ def _build_schema_on_200(cls): class _ListHelper: """Helper class for List""" - _schema_models_attributes_read = None - - @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - return - - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() - - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( - flags={"required": True}, - ) - models_attributes_read.value = AAZStrType( - flags={"required": True}, - ) - - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - - _schema_models_endpoint_properties_read = None - - @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - return - - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() - - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_endpoint_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_endpoint_properties_read.endpoint_type = AAZStrType( - serialized_name="endpointType", - ) - models_endpoint_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_endpoint_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_endpoint_properties_read.project_id = AAZStrType( - serialized_name="projectId", - ) - models_endpoint_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_endpoint_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - - _schema_models_neon_database_properties_read = None - - @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - return - - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() - - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_database_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_database_properties_read.owner_name = AAZStrType( - serialized_name="ownerName", - ) - models_neon_database_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_database_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - - _schema_models_neon_role_properties_read = None - - @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - return - - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() - - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_role_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_role_properties_read.is_super_user = AAZBoolType( - serialized_name="isSuperUser", - ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_role_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - permissions = _schema_models_neon_role_properties_read.permissions - permissions.Element = AAZStrType() - - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - __all__ = ["List"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py index 917f3debd52..de03b269af1 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py @@ -16,16 +16,16 @@ is_preview=True, ) class Show(AAZCommand): - """Get a Neon organization + """Retrieve details of a specific Neon organization. - :example: Show Neon Postgres Organization - az neon postgres organization show --resource-group demoResourceGroup --name demoNeonResource + :example: Organizations_Get + az neon postgres organization show --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup --name demoNeonResource """ _aaz_info = { - "version": "2025-03-01", + "version": "2024-08-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], ] } @@ -57,7 +57,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the resource group", required=True, ) return cls._args_schema @@ -127,7 +127,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2025-03-01", + "api-version", "2024-08-01-preview", required=True, ), } @@ -191,9 +191,6 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) - properties.project_properties = AAZObjectType( - serialized_name="projectProperties", - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -283,116 +280,6 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() - project_properties = cls._schema_on_200.properties.project_properties - project_properties.attributes = AAZListType() - project_properties.branch = AAZObjectType() - project_properties.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - project_properties.databases = AAZListType() - project_properties.default_endpoint_settings = AAZObjectType( - serialized_name="defaultEndpointSettings", - ) - project_properties.endpoints = AAZListType() - project_properties.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - project_properties.entity_name = AAZStrType( - serialized_name="entityName", - ) - project_properties.history_retention = AAZIntType( - serialized_name="historyRetention", - ) - project_properties.pg_version = AAZIntType( - serialized_name="pgVersion", - ) - project_properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - project_properties.region_id = AAZStrType( - serialized_name="regionId", - ) - project_properties.roles = AAZListType() - project_properties.storage = AAZIntType() - - attributes = cls._schema_on_200.properties.project_properties.attributes - attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) - - branch = cls._schema_on_200.properties.project_properties.branch - branch.attributes = AAZListType() - branch.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - branch.database_name = AAZStrType( - serialized_name="databaseName", - ) - branch.databases = AAZListType() - branch.endpoints = AAZListType() - branch.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - branch.entity_name = AAZStrType( - serialized_name="entityName", - ) - branch.parent_id = AAZStrType( - serialized_name="parentId", - ) - branch.project_id = AAZStrType( - serialized_name="projectId", - ) - branch.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - branch.role_name = AAZStrType( - serialized_name="roleName", - ) - branch.roles = AAZListType() - - attributes = cls._schema_on_200.properties.project_properties.branch.attributes - attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) - - databases = cls._schema_on_200.properties.project_properties.branch.databases - databases.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_database_properties_read(databases.Element) - - endpoints = cls._schema_on_200.properties.project_properties.branch.endpoints - endpoints.Element = AAZObjectType() - _ShowHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.properties.project_properties.branch.roles - roles.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_role_properties_read(roles.Element) - - databases = cls._schema_on_200.properties.project_properties.databases - databases.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_database_properties_read(databases.Element) - - default_endpoint_settings = cls._schema_on_200.properties.project_properties.default_endpoint_settings - default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( - serialized_name="autoscalingLimitMaxCu", - flags={"required": True}, - ) - default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( - serialized_name="autoscalingLimitMinCu", - flags={"required": True}, - ) - - endpoints = cls._schema_on_200.properties.project_properties.endpoints - endpoints.Element = AAZObjectType() - _ShowHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.properties.project_properties.roles - roles.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_role_properties_read(roles.Element) - user_details = cls._schema_on_200.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -437,194 +324,5 @@ def _build_schema_on_200(cls): class _ShowHelper: """Helper class for Show""" - _schema_models_attributes_read = None - - @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - return - - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() - - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( - flags={"required": True}, - ) - models_attributes_read.value = AAZStrType( - flags={"required": True}, - ) - - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - - _schema_models_endpoint_properties_read = None - - @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - return - - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() - - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_endpoint_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_endpoint_properties_read.endpoint_type = AAZStrType( - serialized_name="endpointType", - ) - models_endpoint_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_endpoint_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_endpoint_properties_read.project_id = AAZStrType( - serialized_name="projectId", - ) - models_endpoint_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_endpoint_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - - _schema_models_neon_database_properties_read = None - - @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - return - - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() - - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_database_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_database_properties_read.owner_name = AAZStrType( - serialized_name="ownerName", - ) - models_neon_database_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_database_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - - _schema_models_neon_role_properties_read = None - - @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - return - - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() - - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_role_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_role_properties_read.is_super_user = AAZBoolType( - serialized_name="isSuperUser", - ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_role_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - permissions = _schema_models_neon_role_properties_read.permissions - permissions.Element = AAZStrType() - - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - __all__ = ["Show"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py index f7c8346a3a1..d386a70f82a 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py @@ -13,18 +13,19 @@ @register_command( "neon postgres organization update", + is_preview=True, ) class Update(AAZCommand): - """Updates a Neon Postgres organization + """Update metadata for an existing Neon organization. - :example: Update Neon Postgres Organization - az neon postgres create --resource-group demoResourceGroup --name demoNeonResource --location eastus2 --subscription 12345678-1234-1234-1234-123456789abc --marketplace-details "{subscription-id:abcd1234-5678-90ab-cdef-12345678abcd,subscription-status:Subscribed,offer-details:{publisher-id:neon1722366567200,offer-id:neon_serverless_postgres_azure_prod,plan-id:neon_serverless_postgres_azure_prod_scale,plan-name:Scale Plan,term-unit:P1M,term-id:gmz7xq9ge3py}}" --company-details "{}" --partner-organization-properties "{}" + :example: Organization_Update + az az neon postgres organization update --resource-group demoResourceGroup --name demoNeonResource --user-details "{first-name:John,last-name:Doe,email-address:johndoe@example.com,upn:johndoe,phone-number:+1234567890}" --company-details "{company-name:DemoCompany,country:USA,office-address:'123 Azure Ave, Redmond, WA',business-phone:+9876543210,domain:democompany.com,number-of-employees:1000}" --partner-organization-properties "{organization-id:org-5678,org-name:PartnerOrg,single-sign-on-properties:{single-sign-on-state:Enable,enterprise-app-id:app-9876,single-sign-on-url:'https://sso.partnerorg.com',aad-domains:['partnerorg.com']}}" --tags "{environment:production}" """ _aaz_info = { - "version": "2025-03-01", + "version": "2024-08-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], ] } @@ -59,7 +60,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the resource group", required=True, ) @@ -71,10 +72,16 @@ def _build_arguments_schema(cls, *args, **kwargs): arg_group="Properties", help="Details of the company.", ) - _args_schema.marketplace_details = AAZObjectArg( - options=["--marketplace-details"], + _args_schema.partner_organization_properties = AAZObjectArg( + options=["--partner-org-props", "--partner-organization-properties"], arg_group="Properties", - help="Marketplace details of the resource.", + help="Organization properties", + nullable=True, + ) + _args_schema.user_details = AAZObjectArg( + options=["--user-details"], + arg_group="Properties", + help="Details of the user.", ) company_details = cls._args_schema.company_details @@ -109,266 +116,100 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) - marketplace_details = cls._args_schema.marketplace_details - marketplace_details.offer_details = AAZObjectArg( - options=["offer-details"], - help="Offer details for the marketplace that is selected by the user", - ) - marketplace_details.subscription_id = AAZStrArg( - options=["subscription-id"], - help="SaaS subscription id for the the marketplace offer", - nullable=True, - ) - marketplace_details.subscription_status = AAZStrArg( - options=["subscription-status"], - help="Marketplace subscription status", - nullable=True, - enum={"PendingFulfillmentStart": "PendingFulfillmentStart", "Subscribed": "Subscribed", "Suspended": "Suspended", "Unsubscribed": "Unsubscribed"}, - ) - - offer_details = cls._args_schema.marketplace_details.offer_details - offer_details.offer_id = AAZStrArg( - options=["offer-id"], - help="Offer Id for the marketplace offer", - ) - offer_details.plan_id = AAZStrArg( - options=["plan-id"], - help="Plan Id for the marketplace offer", - ) - offer_details.plan_name = AAZStrArg( - options=["plan-name"], - help="Plan Name for the marketplace offer", - nullable=True, - ) - offer_details.publisher_id = AAZStrArg( - options=["publisher-id"], - help="Publisher Id for the marketplace offer", - ) - offer_details.term_id = AAZStrArg( - options=["term-id"], - help="Term Id for the marketplace offer", - nullable=True, - ) - offer_details.term_unit = AAZStrArg( - options=["term-unit"], - help="Term Name for the marketplace offer", - nullable=True, - ) - - # define Arg Group "Resource" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Resource", - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - return cls._args_schema - - _args_models_attributes_update = None - - @classmethod - def _build_args_models_attributes_update(cls, _schema): - if cls._args_models_attributes_update is not None: - _schema.name = cls._args_models_attributes_update.name - _schema.value = cls._args_models_attributes_update.value - return - - cls._args_models_attributes_update = AAZObjectArg( - nullable=True, - ) - - models_attributes_update = cls._args_models_attributes_update - models_attributes_update.name = AAZStrArg( - options=["name"], - help="Name of the attribute", - ) - models_attributes_update.value = AAZStrArg( - options=["value"], - help="Value of the attribute", - ) - - _schema.name = cls._args_models_attributes_update.name - _schema.value = cls._args_models_attributes_update.value - - _args_models_endpoint_properties_update = None - - @classmethod - def _build_args_models_endpoint_properties_update(cls, _schema): - if cls._args_models_endpoint_properties_update is not None: - _schema.attributes = cls._args_models_endpoint_properties_update.attributes - _schema.branch_id = cls._args_models_endpoint_properties_update.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_update.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_update.entity_name - _schema.project_id = cls._args_models_endpoint_properties_update.project_id - return - - cls._args_models_endpoint_properties_update = AAZObjectArg( - nullable=True, - ) - - models_endpoint_properties_update = cls._args_models_endpoint_properties_update - models_endpoint_properties_update.attributes = AAZListArg( - options=["attributes"], - help="Additional attributes for the entity", - nullable=True, - ) - models_endpoint_properties_update.branch_id = AAZStrArg( - options=["branch-id"], - help="The ID of the branch this endpoint belongs to", - nullable=True, - ) - models_endpoint_properties_update.endpoint_type = AAZStrArg( - options=["endpoint-type"], - help="The type of the endpoint", + partner_organization_properties = cls._args_schema.partner_organization_properties + partner_organization_properties.organization_id = AAZStrArg( + options=["organization-id"], + help="Organization Id in partner's system", nullable=True, - enum={"read_only": "read_only", "read_write": "read_write"}, ) - models_endpoint_properties_update.entity_name = AAZStrArg( - options=["entity-name"], - help="Name of the resource", - nullable=True, + partner_organization_properties.org_name = AAZStrArg( + options=["org-name"], + help="Organization name in partner's system", fmt=AAZStrArgFormat( - pattern="^\\S.{0,62}\\S$|^\\S$", + pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", + max_length=50, + min_length=1, ), ) - models_endpoint_properties_update.project_id = AAZStrArg( - options=["project-id"], - help="The ID of the project this endpoint belongs to", - nullable=True, - ) - - attributes = cls._args_models_endpoint_properties_update.attributes - attributes.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_models_attributes_update(attributes.Element) - - _schema.attributes = cls._args_models_endpoint_properties_update.attributes - _schema.branch_id = cls._args_models_endpoint_properties_update.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_update.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_update.entity_name - _schema.project_id = cls._args_models_endpoint_properties_update.project_id - - _args_models_neon_database_properties_update = None - - @classmethod - def _build_args_models_neon_database_properties_update(cls, _schema): - if cls._args_models_neon_database_properties_update is not None: - _schema.attributes = cls._args_models_neon_database_properties_update.attributes - _schema.branch_id = cls._args_models_neon_database_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_update.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_update.owner_name - return - - cls._args_models_neon_database_properties_update = AAZObjectArg( + partner_organization_properties.single_sign_on_properties = AAZObjectArg( + options=["single-sign-on-properties"], + help="Single Sign On properties for the organization", nullable=True, ) - models_neon_database_properties_update = cls._args_models_neon_database_properties_update - models_neon_database_properties_update.attributes = AAZListArg( - options=["attributes"], - help="Additional attributes for the entity", + single_sign_on_properties = cls._args_schema.partner_organization_properties.single_sign_on_properties + single_sign_on_properties.aad_domains = AAZListArg( + options=["aad-domains"], + help="List of AAD domains fetched from Microsoft Graph for user.", nullable=True, ) - models_neon_database_properties_update.branch_id = AAZStrArg( - options=["branch-id"], - help="The ID of the branch this database belongs to", + single_sign_on_properties.enterprise_app_id = AAZStrArg( + options=["enterprise-app-id"], + help="AAD enterprise application Id used to setup SSO", nullable=True, ) - models_neon_database_properties_update.entity_name = AAZStrArg( - options=["entity-name"], - help="Name of the resource", + single_sign_on_properties.single_sign_on_state = AAZStrArg( + options=["single-sign-on-state"], + help="State of the Single Sign On for the organization", nullable=True, - fmt=AAZStrArgFormat( - pattern="^\\S.{0,62}\\S$|^\\S$", - ), + enum={"Disable": "Disable", "Enable": "Enable", "Initial": "Initial"}, ) - models_neon_database_properties_update.owner_name = AAZStrArg( - options=["owner-name"], - help="The name of the role that owns the database", + single_sign_on_properties.single_sign_on_url = AAZStrArg( + options=["single-sign-on-url"], + help="URL for SSO to be used by the partner to redirect the user to their system", nullable=True, ) - attributes = cls._args_models_neon_database_properties_update.attributes - attributes.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_models_attributes_update(attributes.Element) - - _schema.attributes = cls._args_models_neon_database_properties_update.attributes - _schema.branch_id = cls._args_models_neon_database_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_update.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_update.owner_name - - _args_models_neon_role_properties_update = None - - @classmethod - def _build_args_models_neon_role_properties_update(cls, _schema): - if cls._args_models_neon_role_properties_update is not None: - _schema.attributes = cls._args_models_neon_role_properties_update.attributes - _schema.branch_id = cls._args_models_neon_role_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_update.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_update.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_update.permissions - return - - cls._args_models_neon_role_properties_update = AAZObjectArg( + aad_domains = cls._args_schema.partner_organization_properties.single_sign_on_properties.aad_domains + aad_domains.Element = AAZStrArg( nullable=True, ) - models_neon_role_properties_update = cls._args_models_neon_role_properties_update - models_neon_role_properties_update.attributes = AAZListArg( - options=["attributes"], - help="Additional attributes for the entity", + user_details = cls._args_schema.user_details + user_details.email_address = AAZStrArg( + options=["email-address"], + help="Email address of the user", nullable=True, + fmt=AAZStrArgFormat( + pattern="^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$", + ), ) - models_neon_role_properties_update.branch_id = AAZStrArg( - options=["branch-id"], - help="The ID of the branch this role belongs to", + user_details.first_name = AAZStrArg( + options=["first-name"], + help="First name of the user", nullable=True, ) - models_neon_role_properties_update.entity_name = AAZStrArg( - options=["entity-name"], - help="Name of the resource", + user_details.last_name = AAZStrArg( + options=["last-name"], + help="Last name of the user", nullable=True, - fmt=AAZStrArgFormat( - pattern="^\\S.{0,62}\\S$|^\\S$", - ), ) - models_neon_role_properties_update.is_super_user = AAZBoolArg( - options=["is-super-user"], - help="Indicates whether the role has superuser privileges", + user_details.phone_number = AAZStrArg( + options=["phone-number"], + help="User's phone number", nullable=True, ) - models_neon_role_properties_update.permissions = AAZListArg( - options=["permissions"], - help="Permissions assigned to the role", + user_details.upn = AAZStrArg( + options=["upn"], + help="User's principal name", nullable=True, ) - attributes = cls._args_models_neon_role_properties_update.attributes - attributes.Element = AAZObjectArg( + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", nullable=True, ) - cls._build_args_models_attributes_update(attributes.Element) - permissions = cls._args_models_neon_role_properties_update.permissions - permissions.Element = AAZStrArg( + tags = cls._args_schema.tags + tags.Element = AAZStrArg( nullable=True, ) - - _schema.attributes = cls._args_models_neon_role_properties_update.attributes - _schema.branch_id = cls._args_models_neon_role_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_update.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_update.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_update.permissions + return cls._args_schema def _execute_operations(self): self.pre_operations() @@ -448,7 +289,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2025-03-01", + "api-version", "2024-08-01-preview", required=True, ), } @@ -547,7 +388,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2025-03-01", + "api-version", "2024-08-01-preview", required=True, ), } @@ -611,7 +452,8 @@ def _update_instance(self, instance): properties = _builder.get(".properties") if properties is not None: properties.set_prop("companyDetails", AAZObjectType, ".company_details", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("marketplaceDetails", AAZObjectType, ".marketplace_details", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("partnerOrganizationProperties", AAZObjectType, ".partner_organization_properties") + properties.set_prop("userDetails", AAZObjectType, ".user_details", typ_kwargs={"flags": {"required": True}}) company_details = _builder.get(".properties.companyDetails") if company_details is not None: @@ -622,20 +464,30 @@ def _update_instance(self, instance): company_details.set_prop("numberOfEmployees", AAZIntType, ".number_of_employees") company_details.set_prop("officeAddress", AAZStrType, ".office_address") - marketplace_details = _builder.get(".properties.marketplaceDetails") - if marketplace_details is not None: - marketplace_details.set_prop("offerDetails", AAZObjectType, ".offer_details", typ_kwargs={"flags": {"required": True}}) - marketplace_details.set_prop("subscriptionId", AAZStrType, ".subscription_id") - marketplace_details.set_prop("subscriptionStatus", AAZStrType, ".subscription_status") - - offer_details = _builder.get(".properties.marketplaceDetails.offerDetails") - if offer_details is not None: - offer_details.set_prop("offerId", AAZStrType, ".offer_id", typ_kwargs={"flags": {"required": True}}) - offer_details.set_prop("planId", AAZStrType, ".plan_id", typ_kwargs={"flags": {"required": True}}) - offer_details.set_prop("planName", AAZStrType, ".plan_name") - offer_details.set_prop("publisherId", AAZStrType, ".publisher_id", typ_kwargs={"flags": {"required": True}}) - offer_details.set_prop("termId", AAZStrType, ".term_id") - offer_details.set_prop("termUnit", AAZStrType, ".term_unit") + partner_organization_properties = _builder.get(".properties.partnerOrganizationProperties") + if partner_organization_properties is not None: + partner_organization_properties.set_prop("organizationId", AAZStrType, ".organization_id") + partner_organization_properties.set_prop("organizationName", AAZStrType, ".org_name", typ_kwargs={"flags": {"required": True}}) + partner_organization_properties.set_prop("singleSignOnProperties", AAZObjectType, ".single_sign_on_properties") + + single_sign_on_properties = _builder.get(".properties.partnerOrganizationProperties.singleSignOnProperties") + if single_sign_on_properties is not None: + single_sign_on_properties.set_prop("aadDomains", AAZListType, ".aad_domains") + single_sign_on_properties.set_prop("enterpriseAppId", AAZStrType, ".enterprise_app_id") + single_sign_on_properties.set_prop("singleSignOnState", AAZStrType, ".single_sign_on_state") + single_sign_on_properties.set_prop("singleSignOnUrl", AAZStrType, ".single_sign_on_url") + + aad_domains = _builder.get(".properties.partnerOrganizationProperties.singleSignOnProperties.aadDomains") + if aad_domains is not None: + aad_domains.set_elements(AAZStrType, ".") + + user_details = _builder.get(".properties.userDetails") + if user_details is not None: + user_details.set_prop("emailAddress", AAZStrType, ".email_address") + user_details.set_prop("firstName", AAZStrType, ".first_name") + user_details.set_prop("lastName", AAZStrType, ".last_name") + user_details.set_prop("phoneNumber", AAZStrType, ".phone_number") + user_details.set_prop("upn", AAZStrType, ".upn") tags = _builder.get(".tags") if tags is not None: @@ -655,247 +507,6 @@ def __call__(self, *args, **kwargs): class _UpdateHelper: """Helper class for Update""" - @classmethod - def _build_schema_models_attributes_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) - - @classmethod - def _build_schema_models_endpoint_properties_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("attributes", AAZListType, ".attributes") - _builder.set_prop("branchId", AAZStrType, ".branch_id") - _builder.set_prop("endpointType", AAZStrType, ".endpoint_type") - _builder.set_prop("entityName", AAZStrType, ".entity_name") - _builder.set_prop("projectId", AAZStrType, ".project_id") - - attributes = _builder.get(".attributes") - if attributes is not None: - cls._build_schema_models_attributes_update(attributes.set_elements(AAZObjectType, ".")) - - @classmethod - def _build_schema_models_neon_database_properties_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("attributes", AAZListType, ".attributes") - _builder.set_prop("branchId", AAZStrType, ".branch_id") - _builder.set_prop("entityName", AAZStrType, ".entity_name") - _builder.set_prop("ownerName", AAZStrType, ".owner_name") - - attributes = _builder.get(".attributes") - if attributes is not None: - cls._build_schema_models_attributes_update(attributes.set_elements(AAZObjectType, ".")) - - @classmethod - def _build_schema_models_neon_role_properties_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("attributes", AAZListType, ".attributes") - _builder.set_prop("branchId", AAZStrType, ".branch_id") - _builder.set_prop("entityName", AAZStrType, ".entity_name") - _builder.set_prop("isSuperUser", AAZBoolType, ".is_super_user") - _builder.set_prop("permissions", AAZListType, ".permissions") - - attributes = _builder.get(".attributes") - if attributes is not None: - cls._build_schema_models_attributes_update(attributes.set_elements(AAZObjectType, ".")) - - permissions = _builder.get(".permissions") - if permissions is not None: - permissions.set_elements(AAZStrType, ".") - - _schema_models_attributes_read = None - - @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - return - - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() - - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( - flags={"required": True}, - ) - models_attributes_read.value = AAZStrType( - flags={"required": True}, - ) - - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - - _schema_models_endpoint_properties_read = None - - @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - return - - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() - - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_endpoint_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_endpoint_properties_read.endpoint_type = AAZStrType( - serialized_name="endpointType", - ) - models_endpoint_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_endpoint_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_endpoint_properties_read.project_id = AAZStrType( - serialized_name="projectId", - ) - models_endpoint_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_endpoint_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - - _schema_models_neon_database_properties_read = None - - @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - return - - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() - - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_database_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_database_properties_read.owner_name = AAZStrType( - serialized_name="ownerName", - ) - models_neon_database_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_database_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - - _schema_models_neon_role_properties_read = None - - @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - return - - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() - - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_role_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_role_properties_read.is_super_user = AAZBoolType( - serialized_name="isSuperUser", - ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_role_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - permissions = _schema_models_neon_role_properties_read.permissions - permissions.Element = AAZStrType() - - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - _schema_organization_resource_read = None @classmethod @@ -944,9 +555,6 @@ def _build_schema_organization_resource_read(cls, _schema): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) - properties.project_properties = AAZObjectType( - serialized_name="projectProperties", - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -1036,116 +644,6 @@ def _build_schema_organization_resource_read(cls, _schema): aad_domains = _schema_organization_resource_read.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() - project_properties = _schema_organization_resource_read.properties.project_properties - project_properties.attributes = AAZListType() - project_properties.branch = AAZObjectType() - project_properties.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - project_properties.databases = AAZListType() - project_properties.default_endpoint_settings = AAZObjectType( - serialized_name="defaultEndpointSettings", - ) - project_properties.endpoints = AAZListType() - project_properties.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - project_properties.entity_name = AAZStrType( - serialized_name="entityName", - ) - project_properties.history_retention = AAZIntType( - serialized_name="historyRetention", - ) - project_properties.pg_version = AAZIntType( - serialized_name="pgVersion", - ) - project_properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - project_properties.region_id = AAZStrType( - serialized_name="regionId", - ) - project_properties.roles = AAZListType() - project_properties.storage = AAZIntType() - - attributes = _schema_organization_resource_read.properties.project_properties.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - branch = _schema_organization_resource_read.properties.project_properties.branch - branch.attributes = AAZListType() - branch.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - branch.database_name = AAZStrType( - serialized_name="databaseName", - ) - branch.databases = AAZListType() - branch.endpoints = AAZListType() - branch.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - branch.entity_name = AAZStrType( - serialized_name="entityName", - ) - branch.parent_id = AAZStrType( - serialized_name="parentId", - ) - branch.project_id = AAZStrType( - serialized_name="projectId", - ) - branch.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - branch.role_name = AAZStrType( - serialized_name="roleName", - ) - branch.roles = AAZListType() - - attributes = _schema_organization_resource_read.properties.project_properties.branch.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - databases = _schema_organization_resource_read.properties.project_properties.branch.databases - databases.Element = AAZObjectType() - cls._build_schema_models_neon_database_properties_read(databases.Element) - - endpoints = _schema_organization_resource_read.properties.project_properties.branch.endpoints - endpoints.Element = AAZObjectType() - cls._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = _schema_organization_resource_read.properties.project_properties.branch.roles - roles.Element = AAZObjectType() - cls._build_schema_models_neon_role_properties_read(roles.Element) - - databases = _schema_organization_resource_read.properties.project_properties.databases - databases.Element = AAZObjectType() - cls._build_schema_models_neon_database_properties_read(databases.Element) - - default_endpoint_settings = _schema_organization_resource_read.properties.project_properties.default_endpoint_settings - default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( - serialized_name="autoscalingLimitMaxCu", - flags={"required": True}, - ) - default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( - serialized_name="autoscalingLimitMinCu", - flags={"required": True}, - ) - - endpoints = _schema_organization_resource_read.properties.project_properties.endpoints - endpoints.Element = AAZObjectType() - cls._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = _schema_organization_resource_read.properties.project_properties.roles - roles.Element = AAZObjectType() - cls._build_schema_models_neon_role_properties_read(roles.Element) - user_details = _schema_organization_resource_read.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py index f1393c94ec9..f32cc2d49dd 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py @@ -20,7 +20,7 @@ class Wait(AAZWaitCommand): _aaz_info = { "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], ] } @@ -52,7 +52,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the resource group", required=True, ) return cls._args_schema @@ -122,7 +122,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2025-03-01", + "api-version", "2024-08-01-preview", required=True, ), } @@ -186,9 +186,6 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) - properties.project_properties = AAZObjectType( - serialized_name="projectProperties", - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -278,116 +275,6 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() - project_properties = cls._schema_on_200.properties.project_properties - project_properties.attributes = AAZListType() - project_properties.branch = AAZObjectType() - project_properties.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - project_properties.databases = AAZListType() - project_properties.default_endpoint_settings = AAZObjectType( - serialized_name="defaultEndpointSettings", - ) - project_properties.endpoints = AAZListType() - project_properties.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - project_properties.entity_name = AAZStrType( - serialized_name="entityName", - ) - project_properties.history_retention = AAZIntType( - serialized_name="historyRetention", - ) - project_properties.pg_version = AAZIntType( - serialized_name="pgVersion", - ) - project_properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - project_properties.region_id = AAZStrType( - serialized_name="regionId", - ) - project_properties.roles = AAZListType() - project_properties.storage = AAZIntType() - - attributes = cls._schema_on_200.properties.project_properties.attributes - attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) - - branch = cls._schema_on_200.properties.project_properties.branch - branch.attributes = AAZListType() - branch.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - branch.database_name = AAZStrType( - serialized_name="databaseName", - ) - branch.databases = AAZListType() - branch.endpoints = AAZListType() - branch.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - branch.entity_name = AAZStrType( - serialized_name="entityName", - ) - branch.parent_id = AAZStrType( - serialized_name="parentId", - ) - branch.project_id = AAZStrType( - serialized_name="projectId", - ) - branch.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - branch.role_name = AAZStrType( - serialized_name="roleName", - ) - branch.roles = AAZListType() - - attributes = cls._schema_on_200.properties.project_properties.branch.attributes - attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) - - databases = cls._schema_on_200.properties.project_properties.branch.databases - databases.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_database_properties_read(databases.Element) - - endpoints = cls._schema_on_200.properties.project_properties.branch.endpoints - endpoints.Element = AAZObjectType() - _WaitHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.properties.project_properties.branch.roles - roles.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_role_properties_read(roles.Element) - - databases = cls._schema_on_200.properties.project_properties.databases - databases.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_database_properties_read(databases.Element) - - default_endpoint_settings = cls._schema_on_200.properties.project_properties.default_endpoint_settings - default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( - serialized_name="autoscalingLimitMaxCu", - flags={"required": True}, - ) - default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( - serialized_name="autoscalingLimitMinCu", - flags={"required": True}, - ) - - endpoints = cls._schema_on_200.properties.project_properties.endpoints - endpoints.Element = AAZObjectType() - _WaitHelper._build_schema_models_endpoint_properties_read(endpoints.Element) - - roles = cls._schema_on_200.properties.project_properties.roles - roles.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_role_properties_read(roles.Element) - user_details = cls._schema_on_200.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -432,194 +319,5 @@ def _build_schema_on_200(cls): class _WaitHelper: """Helper class for Wait""" - _schema_models_attributes_read = None - - @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - return - - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() - - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( - flags={"required": True}, - ) - models_attributes_read.value = AAZStrType( - flags={"required": True}, - ) - - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value - - _schema_models_endpoint_properties_read = None - - @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - return - - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() - - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_endpoint_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_endpoint_properties_read.endpoint_type = AAZStrType( - serialized_name="endpointType", - ) - models_endpoint_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_endpoint_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_endpoint_properties_read.project_id = AAZStrType( - serialized_name="projectId", - ) - models_endpoint_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_endpoint_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state - - _schema_models_neon_database_properties_read = None - - @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - return - - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() - - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_database_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_database_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_database_properties_read.owner_name = AAZStrType( - serialized_name="ownerName", - ) - models_neon_database_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_database_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state - - _schema_models_neon_role_properties_read = None - - @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - return - - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() - - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( - serialized_name="branchId", - ) - models_neon_role_properties_read.created_at = AAZStrType( - serialized_name="createdAt", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_id = AAZStrType( - serialized_name="entityId", - flags={"read_only": True}, - ) - models_neon_role_properties_read.entity_name = AAZStrType( - serialized_name="entityName", - ) - models_neon_role_properties_read.is_super_user = AAZBoolType( - serialized_name="isSuperUser", - ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - attributes = _schema_models_neon_role_properties_read.attributes - attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) - - permissions = _schema_models_neon_role_properties_read.permissions - permissions.Element = AAZStrType() - - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state - __all__ = ["Wait"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py index 0e9cfd4d883..a6adfc52663 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py @@ -13,10 +13,9 @@ @register_command( "neon postgres project create", - is_preview=True, ) class Create(AAZCommand): - """Creates a Neon Project resource + """Create a new Neon project under an organization. :example: Create Neon Project az neon postgres project create --resource-group rgneon --organization-name neon-org --project-name neon-project --region eastus2 --pg-version 17 --branch "{branch-name:main, role-name:owner_role,database-name:neondb}" @@ -48,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="The name of the Neon Organization resource.", + help="Name of the Neon organization.", required=True, fmt=AAZStrArgFormat( pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", @@ -61,7 +60,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.project_name = AAZStrArg( options=["-n", "--name", "--project-name"], - help="The name of the Neon Project resource.", + help="Name of the Neon project.", required=True, default="Default-Project", fmt=AAZStrArgFormat( @@ -69,7 +68,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) @@ -125,176 +124,176 @@ def _build_arguments_schema(cls, *args, **kwargs): ) return cls._args_schema - _args_models_attributes_create = None + _args_attributes_create = None @classmethod - def _build_args_models_attributes_create(cls, _schema): - if cls._args_models_attributes_create is not None: - _schema.name = cls._args_models_attributes_create.name - _schema.value = cls._args_models_attributes_create.value + def _build_args_attributes_create(cls, _schema): + if cls._args_attributes_create is not None: + _schema.name = cls._args_attributes_create.name + _schema.value = cls._args_attributes_create.value return - cls._args_models_attributes_create = AAZObjectArg() + cls._args_attributes_create = AAZObjectArg() - models_attributes_create = cls._args_models_attributes_create - models_attributes_create.name = AAZStrArg( + attributes_create = cls._args_attributes_create + attributes_create.name = AAZStrArg( options=["name"], help="Name of the attribute", required=True, ) - models_attributes_create.value = AAZStrArg( + attributes_create.value = AAZStrArg( options=["value"], help="Value of the attribute", required=True, ) - _schema.name = cls._args_models_attributes_create.name - _schema.value = cls._args_models_attributes_create.value + _schema.name = cls._args_attributes_create.name + _schema.value = cls._args_attributes_create.value - _args_models_endpoint_properties_create = None + _args_endpoint_properties_create = None @classmethod - def _build_args_models_endpoint_properties_create(cls, _schema): - if cls._args_models_endpoint_properties_create is not None: - _schema.attributes = cls._args_models_endpoint_properties_create.attributes - _schema.branch_id = cls._args_models_endpoint_properties_create.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_create.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_create.entity_name - _schema.project_id = cls._args_models_endpoint_properties_create.project_id + def _build_args_endpoint_properties_create(cls, _schema): + if cls._args_endpoint_properties_create is not None: + _schema.attributes = cls._args_endpoint_properties_create.attributes + _schema.branch_id = cls._args_endpoint_properties_create.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_create.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_create.entity_name + _schema.project_id = cls._args_endpoint_properties_create.project_id return - cls._args_models_endpoint_properties_create = AAZObjectArg() + cls._args_endpoint_properties_create = AAZObjectArg() - models_endpoint_properties_create = cls._args_models_endpoint_properties_create - models_endpoint_properties_create.attributes = AAZListArg( + endpoint_properties_create = cls._args_endpoint_properties_create + endpoint_properties_create.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", ) - models_endpoint_properties_create.branch_id = AAZStrArg( + endpoint_properties_create.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this endpoint belongs to", ) - models_endpoint_properties_create.endpoint_type = AAZStrArg( + endpoint_properties_create.endpoint_type = AAZStrArg( options=["endpoint-type"], help="The type of the endpoint", enum={"read_only": "read_only", "read_write": "read_write"}, ) - models_endpoint_properties_create.entity_name = AAZStrArg( + endpoint_properties_create.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_endpoint_properties_create.project_id = AAZStrArg( + endpoint_properties_create.project_id = AAZStrArg( options=["project-id"], help="The ID of the project this endpoint belongs to", ) - attributes = cls._args_models_endpoint_properties_create.attributes + attributes = cls._args_endpoint_properties_create.attributes attributes.Element = AAZObjectArg() - cls._build_args_models_attributes_create(attributes.Element) + cls._build_args_attributes_create(attributes.Element) - _schema.attributes = cls._args_models_endpoint_properties_create.attributes - _schema.branch_id = cls._args_models_endpoint_properties_create.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_create.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_create.entity_name - _schema.project_id = cls._args_models_endpoint_properties_create.project_id + _schema.attributes = cls._args_endpoint_properties_create.attributes + _schema.branch_id = cls._args_endpoint_properties_create.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_create.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_create.entity_name + _schema.project_id = cls._args_endpoint_properties_create.project_id - _args_models_neon_database_properties_create = None + _args_neon_database_properties_create = None @classmethod - def _build_args_models_neon_database_properties_create(cls, _schema): - if cls._args_models_neon_database_properties_create is not None: - _schema.attributes = cls._args_models_neon_database_properties_create.attributes - _schema.branch_id = cls._args_models_neon_database_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_create.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_create.owner_name + def _build_args_neon_database_properties_create(cls, _schema): + if cls._args_neon_database_properties_create is not None: + _schema.attributes = cls._args_neon_database_properties_create.attributes + _schema.branch_id = cls._args_neon_database_properties_create.branch_id + _schema.entity_name = cls._args_neon_database_properties_create.entity_name + _schema.owner_name = cls._args_neon_database_properties_create.owner_name return - cls._args_models_neon_database_properties_create = AAZObjectArg() + cls._args_neon_database_properties_create = AAZObjectArg() - models_neon_database_properties_create = cls._args_models_neon_database_properties_create - models_neon_database_properties_create.attributes = AAZListArg( + neon_database_properties_create = cls._args_neon_database_properties_create + neon_database_properties_create.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", ) - models_neon_database_properties_create.branch_id = AAZStrArg( + neon_database_properties_create.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this database belongs to", ) - models_neon_database_properties_create.entity_name = AAZStrArg( + neon_database_properties_create.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_neon_database_properties_create.owner_name = AAZStrArg( + neon_database_properties_create.owner_name = AAZStrArg( options=["owner-name"], help="The name of the role that owns the database", ) - attributes = cls._args_models_neon_database_properties_create.attributes + attributes = cls._args_neon_database_properties_create.attributes attributes.Element = AAZObjectArg() - cls._build_args_models_attributes_create(attributes.Element) + cls._build_args_attributes_create(attributes.Element) - _schema.attributes = cls._args_models_neon_database_properties_create.attributes - _schema.branch_id = cls._args_models_neon_database_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_create.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_create.owner_name + _schema.attributes = cls._args_neon_database_properties_create.attributes + _schema.branch_id = cls._args_neon_database_properties_create.branch_id + _schema.entity_name = cls._args_neon_database_properties_create.entity_name + _schema.owner_name = cls._args_neon_database_properties_create.owner_name - _args_models_neon_role_properties_create = None + _args_neon_role_properties_create = None @classmethod - def _build_args_models_neon_role_properties_create(cls, _schema): - if cls._args_models_neon_role_properties_create is not None: - _schema.attributes = cls._args_models_neon_role_properties_create.attributes - _schema.branch_id = cls._args_models_neon_role_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_create.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_create.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_create.permissions + def _build_args_neon_role_properties_create(cls, _schema): + if cls._args_neon_role_properties_create is not None: + _schema.attributes = cls._args_neon_role_properties_create.attributes + _schema.branch_id = cls._args_neon_role_properties_create.branch_id + _schema.entity_name = cls._args_neon_role_properties_create.entity_name + _schema.is_super_user = cls._args_neon_role_properties_create.is_super_user + _schema.permissions = cls._args_neon_role_properties_create.permissions return - cls._args_models_neon_role_properties_create = AAZObjectArg() + cls._args_neon_role_properties_create = AAZObjectArg() - models_neon_role_properties_create = cls._args_models_neon_role_properties_create - models_neon_role_properties_create.attributes = AAZListArg( + neon_role_properties_create = cls._args_neon_role_properties_create + neon_role_properties_create.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", ) - models_neon_role_properties_create.branch_id = AAZStrArg( + neon_role_properties_create.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this role belongs to", ) - models_neon_role_properties_create.entity_name = AAZStrArg( + neon_role_properties_create.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", fmt=AAZStrArgFormat( pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_neon_role_properties_create.is_super_user = AAZBoolArg( + neon_role_properties_create.is_super_user = AAZBoolArg( options=["is-super-user"], help="Indicates whether the role has superuser privileges", ) - models_neon_role_properties_create.permissions = AAZListArg( + neon_role_properties_create.permissions = AAZListArg( options=["permissions"], help="Permissions assigned to the role", ) - attributes = cls._args_models_neon_role_properties_create.attributes + attributes = cls._args_neon_role_properties_create.attributes attributes.Element = AAZObjectArg() - cls._build_args_models_attributes_create(attributes.Element) + cls._build_args_attributes_create(attributes.Element) - permissions = cls._args_models_neon_role_properties_create.permissions + permissions = cls._args_neon_role_properties_create.permissions permissions.Element = AAZStrArg() - _schema.attributes = cls._args_models_neon_role_properties_create.attributes - _schema.branch_id = cls._args_models_neon_role_properties_create.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_create.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_create.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_create.permissions + _schema.attributes = cls._args_neon_role_properties_create.attributes + _schema.branch_id = cls._args_neon_role_properties_create.branch_id + _schema.entity_name = cls._args_neon_role_properties_create.entity_name + _schema.is_super_user = cls._args_neon_role_properties_create.is_super_user + _schema.permissions = cls._args_neon_role_properties_create.permissions def _execute_operations(self): self.pre_operations() @@ -494,7 +493,7 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) branch = cls._schema_on_200_201.properties.branch branch.attributes = AAZListType() @@ -531,23 +530,23 @@ def _build_schema_on_200_201(cls): attributes = cls._schema_on_200_201.properties.branch.attributes attributes.Element = AAZObjectType() - _CreateHelper._build_schema_models_attributes_read(attributes.Element) + _CreateHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200_201.properties.branch.databases databases.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_database_properties_read(databases.Element) + _CreateHelper._build_schema_neon_database_properties_read(databases.Element) endpoints = cls._schema_on_200_201.properties.branch.endpoints endpoints.Element = AAZObjectType() - _CreateHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _CreateHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200_201.properties.branch.roles roles.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_role_properties_read(roles.Element) + _CreateHelper._build_schema_neon_role_properties_read(roles.Element) databases = cls._schema_on_200_201.properties.databases databases.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_database_properties_read(databases.Element) + _CreateHelper._build_schema_neon_database_properties_read(databases.Element) default_endpoint_settings = cls._schema_on_200_201.properties.default_endpoint_settings default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( @@ -561,11 +560,11 @@ def _build_schema_on_200_201(cls): endpoints = cls._schema_on_200_201.properties.endpoints endpoints.Element = AAZObjectType() - _CreateHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _CreateHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200_201.properties.roles roles.Element = AAZObjectType() - _CreateHelper._build_schema_models_neon_role_properties_read(roles.Element) + _CreateHelper._build_schema_neon_role_properties_read(roles.Element) system_data = cls._schema_on_200_201.system_data system_data.created_at = AAZStrType( @@ -594,14 +593,14 @@ class _CreateHelper: """Helper class for Create""" @classmethod - def _build_schema_models_attributes_create(cls, _builder): + def _build_schema_attributes_create(cls, _builder): if _builder is None: return _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) @classmethod - def _build_schema_models_endpoint_properties_create(cls, _builder): + def _build_schema_endpoint_properties_create(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -612,10 +611,10 @@ def _build_schema_models_endpoint_properties_create(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_create(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_create(attributes.set_elements(AAZObjectType, ".")) @classmethod - def _build_schema_models_neon_database_properties_create(cls, _builder): + def _build_schema_neon_database_properties_create(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -625,10 +624,10 @@ def _build_schema_models_neon_database_properties_create(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_create(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_create(attributes.set_elements(AAZObjectType, ".")) @classmethod - def _build_schema_models_neon_role_properties_create(cls, _builder): + def _build_schema_neon_role_properties_create(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -639,200 +638,200 @@ def _build_schema_models_neon_role_properties_create(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_create(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_create(attributes.set_elements(AAZObjectType, ".")) permissions = _builder.get(".permissions") if permissions is not None: permissions.set_elements(AAZStrType, ".") - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value - _schema_models_endpoint_properties_read = None + _schema_endpoint_properties_read = None @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state return - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_endpoint_properties_read.created_at = AAZStrType( + endpoint_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_endpoint_properties_read.endpoint_type = AAZStrType( + endpoint_properties_read.endpoint_type = AAZStrType( serialized_name="endpointType", ) - models_endpoint_properties_read.entity_id = AAZStrType( + endpoint_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_endpoint_properties_read.entity_name = AAZStrType( + endpoint_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_endpoint_properties_read.project_id = AAZStrType( + endpoint_properties_read.project_id = AAZStrType( serialized_name="projectId", ) - models_endpoint_properties_read.provisioning_state = AAZStrType( + endpoint_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_endpoint_properties_read.attributes + attributes = _schema_endpoint_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state - _schema_models_neon_database_properties_read = None + _schema_neon_database_properties_read = None @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state return - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_database_properties_read.created_at = AAZStrType( + neon_database_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_id = AAZStrType( + neon_database_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_name = AAZStrType( + neon_database_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_database_properties_read.owner_name = AAZStrType( + neon_database_properties_read.owner_name = AAZStrType( serialized_name="ownerName", ) - models_neon_database_properties_read.provisioning_state = AAZStrType( + neon_database_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_database_properties_read.attributes + attributes = _schema_neon_database_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state - _schema_models_neon_role_properties_read = None + _schema_neon_role_properties_read = None @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state return - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_role_properties_read.created_at = AAZStrType( + neon_role_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_id = AAZStrType( + neon_role_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_name = AAZStrType( + neon_role_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_role_properties_read.is_super_user = AAZBoolType( + neon_role_properties_read.is_super_user = AAZBoolType( serialized_name="isSuperUser", ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_role_properties_read.attributes + attributes = _schema_neon_role_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - permissions = _schema_models_neon_role_properties_read.permissions + permissions = _schema_neon_role_properties_read.permissions permissions.Element = AAZStrType() - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state __all__ = ["Create"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py index 8911800f921..380a85bdd6b 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py @@ -13,7 +13,6 @@ @register_command( "neon postgres project delete", - is_experimental=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): @@ -48,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="The Name of Neon Organization resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -56,10 +55,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -67,7 +69,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py index fb1f4be3c44..09ad33c2054 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py @@ -46,7 +46,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -54,10 +54,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_name = AAZStrArg( options=["--project-name"], - help="The name of the Project", + help="Name of the Neon project.", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -65,7 +68,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py index ec7294516fc..d188b826031 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py @@ -13,7 +13,6 @@ @register_command( "neon postgres project list", - is_preview=True, ) class List(AAZCommand): """List Neon Projects associated with Neon Organization resource @@ -50,16 +49,19 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="The name of the Neon Organization resource", + help="Name of the Neon organization.", required=True, fmt=AAZStrArgFormat( pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -226,7 +228,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.value.Element.properties.attributes attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) + _ListHelper._build_schema_attributes_read(attributes.Element) branch = cls._schema_on_200.value.Element.properties.branch branch.attributes = AAZListType() @@ -263,23 +265,23 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.value.Element.properties.branch.attributes attributes.Element = AAZObjectType() - _ListHelper._build_schema_models_attributes_read(attributes.Element) + _ListHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200.value.Element.properties.branch.databases databases.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_database_properties_read(databases.Element) + _ListHelper._build_schema_neon_database_properties_read(databases.Element) endpoints = cls._schema_on_200.value.Element.properties.branch.endpoints endpoints.Element = AAZObjectType() - _ListHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _ListHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200.value.Element.properties.branch.roles roles.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_role_properties_read(roles.Element) + _ListHelper._build_schema_neon_role_properties_read(roles.Element) databases = cls._schema_on_200.value.Element.properties.databases databases.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_database_properties_read(databases.Element) + _ListHelper._build_schema_neon_database_properties_read(databases.Element) default_endpoint_settings = cls._schema_on_200.value.Element.properties.default_endpoint_settings default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( @@ -293,11 +295,11 @@ def _build_schema_on_200(cls): endpoints = cls._schema_on_200.value.Element.properties.endpoints endpoints.Element = AAZObjectType() - _ListHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _ListHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200.value.Element.properties.roles roles.Element = AAZObjectType() - _ListHelper._build_schema_models_neon_role_properties_read(roles.Element) + _ListHelper._build_schema_neon_role_properties_read(roles.Element) system_data = cls._schema_on_200.value.Element.system_data system_data.created_at = AAZStrType( @@ -325,194 +327,194 @@ def _build_schema_on_200(cls): class _ListHelper: """Helper class for List""" - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value - _schema_models_endpoint_properties_read = None + _schema_endpoint_properties_read = None @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state return - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_endpoint_properties_read.created_at = AAZStrType( + endpoint_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_endpoint_properties_read.endpoint_type = AAZStrType( + endpoint_properties_read.endpoint_type = AAZStrType( serialized_name="endpointType", ) - models_endpoint_properties_read.entity_id = AAZStrType( + endpoint_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_endpoint_properties_read.entity_name = AAZStrType( + endpoint_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_endpoint_properties_read.project_id = AAZStrType( + endpoint_properties_read.project_id = AAZStrType( serialized_name="projectId", ) - models_endpoint_properties_read.provisioning_state = AAZStrType( + endpoint_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_endpoint_properties_read.attributes + attributes = _schema_endpoint_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state - _schema_models_neon_database_properties_read = None + _schema_neon_database_properties_read = None @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state return - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_database_properties_read.created_at = AAZStrType( + neon_database_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_id = AAZStrType( + neon_database_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_name = AAZStrType( + neon_database_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_database_properties_read.owner_name = AAZStrType( + neon_database_properties_read.owner_name = AAZStrType( serialized_name="ownerName", ) - models_neon_database_properties_read.provisioning_state = AAZStrType( + neon_database_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_database_properties_read.attributes + attributes = _schema_neon_database_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state - _schema_models_neon_role_properties_read = None + _schema_neon_role_properties_read = None @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state return - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_role_properties_read.created_at = AAZStrType( + neon_role_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_id = AAZStrType( + neon_role_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_name = AAZStrType( + neon_role_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_role_properties_read.is_super_user = AAZBoolType( + neon_role_properties_read.is_super_user = AAZBoolType( serialized_name="isSuperUser", ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_role_properties_read.attributes + attributes = _schema_neon_role_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - permissions = _schema_models_neon_role_properties_read.permissions + permissions = _schema_neon_role_properties_read.permissions permissions.Element = AAZStrType() - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state __all__ = ["List"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py index aca3f41b647..807c6bd8e53 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py @@ -13,10 +13,9 @@ @register_command( "neon postgres project show", - is_preview=True, ) class Show(AAZCommand): - """Get details of a Neon Project resource + """Retrieve details of a specific Neon project. :example: Show Neon Project Deatils az neon postgres project show --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 @@ -47,7 +46,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="The name of the Neon Organization resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -55,10 +54,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -66,7 +68,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -225,7 +227,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.attributes attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) + _ShowHelper._build_schema_attributes_read(attributes.Element) branch = cls._schema_on_200.properties.branch branch.attributes = AAZListType() @@ -262,23 +264,23 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.branch.attributes attributes.Element = AAZObjectType() - _ShowHelper._build_schema_models_attributes_read(attributes.Element) + _ShowHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200.properties.branch.databases databases.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_database_properties_read(databases.Element) + _ShowHelper._build_schema_neon_database_properties_read(databases.Element) endpoints = cls._schema_on_200.properties.branch.endpoints endpoints.Element = AAZObjectType() - _ShowHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _ShowHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200.properties.branch.roles roles.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_role_properties_read(roles.Element) + _ShowHelper._build_schema_neon_role_properties_read(roles.Element) databases = cls._schema_on_200.properties.databases databases.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_database_properties_read(databases.Element) + _ShowHelper._build_schema_neon_database_properties_read(databases.Element) default_endpoint_settings = cls._schema_on_200.properties.default_endpoint_settings default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( @@ -292,11 +294,11 @@ def _build_schema_on_200(cls): endpoints = cls._schema_on_200.properties.endpoints endpoints.Element = AAZObjectType() - _ShowHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _ShowHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200.properties.roles roles.Element = AAZObjectType() - _ShowHelper._build_schema_models_neon_role_properties_read(roles.Element) + _ShowHelper._build_schema_neon_role_properties_read(roles.Element) system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( @@ -324,194 +326,194 @@ def _build_schema_on_200(cls): class _ShowHelper: """Helper class for Show""" - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value - _schema_models_endpoint_properties_read = None + _schema_endpoint_properties_read = None @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state return - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_endpoint_properties_read.created_at = AAZStrType( + endpoint_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_endpoint_properties_read.endpoint_type = AAZStrType( + endpoint_properties_read.endpoint_type = AAZStrType( serialized_name="endpointType", ) - models_endpoint_properties_read.entity_id = AAZStrType( + endpoint_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_endpoint_properties_read.entity_name = AAZStrType( + endpoint_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_endpoint_properties_read.project_id = AAZStrType( + endpoint_properties_read.project_id = AAZStrType( serialized_name="projectId", ) - models_endpoint_properties_read.provisioning_state = AAZStrType( + endpoint_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_endpoint_properties_read.attributes + attributes = _schema_endpoint_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state - _schema_models_neon_database_properties_read = None + _schema_neon_database_properties_read = None @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state return - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_database_properties_read.created_at = AAZStrType( + neon_database_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_id = AAZStrType( + neon_database_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_name = AAZStrType( + neon_database_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_database_properties_read.owner_name = AAZStrType( + neon_database_properties_read.owner_name = AAZStrType( serialized_name="ownerName", ) - models_neon_database_properties_read.provisioning_state = AAZStrType( + neon_database_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_database_properties_read.attributes + attributes = _schema_neon_database_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state - _schema_models_neon_role_properties_read = None + _schema_neon_role_properties_read = None @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state return - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_role_properties_read.created_at = AAZStrType( + neon_role_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_id = AAZStrType( + neon_role_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_name = AAZStrType( + neon_role_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_role_properties_read.is_super_user = AAZBoolType( + neon_role_properties_read.is_super_user = AAZBoolType( serialized_name="isSuperUser", ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_role_properties_read.attributes + attributes = _schema_neon_role_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - permissions = _schema_models_neon_role_properties_read.permissions + permissions = _schema_neon_role_properties_read.permissions permissions.Element = AAZStrType() - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state __all__ = ["Show"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py index 24ffe0a26eb..b1e652d0c82 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py @@ -13,7 +13,6 @@ @register_command( "neon postgres project update", - is_preview=True, ) class Update(AAZCommand): """Updates a Neon Project resource @@ -50,7 +49,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="Name of the Neon Organizations resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -58,10 +57,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_name = AAZStrArg( options=["-n", "--name", "--project-name"], - help="The name of the Project", + help="Name of the Neon project.", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -69,7 +71,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) @@ -137,69 +139,69 @@ def _build_arguments_schema(cls, *args, **kwargs): attributes.Element = AAZObjectArg( nullable=True, ) - cls._build_args_models_attributes_update(attributes.Element) + cls._build_args_attributes_update(attributes.Element) return cls._args_schema - _args_models_attributes_update = None + _args_attributes_update = None @classmethod - def _build_args_models_attributes_update(cls, _schema): - if cls._args_models_attributes_update is not None: - _schema.name = cls._args_models_attributes_update.name - _schema.value = cls._args_models_attributes_update.value + def _build_args_attributes_update(cls, _schema): + if cls._args_attributes_update is not None: + _schema.name = cls._args_attributes_update.name + _schema.value = cls._args_attributes_update.value return - cls._args_models_attributes_update = AAZObjectArg( + cls._args_attributes_update = AAZObjectArg( nullable=True, ) - models_attributes_update = cls._args_models_attributes_update - models_attributes_update.name = AAZStrArg( + attributes_update = cls._args_attributes_update + attributes_update.name = AAZStrArg( options=["name"], help="Name of the attribute", ) - models_attributes_update.value = AAZStrArg( + attributes_update.value = AAZStrArg( options=["value"], help="Value of the attribute", ) - _schema.name = cls._args_models_attributes_update.name - _schema.value = cls._args_models_attributes_update.value + _schema.name = cls._args_attributes_update.name + _schema.value = cls._args_attributes_update.value - _args_models_endpoint_properties_update = None + _args_endpoint_properties_update = None @classmethod - def _build_args_models_endpoint_properties_update(cls, _schema): - if cls._args_models_endpoint_properties_update is not None: - _schema.attributes = cls._args_models_endpoint_properties_update.attributes - _schema.branch_id = cls._args_models_endpoint_properties_update.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_update.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_update.entity_name - _schema.project_id = cls._args_models_endpoint_properties_update.project_id + def _build_args_endpoint_properties_update(cls, _schema): + if cls._args_endpoint_properties_update is not None: + _schema.attributes = cls._args_endpoint_properties_update.attributes + _schema.branch_id = cls._args_endpoint_properties_update.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_update.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_update.entity_name + _schema.project_id = cls._args_endpoint_properties_update.project_id return - cls._args_models_endpoint_properties_update = AAZObjectArg( + cls._args_endpoint_properties_update = AAZObjectArg( nullable=True, ) - models_endpoint_properties_update = cls._args_models_endpoint_properties_update - models_endpoint_properties_update.attributes = AAZListArg( + endpoint_properties_update = cls._args_endpoint_properties_update + endpoint_properties_update.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", nullable=True, ) - models_endpoint_properties_update.branch_id = AAZStrArg( + endpoint_properties_update.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this endpoint belongs to", nullable=True, ) - models_endpoint_properties_update.endpoint_type = AAZStrArg( + endpoint_properties_update.endpoint_type = AAZStrArg( options=["endpoint-type"], help="The type of the endpoint", nullable=True, enum={"read_only": "read_only", "read_write": "read_write"}, ) - models_endpoint_properties_update.entity_name = AAZStrArg( + endpoint_properties_update.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", nullable=True, @@ -207,51 +209,51 @@ def _build_args_models_endpoint_properties_update(cls, _schema): pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_endpoint_properties_update.project_id = AAZStrArg( + endpoint_properties_update.project_id = AAZStrArg( options=["project-id"], help="The ID of the project this endpoint belongs to", nullable=True, ) - attributes = cls._args_models_endpoint_properties_update.attributes + attributes = cls._args_endpoint_properties_update.attributes attributes.Element = AAZObjectArg( nullable=True, ) - cls._build_args_models_attributes_update(attributes.Element) + cls._build_args_attributes_update(attributes.Element) - _schema.attributes = cls._args_models_endpoint_properties_update.attributes - _schema.branch_id = cls._args_models_endpoint_properties_update.branch_id - _schema.endpoint_type = cls._args_models_endpoint_properties_update.endpoint_type - _schema.entity_name = cls._args_models_endpoint_properties_update.entity_name - _schema.project_id = cls._args_models_endpoint_properties_update.project_id + _schema.attributes = cls._args_endpoint_properties_update.attributes + _schema.branch_id = cls._args_endpoint_properties_update.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_update.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_update.entity_name + _schema.project_id = cls._args_endpoint_properties_update.project_id - _args_models_neon_database_properties_update = None + _args_neon_database_properties_update = None @classmethod - def _build_args_models_neon_database_properties_update(cls, _schema): - if cls._args_models_neon_database_properties_update is not None: - _schema.attributes = cls._args_models_neon_database_properties_update.attributes - _schema.branch_id = cls._args_models_neon_database_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_update.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_update.owner_name + def _build_args_neon_database_properties_update(cls, _schema): + if cls._args_neon_database_properties_update is not None: + _schema.attributes = cls._args_neon_database_properties_update.attributes + _schema.branch_id = cls._args_neon_database_properties_update.branch_id + _schema.entity_name = cls._args_neon_database_properties_update.entity_name + _schema.owner_name = cls._args_neon_database_properties_update.owner_name return - cls._args_models_neon_database_properties_update = AAZObjectArg( + cls._args_neon_database_properties_update = AAZObjectArg( nullable=True, ) - models_neon_database_properties_update = cls._args_models_neon_database_properties_update - models_neon_database_properties_update.attributes = AAZListArg( + neon_database_properties_update = cls._args_neon_database_properties_update + neon_database_properties_update.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", nullable=True, ) - models_neon_database_properties_update.branch_id = AAZStrArg( + neon_database_properties_update.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this database belongs to", nullable=True, ) - models_neon_database_properties_update.entity_name = AAZStrArg( + neon_database_properties_update.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", nullable=True, @@ -259,51 +261,51 @@ def _build_args_models_neon_database_properties_update(cls, _schema): pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_neon_database_properties_update.owner_name = AAZStrArg( + neon_database_properties_update.owner_name = AAZStrArg( options=["owner-name"], help="The name of the role that owns the database", nullable=True, ) - attributes = cls._args_models_neon_database_properties_update.attributes + attributes = cls._args_neon_database_properties_update.attributes attributes.Element = AAZObjectArg( nullable=True, ) - cls._build_args_models_attributes_update(attributes.Element) + cls._build_args_attributes_update(attributes.Element) - _schema.attributes = cls._args_models_neon_database_properties_update.attributes - _schema.branch_id = cls._args_models_neon_database_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_database_properties_update.entity_name - _schema.owner_name = cls._args_models_neon_database_properties_update.owner_name + _schema.attributes = cls._args_neon_database_properties_update.attributes + _schema.branch_id = cls._args_neon_database_properties_update.branch_id + _schema.entity_name = cls._args_neon_database_properties_update.entity_name + _schema.owner_name = cls._args_neon_database_properties_update.owner_name - _args_models_neon_role_properties_update = None + _args_neon_role_properties_update = None @classmethod - def _build_args_models_neon_role_properties_update(cls, _schema): - if cls._args_models_neon_role_properties_update is not None: - _schema.attributes = cls._args_models_neon_role_properties_update.attributes - _schema.branch_id = cls._args_models_neon_role_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_update.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_update.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_update.permissions + def _build_args_neon_role_properties_update(cls, _schema): + if cls._args_neon_role_properties_update is not None: + _schema.attributes = cls._args_neon_role_properties_update.attributes + _schema.branch_id = cls._args_neon_role_properties_update.branch_id + _schema.entity_name = cls._args_neon_role_properties_update.entity_name + _schema.is_super_user = cls._args_neon_role_properties_update.is_super_user + _schema.permissions = cls._args_neon_role_properties_update.permissions return - cls._args_models_neon_role_properties_update = AAZObjectArg( + cls._args_neon_role_properties_update = AAZObjectArg( nullable=True, ) - models_neon_role_properties_update = cls._args_models_neon_role_properties_update - models_neon_role_properties_update.attributes = AAZListArg( + neon_role_properties_update = cls._args_neon_role_properties_update + neon_role_properties_update.attributes = AAZListArg( options=["attributes"], help="Additional attributes for the entity", nullable=True, ) - models_neon_role_properties_update.branch_id = AAZStrArg( + neon_role_properties_update.branch_id = AAZStrArg( options=["branch-id"], help="The ID of the branch this role belongs to", nullable=True, ) - models_neon_role_properties_update.entity_name = AAZStrArg( + neon_role_properties_update.entity_name = AAZStrArg( options=["entity-name"], help="Name of the resource", nullable=True, @@ -311,33 +313,33 @@ def _build_args_models_neon_role_properties_update(cls, _schema): pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - models_neon_role_properties_update.is_super_user = AAZBoolArg( + neon_role_properties_update.is_super_user = AAZBoolArg( options=["is-super-user"], help="Indicates whether the role has superuser privileges", nullable=True, ) - models_neon_role_properties_update.permissions = AAZListArg( + neon_role_properties_update.permissions = AAZListArg( options=["permissions"], help="Permissions assigned to the role", nullable=True, ) - attributes = cls._args_models_neon_role_properties_update.attributes + attributes = cls._args_neon_role_properties_update.attributes attributes.Element = AAZObjectArg( nullable=True, ) - cls._build_args_models_attributes_update(attributes.Element) + cls._build_args_attributes_update(attributes.Element) - permissions = cls._args_models_neon_role_properties_update.permissions + permissions = cls._args_neon_role_properties_update.permissions permissions.Element = AAZStrArg( nullable=True, ) - _schema.attributes = cls._args_models_neon_role_properties_update.attributes - _schema.branch_id = cls._args_models_neon_role_properties_update.branch_id - _schema.entity_name = cls._args_models_neon_role_properties_update.entity_name - _schema.is_super_user = cls._args_models_neon_role_properties_update.is_super_user - _schema.permissions = cls._args_models_neon_role_properties_update.permissions + _schema.attributes = cls._args_neon_role_properties_update.attributes + _schema.branch_id = cls._args_neon_role_properties_update.branch_id + _schema.entity_name = cls._args_neon_role_properties_update.entity_name + _schema.is_super_user = cls._args_neon_role_properties_update.is_super_user + _schema.permissions = cls._args_neon_role_properties_update.permissions def _execute_operations(self): self.pre_operations() @@ -452,7 +454,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_models_project_read(cls._schema_on_200) + _UpdateHelper._build_schema_project_read(cls._schema_on_200) return cls._schema_on_200 @@ -567,7 +569,7 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_models_project_read(cls._schema_on_200_201) + _UpdateHelper._build_schema_project_read(cls._schema_on_200_201) return cls._schema_on_200_201 @@ -601,7 +603,7 @@ def _update_instance(self, instance): attributes = _builder.get(".properties.branch.attributes") if attributes is not None: - _UpdateHelper._build_schema_models_attributes_update(attributes.set_elements(AAZObjectType, ".")) + _UpdateHelper._build_schema_attributes_update(attributes.set_elements(AAZObjectType, ".")) return _instance_value @@ -618,14 +620,14 @@ class _UpdateHelper: """Helper class for Update""" @classmethod - def _build_schema_models_attributes_update(cls, _builder): + def _build_schema_attributes_update(cls, _builder): if _builder is None: return _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) @classmethod - def _build_schema_models_endpoint_properties_update(cls, _builder): + def _build_schema_endpoint_properties_update(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -636,10 +638,10 @@ def _build_schema_models_endpoint_properties_update(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_update(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_update(attributes.set_elements(AAZObjectType, ".")) @classmethod - def _build_schema_models_neon_database_properties_update(cls, _builder): + def _build_schema_neon_database_properties_update(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -649,10 +651,10 @@ def _build_schema_models_neon_database_properties_update(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_update(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_update(attributes.set_elements(AAZObjectType, ".")) @classmethod - def _build_schema_models_neon_role_properties_update(cls, _builder): + def _build_schema_neon_role_properties_update(cls, _builder): if _builder is None: return _builder.set_prop("attributes", AAZListType, ".attributes") @@ -663,232 +665,232 @@ def _build_schema_models_neon_role_properties_update(cls, _builder): attributes = _builder.get(".attributes") if attributes is not None: - cls._build_schema_models_attributes_update(attributes.set_elements(AAZObjectType, ".")) + cls._build_schema_attributes_update(attributes.set_elements(AAZObjectType, ".")) permissions = _builder.get(".permissions") if permissions is not None: permissions.set_elements(AAZStrType, ".") - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value - _schema_models_endpoint_properties_read = None + _schema_endpoint_properties_read = None @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state return - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_endpoint_properties_read.created_at = AAZStrType( + endpoint_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_endpoint_properties_read.endpoint_type = AAZStrType( + endpoint_properties_read.endpoint_type = AAZStrType( serialized_name="endpointType", ) - models_endpoint_properties_read.entity_id = AAZStrType( + endpoint_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_endpoint_properties_read.entity_name = AAZStrType( + endpoint_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_endpoint_properties_read.project_id = AAZStrType( + endpoint_properties_read.project_id = AAZStrType( serialized_name="projectId", ) - models_endpoint_properties_read.provisioning_state = AAZStrType( + endpoint_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_endpoint_properties_read.attributes + attributes = _schema_endpoint_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state - _schema_models_neon_database_properties_read = None + _schema_neon_database_properties_read = None @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state return - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_database_properties_read.created_at = AAZStrType( + neon_database_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_id = AAZStrType( + neon_database_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_name = AAZStrType( + neon_database_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_database_properties_read.owner_name = AAZStrType( + neon_database_properties_read.owner_name = AAZStrType( serialized_name="ownerName", ) - models_neon_database_properties_read.provisioning_state = AAZStrType( + neon_database_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_database_properties_read.attributes + attributes = _schema_neon_database_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state - _schema_models_neon_role_properties_read = None + _schema_neon_role_properties_read = None @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state return - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_role_properties_read.created_at = AAZStrType( + neon_role_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_id = AAZStrType( + neon_role_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_name = AAZStrType( + neon_role_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_role_properties_read.is_super_user = AAZBoolType( + neon_role_properties_read.is_super_user = AAZBoolType( serialized_name="isSuperUser", ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_role_properties_read.attributes + attributes = _schema_neon_role_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - permissions = _schema_models_neon_role_properties_read.permissions + permissions = _schema_neon_role_properties_read.permissions permissions.Element = AAZStrType() - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state - _schema_models_project_read = None + _schema_project_read = None @classmethod - def _build_schema_models_project_read(cls, _schema): - if cls._schema_models_project_read is not None: - _schema.id = cls._schema_models_project_read.id - _schema.name = cls._schema_models_project_read.name - _schema.properties = cls._schema_models_project_read.properties - _schema.system_data = cls._schema_models_project_read.system_data - _schema.type = cls._schema_models_project_read.type + def _build_schema_project_read(cls, _schema): + if cls._schema_project_read is not None: + _schema.id = cls._schema_project_read.id + _schema.name = cls._schema_project_read.name + _schema.properties = cls._schema_project_read.properties + _schema.system_data = cls._schema_project_read.system_data + _schema.type = cls._schema_project_read.type return - cls._schema_models_project_read = _schema_models_project_read = AAZObjectType() + cls._schema_project_read = _schema_project_read = AAZObjectType() - models_project_read = _schema_models_project_read - models_project_read.id = AAZStrType( + project_read = _schema_project_read + project_read.id = AAZStrType( flags={"read_only": True}, ) - models_project_read.name = AAZStrType( + project_read.name = AAZStrType( flags={"read_only": True}, ) - models_project_read.properties = AAZObjectType() - models_project_read.system_data = AAZObjectType( + project_read.properties = AAZObjectType() + project_read.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) - models_project_read.type = AAZStrType( + project_read.type = AAZStrType( flags={"read_only": True}, ) - properties = _schema_models_project_read.properties + properties = _schema_project_read.properties properties.attributes = AAZListType() properties.branch = AAZObjectType() properties.created_at = AAZStrType( @@ -923,11 +925,11 @@ def _build_schema_models_project_read(cls, _schema): properties.roles = AAZListType() properties.storage = AAZIntType() - attributes = _schema_models_project_read.properties.attributes + attributes = _schema_project_read.properties.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - branch = _schema_models_project_read.properties.branch + branch = _schema_project_read.properties.branch branch.attributes = AAZListType() branch.created_at = AAZStrType( serialized_name="createdAt", @@ -960,27 +962,27 @@ def _build_schema_models_project_read(cls, _schema): ) branch.roles = AAZListType() - attributes = _schema_models_project_read.properties.branch.attributes + attributes = _schema_project_read.properties.branch.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - databases = _schema_models_project_read.properties.branch.databases + databases = _schema_project_read.properties.branch.databases databases.Element = AAZObjectType() - cls._build_schema_models_neon_database_properties_read(databases.Element) + cls._build_schema_neon_database_properties_read(databases.Element) - endpoints = _schema_models_project_read.properties.branch.endpoints + endpoints = _schema_project_read.properties.branch.endpoints endpoints.Element = AAZObjectType() - cls._build_schema_models_endpoint_properties_read(endpoints.Element) + cls._build_schema_endpoint_properties_read(endpoints.Element) - roles = _schema_models_project_read.properties.branch.roles + roles = _schema_project_read.properties.branch.roles roles.Element = AAZObjectType() - cls._build_schema_models_neon_role_properties_read(roles.Element) + cls._build_schema_neon_role_properties_read(roles.Element) - databases = _schema_models_project_read.properties.databases + databases = _schema_project_read.properties.databases databases.Element = AAZObjectType() - cls._build_schema_models_neon_database_properties_read(databases.Element) + cls._build_schema_neon_database_properties_read(databases.Element) - default_endpoint_settings = _schema_models_project_read.properties.default_endpoint_settings + default_endpoint_settings = _schema_project_read.properties.default_endpoint_settings default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( serialized_name="autoscalingLimitMaxCu", flags={"required": True}, @@ -990,15 +992,15 @@ def _build_schema_models_project_read(cls, _schema): flags={"required": True}, ) - endpoints = _schema_models_project_read.properties.endpoints + endpoints = _schema_project_read.properties.endpoints endpoints.Element = AAZObjectType() - cls._build_schema_models_endpoint_properties_read(endpoints.Element) + cls._build_schema_endpoint_properties_read(endpoints.Element) - roles = _schema_models_project_read.properties.roles + roles = _schema_project_read.properties.roles roles.Element = AAZObjectType() - cls._build_schema_models_neon_role_properties_read(roles.Element) + cls._build_schema_neon_role_properties_read(roles.Element) - system_data = _schema_models_project_read.system_data + system_data = _schema_project_read.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) @@ -1018,11 +1020,11 @@ def _build_schema_models_project_read(cls, _schema): serialized_name="lastModifiedByType", ) - _schema.id = cls._schema_models_project_read.id - _schema.name = cls._schema_models_project_read.name - _schema.properties = cls._schema_models_project_read.properties - _schema.system_data = cls._schema_models_project_read.system_data - _schema.type = cls._schema_models_project_read.type + _schema.id = cls._schema_project_read.id + _schema.name = cls._schema_project_read.name + _schema.properties = cls._schema_project_read.properties + _schema.system_data = cls._schema_project_read.system_data + _schema.type = cls._schema_project_read.type __all__ = ["Update"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_wait.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_wait.py index 3df35f666b5..2de532b0136 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_wait.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_wait.py @@ -42,7 +42,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.organization_name = AAZStrArg( options=["--organization-name"], - help="The name of the Neon Organization resource", + help="Name of the Neon organization.", required=True, id_part="name", fmt=AAZStrArgFormat( @@ -50,10 +50,13 @@ def _build_arguments_schema(cls, *args, **kwargs): max_length=50, min_length=1, ), + blank=AAZPromptInput( + msg="Please provide Neon Organization name:", + ), ) _args_schema.project_id = AAZStrArg( options=["--project-id"], - help="The id of the Neon Project resource.", + help="Id of the Neon project", required=True, id_part="child_name_1", fmt=AAZStrArgFormat( @@ -61,7 +64,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="The name of the Azure resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -220,7 +223,7 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.attributes attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) + _WaitHelper._build_schema_attributes_read(attributes.Element) branch = cls._schema_on_200.properties.branch branch.attributes = AAZListType() @@ -257,23 +260,23 @@ def _build_schema_on_200(cls): attributes = cls._schema_on_200.properties.branch.attributes attributes.Element = AAZObjectType() - _WaitHelper._build_schema_models_attributes_read(attributes.Element) + _WaitHelper._build_schema_attributes_read(attributes.Element) databases = cls._schema_on_200.properties.branch.databases databases.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_database_properties_read(databases.Element) + _WaitHelper._build_schema_neon_database_properties_read(databases.Element) endpoints = cls._schema_on_200.properties.branch.endpoints endpoints.Element = AAZObjectType() - _WaitHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _WaitHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200.properties.branch.roles roles.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_role_properties_read(roles.Element) + _WaitHelper._build_schema_neon_role_properties_read(roles.Element) databases = cls._schema_on_200.properties.databases databases.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_database_properties_read(databases.Element) + _WaitHelper._build_schema_neon_database_properties_read(databases.Element) default_endpoint_settings = cls._schema_on_200.properties.default_endpoint_settings default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( @@ -287,11 +290,11 @@ def _build_schema_on_200(cls): endpoints = cls._schema_on_200.properties.endpoints endpoints.Element = AAZObjectType() - _WaitHelper._build_schema_models_endpoint_properties_read(endpoints.Element) + _WaitHelper._build_schema_endpoint_properties_read(endpoints.Element) roles = cls._schema_on_200.properties.roles roles.Element = AAZObjectType() - _WaitHelper._build_schema_models_neon_role_properties_read(roles.Element) + _WaitHelper._build_schema_neon_role_properties_read(roles.Element) system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( @@ -319,194 +322,194 @@ def _build_schema_on_200(cls): class _WaitHelper: """Helper class for Wait""" - _schema_models_attributes_read = None + _schema_attributes_read = None @classmethod - def _build_schema_models_attributes_read(cls, _schema): - if cls._schema_models_attributes_read is not None: - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value return - cls._schema_models_attributes_read = _schema_models_attributes_read = AAZObjectType() + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() - models_attributes_read = _schema_models_attributes_read - models_attributes_read.name = AAZStrType( + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( flags={"required": True}, ) - models_attributes_read.value = AAZStrType( + attributes_read.value = AAZStrType( flags={"required": True}, ) - _schema.name = cls._schema_models_attributes_read.name - _schema.value = cls._schema_models_attributes_read.value + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value - _schema_models_endpoint_properties_read = None + _schema_endpoint_properties_read = None @classmethod - def _build_schema_models_endpoint_properties_read(cls, _schema): - if cls._schema_models_endpoint_properties_read is not None: - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state return - cls._schema_models_endpoint_properties_read = _schema_models_endpoint_properties_read = AAZObjectType() + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() - models_endpoint_properties_read = _schema_models_endpoint_properties_read - models_endpoint_properties_read.attributes = AAZListType() - models_endpoint_properties_read.branch_id = AAZStrType( + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_endpoint_properties_read.created_at = AAZStrType( + endpoint_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_endpoint_properties_read.endpoint_type = AAZStrType( + endpoint_properties_read.endpoint_type = AAZStrType( serialized_name="endpointType", ) - models_endpoint_properties_read.entity_id = AAZStrType( + endpoint_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_endpoint_properties_read.entity_name = AAZStrType( + endpoint_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_endpoint_properties_read.project_id = AAZStrType( + endpoint_properties_read.project_id = AAZStrType( serialized_name="projectId", ) - models_endpoint_properties_read.provisioning_state = AAZStrType( + endpoint_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_endpoint_properties_read.attributes + attributes = _schema_endpoint_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_endpoint_properties_read.attributes - _schema.branch_id = cls._schema_models_endpoint_properties_read.branch_id - _schema.created_at = cls._schema_models_endpoint_properties_read.created_at - _schema.endpoint_type = cls._schema_models_endpoint_properties_read.endpoint_type - _schema.entity_id = cls._schema_models_endpoint_properties_read.entity_id - _schema.entity_name = cls._schema_models_endpoint_properties_read.entity_name - _schema.project_id = cls._schema_models_endpoint_properties_read.project_id - _schema.provisioning_state = cls._schema_models_endpoint_properties_read.provisioning_state + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state - _schema_models_neon_database_properties_read = None + _schema_neon_database_properties_read = None @classmethod - def _build_schema_models_neon_database_properties_read(cls, _schema): - if cls._schema_models_neon_database_properties_read is not None: - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state return - cls._schema_models_neon_database_properties_read = _schema_models_neon_database_properties_read = AAZObjectType() + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() - models_neon_database_properties_read = _schema_models_neon_database_properties_read - models_neon_database_properties_read.attributes = AAZListType() - models_neon_database_properties_read.branch_id = AAZStrType( + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_database_properties_read.created_at = AAZStrType( + neon_database_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_id = AAZStrType( + neon_database_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_database_properties_read.entity_name = AAZStrType( + neon_database_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_database_properties_read.owner_name = AAZStrType( + neon_database_properties_read.owner_name = AAZStrType( serialized_name="ownerName", ) - models_neon_database_properties_read.provisioning_state = AAZStrType( + neon_database_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_database_properties_read.attributes + attributes = _schema_neon_database_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - _schema.attributes = cls._schema_models_neon_database_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_database_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_database_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_database_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_database_properties_read.entity_name - _schema.owner_name = cls._schema_models_neon_database_properties_read.owner_name - _schema.provisioning_state = cls._schema_models_neon_database_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state - _schema_models_neon_role_properties_read = None + _schema_neon_role_properties_read = None @classmethod - def _build_schema_models_neon_role_properties_read(cls, _schema): - if cls._schema_models_neon_role_properties_read is not None: - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state return - cls._schema_models_neon_role_properties_read = _schema_models_neon_role_properties_read = AAZObjectType() + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() - models_neon_role_properties_read = _schema_models_neon_role_properties_read - models_neon_role_properties_read.attributes = AAZListType() - models_neon_role_properties_read.branch_id = AAZStrType( + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( serialized_name="branchId", ) - models_neon_role_properties_read.created_at = AAZStrType( + neon_role_properties_read.created_at = AAZStrType( serialized_name="createdAt", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_id = AAZStrType( + neon_role_properties_read.entity_id = AAZStrType( serialized_name="entityId", flags={"read_only": True}, ) - models_neon_role_properties_read.entity_name = AAZStrType( + neon_role_properties_read.entity_name = AAZStrType( serialized_name="entityName", ) - models_neon_role_properties_read.is_super_user = AAZBoolType( + neon_role_properties_read.is_super_user = AAZBoolType( serialized_name="isSuperUser", ) - models_neon_role_properties_read.permissions = AAZListType() - models_neon_role_properties_read.provisioning_state = AAZStrType( + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) - attributes = _schema_models_neon_role_properties_read.attributes + attributes = _schema_neon_role_properties_read.attributes attributes.Element = AAZObjectType() - cls._build_schema_models_attributes_read(attributes.Element) + cls._build_schema_attributes_read(attributes.Element) - permissions = _schema_models_neon_role_properties_read.permissions + permissions = _schema_neon_role_properties_read.permissions permissions.Element = AAZStrType() - _schema.attributes = cls._schema_models_neon_role_properties_read.attributes - _schema.branch_id = cls._schema_models_neon_role_properties_read.branch_id - _schema.created_at = cls._schema_models_neon_role_properties_read.created_at - _schema.entity_id = cls._schema_models_neon_role_properties_read.entity_id - _schema.entity_name = cls._schema_models_neon_role_properties_read.entity_name - _schema.is_super_user = cls._schema_models_neon_role_properties_read.is_super_user - _schema.permissions = cls._schema_models_neon_role_properties_read.permissions - _schema.provisioning_state = cls._schema_models_neon_role_properties_read.provisioning_state + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state __all__ = ["Wait"] From 389e75dfca263ec6dabd4743a031fc21e5ba7244 Mon Sep 17 00:00:00 2001 From: Srinivas Alluri Date: Fri, 23 May 2025 10:16:46 +0530 Subject: [PATCH 2/6] update the history of the CLI commands --- src/neon/HISTORY.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/neon/HISTORY.rst b/src/neon/HISTORY.rst index 882c4f823f9..602c88d2974 100644 --- a/src/neon/HISTORY.rst +++ b/src/neon/HISTORY.rst @@ -13,4 +13,8 @@ Release History 1.0.0b3 ++++++ -* GA release of Neon CLI. Supports Change Plan, Project, Branches and Database Connection commands. \ No newline at end of file +* GA release of Neon CLI. Supports Change Plan, Project, Branches and Database Connection commands. + +1.0.0b4 +++++++ +* Update the CLI command description to support AI related queries. \ No newline at end of file From 8b1ff8955329a3a160de8676436161551bce152f Mon Sep 17 00:00:00 2001 From: Srinivas Alluri Date: Fri, 23 May 2025 10:17:58 +0530 Subject: [PATCH 3/6] update the version in setup.py --- src/neon/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neon/setup.py b/src/neon/setup.py index a85c340dd7a..38502780d31 100644 --- a/src/neon/setup.py +++ b/src/neon/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '1.0.0b3' +VERSION = '1.0.0b4' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 3f803fdb12fefff8a19a5170d2a69812524b747a Mon Sep 17 00:00:00 2001 From: Srinivas Alluri Date: Mon, 2 Jun 2025 10:38:37 +0530 Subject: [PATCH 4/6] updated the descriptions --- src/neon/azext_neon/aaz/latest/neon/__cmd_group.py | 2 +- src/neon/azext_neon/aaz/latest/neon/postgres/_create.py | 4 ++++ .../azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/branch/_create.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/branch/_delete.py | 2 +- src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py | 2 +- src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/branch/_update.py | 2 +- .../aaz/latest/neon/postgres/neon_database/__cmd_group.py | 2 +- .../aaz/latest/neon/postgres/neon_database/_list.py | 2 +- .../aaz/latest/neon/postgres/neon_role/__cmd_group.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/neon_role/_list.py | 2 +- .../aaz/latest/neon/postgres/organization/__cmd_group.py | 2 +- .../aaz/latest/neon/postgres/organization/_delete.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/organization/_list.py | 2 +- .../aaz/latest/neon/postgres/organization/_update.py | 2 +- .../aaz/latest/neon/postgres/project/__cmd_group.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/project/_create.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/project/_delete.py | 2 +- .../aaz/latest/neon/postgres/project/_get_connection_uri.py | 2 +- src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py | 4 +--- src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py | 2 +- .../azext_neon/aaz/latest/neon/postgres/project/_update.py | 2 +- 23 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/neon/azext_neon/aaz/latest/neon/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/__cmd_group.py index b089bb1faea..cb8b7c550f1 100644 --- a/src/neon/azext_neon/aaz/latest/neon/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/__cmd_group.py @@ -15,7 +15,7 @@ "neon", ) class __CMDGroup(AAZCommandGroup): - """Manage Neon Postgres + """Manage Neon Postgres databases and related resources within Azure. """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py b/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py index 062c5cea8d0..4df0a845d8f 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py @@ -11,6 +11,10 @@ from azure.cli.core.aaz import * +@register_command( + "neon postgres create", + is_preview=True, +) class Create(AAZCommand): """Create a Neon organization diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py index f43547df9ef..d4e61b202b3 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py @@ -15,7 +15,7 @@ "neon postgres branch", ) class __CMDGroup(AAZCommandGroup): - """Manage Branch + """Manage branches within a Neon Postgres database. """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py index 9228207713a..8722eb70574 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py @@ -15,7 +15,7 @@ "neon postgres branch create", ) class Create(AAZCommand): - """Create a new branch in a Neon project. + """Create a new branch within a Neon Postgres database. :example: Create a Branch az neon postgres branch create --resource-group rgneon --organization-name org-cli-test --project-name old-frost-16758796 --branch-name test-branch --entity-name test-branch --role-name test_role --database-name testneondb diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py index 90db9caaa5c..a4a66aeb76f 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_delete.py @@ -16,7 +16,7 @@ confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): - """Delete a branch from a Neon project. + """Delete an existing branch within a Neon Postgres database. :example: Delete Branch az neon postgres branch delete --subscription 38a546de-5736-48e8-a69a-5cc636794112 --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py index 8a0f31b2bf9..acc13d89b51 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_list.py @@ -15,7 +15,7 @@ "neon postgres branch list", ) class List(AAZCommand): - """List all branches in a Neon project. + """List all branch resources within a specific project in Neon Postgres. :example: List Branches under a Project az neon postgres branch list --subscription 38a546de-5736-48e8-a69a-5cc636794112 --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py index 1188a7b36dd..0ae9a1d8283 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_show.py @@ -15,7 +15,7 @@ "neon postgres branch show", ) class Show(AAZCommand): - """Retrieve details of a specific Neon branch. + """Retrieve details of a specific branch within a Neon Postgres database. :example: Show Branch Details az neon postgres branch show --subscription 38a546de-5736-48e8-a69a-5cc636794112 --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py index 26e0f2c3365..cf2b397f71f 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/branch/_update.py @@ -15,7 +15,7 @@ "neon postgres branch update", ) class Update(AAZCommand): - """Update a branch from a Neon project. + """Update the properties of an existing branch within a Neon Postgres database. :example: Update a Branch az neon postgres branch update --resource-group rgneon --organization-name org-cli-test --project-name old-frost-16758796 --project-id old-frost-16758796 --branch-name test-branch --entity-name test-branch2 --role-name test_role --database-name testneondb diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/__cmd_group.py index 757f47ca04d..fffb1adae53 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/__cmd_group.py @@ -15,7 +15,7 @@ "neon postgres neon-database", ) class __CMDGroup(AAZCommandGroup): - """Manage Neon Database + """Manage Neon Postgres databases within Azure. """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py index 439e010b013..6a384b17e4c 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_database/_list.py @@ -15,7 +15,7 @@ "neon postgres neon-database list", ) class List(AAZCommand): - """List all databases in a Neon branch. + """List all Neon Postgres databases associated with a specific branch. :example: List Neon Databases under a Branch az neon postgres neon-database list --resource-group rgneon --organization-name org-test-cli --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/__cmd_group.py index fe9c5337ca0..5d6869fff25 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/__cmd_group.py @@ -15,7 +15,7 @@ "neon postgres neon-role", ) class __CMDGroup(AAZCommandGroup): - """Manage Neon Role + """Manage roles and permissions within Neon Postgres databases. """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py index a058344d775..4e7884bbdcc 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/neon_role/_list.py @@ -15,7 +15,7 @@ "neon postgres neon-role list", ) class List(AAZCommand): - """List all roles in a Neon branch. + """List all roles and permissions associated with a specific branch in Neon Postgres. :example: List Neon Roles under a Branch az neon postgres neon-role list --resource-group rgneon --organization-name org-test-cli --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/__cmd_group.py index b1043f81419..83f6e7e7ef9 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/__cmd_group.py @@ -15,7 +15,7 @@ "neon postgres organization", ) class __CMDGroup(AAZCommandGroup): - """Manage a Neon organization + """Manage Neon organizations, which are entities created on the Neon side. """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py index 8c784f680a2..7bd8d1d9486 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py @@ -17,7 +17,7 @@ confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): - """Delete an existing Neon organization. + """Delete an existing Neon organization within Azure. :example: Organizations_Delete az neon postgres organization delete --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup --name demoNeonResource diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py index 7a696a92546..bdcb38fc47e 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py @@ -16,7 +16,7 @@ is_preview=True, ) class List(AAZCommand): - """List all Neon organizations under a subscription. + """List all Neon organizations associated with a specific subscription ID. :example: Organizations_ListBySubscription az neon postgres organization list --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py index d386a70f82a..a064a090109 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py @@ -16,7 +16,7 @@ is_preview=True, ) class Update(AAZCommand): - """Update metadata for an existing Neon organization. + """Update the properties of an existing Neon organization within Azure. :example: Organization_Update az az neon postgres organization update --resource-group demoResourceGroup --name demoNeonResource --user-details "{first-name:John,last-name:Doe,email-address:johndoe@example.com,upn:johndoe,phone-number:+1234567890}" --company-details "{company-name:DemoCompany,country:USA,office-address:'123 Azure Ave, Redmond, WA',business-phone:+9876543210,domain:democompany.com,number-of-employees:1000}" --partner-organization-properties "{organization-id:org-5678,org-name:PartnerOrg,single-sign-on-properties:{single-sign-on-state:Enable,enterprise-app-id:app-9876,single-sign-on-url:'https://sso.partnerorg.com',aad-domains:['partnerorg.com']}}" --tags "{environment:production}" diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/__cmd_group.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/__cmd_group.py index 554a9159b33..776ee9ef91f 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/__cmd_group.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/__cmd_group.py @@ -15,7 +15,7 @@ "neon postgres project", ) class __CMDGroup(AAZCommandGroup): - """The projects command allows you to list, create, update, delete, and retrieve information about Neon projects. + """Manage Neon projects, including listing, creating, updating, deleting, and retrieving project information. """ pass diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py index a6adfc52663..6df49b6bc76 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_create.py @@ -15,7 +15,7 @@ "neon postgres project create", ) class Create(AAZCommand): - """Create a new Neon project under an organization. + """Create a new Neon project resource within Azure. :example: Create Neon Project az neon postgres project create --resource-group rgneon --organization-name neon-org --project-name neon-project --region eastus2 --pg-version 17 --branch "{branch-name:main, role-name:owner_role,database-name:neondb}" diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py index 380a85bdd6b..cb15eb2506b 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_delete.py @@ -16,7 +16,7 @@ confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): - """Deletes a Neon Project resource + """Delete an existing Neon project resource within Azure. :example: Delete Neon Project az neon postgres project delete --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py index 09ad33c2054..fe4cabb4fa8 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_get_connection_uri.py @@ -15,7 +15,7 @@ "neon postgres project get-connection-uri", ) class GetConnectionUri(AAZCommand): - """Action to retrieve the connection URI for the Neon Database. + """Retrieve the connection URI for a specific Neon Postgres database. :example: Get Database Connection URI az neon postgres project get-connection-uri --resource-group rgneon --organization-name test-org --project-name entity-name --project-id old-frost-16758796 --branch-id br-spring-field-a8vje3tr --database-name neondb --role-name owner_role --endpoint-id ep-purple-voice-a84wphbw --is-pooled false diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py index d188b826031..c24ea073d07 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_list.py @@ -15,9 +15,7 @@ "neon postgres project list", ) class List(AAZCommand): - """List Neon Projects associated with Neon Organization resource - - List Neon Project associated with your Neon Organization resource, including those shared with you. + """List all Neon projects associated with a specific Neon organization. :example: List Neon Projects within an Organization az neon postgres project list --resource-group rgneon --organization-name org-cli-test diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py index 807c6bd8e53..7380f40e6a2 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_show.py @@ -15,7 +15,7 @@ "neon postgres project show", ) class Show(AAZCommand): - """Retrieve details of a specific Neon project. + """Retrieve details of a specific Neon project resource. :example: Show Neon Project Deatils az neon postgres project show --resource-group rgneon --organization-name org-cli-test --project-id old-frost-16758796 diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py index b1e652d0c82..589d28635e6 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/project/_update.py @@ -15,7 +15,7 @@ "neon postgres project update", ) class Update(AAZCommand): - """Updates a Neon Project resource + """Update the properties of an existing Neon project resource within Azure. :example: Neon Project Update az neon postgres project update --resource-group rgneon --organization-name neon-org --project-name neon-project --region eastus2 --pg-version 18 From 265e1dbba345991c7a6334b97fd01a607a404527 Mon Sep 17 00:00:00 2001 From: Srinivas Alluri Date: Tue, 3 Jun 2025 11:08:03 +0530 Subject: [PATCH 5/6] udpated the version --- .../aaz/latest/neon/postgres/_create.py | 4 - .../neon/postgres/organization/_delete.py | 11 +- .../neon/postgres/organization/_list.py | 454 ++++++++++- .../neon/postgres/organization/_show.py | 315 +++++++- .../neon/postgres/organization/_update.py | 704 +++++++++++++++--- .../neon/postgres/organization/_wait.py | 308 +++++++- 6 files changed, 1655 insertions(+), 141 deletions(-) diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py b/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py index 4df0a845d8f..062c5cea8d0 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/_create.py @@ -11,10 +11,6 @@ from azure.cli.core.aaz import * -@register_command( - "neon postgres create", - is_preview=True, -) class Create(AAZCommand): """Create a Neon organization diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py index 7bd8d1d9486..79c797af4df 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_delete.py @@ -13,20 +13,19 @@ @register_command( "neon postgres organization delete", - is_preview=True, confirmation="Are you sure you want to perform this operation?", ) class Delete(AAZCommand): """Delete an existing Neon organization within Azure. - :example: Organizations_Delete + :example: Delete Neon Postgres Organization az neon postgres organization delete --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup --name demoNeonResource """ _aaz_info = { - "version": "2024-08-01-preview", + "version": "2025-03-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], ] } @@ -59,7 +58,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="Name of the resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -150,7 +149,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-08-01-preview", + "api-version", "2025-03-01", required=True, ), } diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py index bdcb38fc47e..8060be9a5e8 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_list.py @@ -13,20 +13,19 @@ @register_command( "neon postgres organization list", - is_preview=True, ) class List(AAZCommand): """List all Neon organizations associated with a specific subscription ID. - :example: Organizations_ListBySubscription + :example: List Neon Postgres Organization az neon postgres organization list --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup """ _aaz_info = { - "version": "2024-08-01-preview", + "version": "2025-03-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/neon.postgres/organizations", "2024-08-01-preview"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations", "2024-08-01-preview"], + ["mgmt-plane", "/subscriptions/{}/providers/neon.postgres/organizations", "2025-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations", "2025-03-01"], ] } @@ -48,18 +47,18 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.resource_group = AAZResourceGroupNameArg( - help="Name of the resource group", + help="Name of the Azure resource group.", ) return cls._args_schema def _execute_operations(self): self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) if condition_0: - self.OrganizationsListByResourceGroup(ctx=self.ctx)() - if condition_1: self.OrganizationsListBySubscription(ctx=self.ctx)() + if condition_1: + self.OrganizationsListByResourceGroup(ctx=self.ctx)() self.post_operations() @register_callback @@ -75,7 +74,7 @@ def _output(self, *args, **kwargs): next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link - class OrganizationsListByResourceGroup(AAZHttpOperation): + class OrganizationsListBySubscription(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -89,7 +88,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations", + "/subscriptions/{subscriptionId}/providers/Neon.Postgres/organizations", **self.url_parameters ) @@ -104,10 +103,6 @@ def error_format(self): @property def url_parameters(self): parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, @@ -119,7 +114,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-08-01-preview", + "api-version", "2025-03-01", required=True, ), } @@ -194,6 +189,9 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) + properties.project_properties = AAZObjectType( + serialized_name="projectProperties", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -283,6 +281,116 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.value.Element.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() + project_properties = cls._schema_on_200.value.Element.properties.project_properties + project_properties.attributes = AAZListType() + project_properties.branch = AAZObjectType() + project_properties.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + project_properties.databases = AAZListType() + project_properties.default_endpoint_settings = AAZObjectType( + serialized_name="defaultEndpointSettings", + ) + project_properties.endpoints = AAZListType() + project_properties.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + project_properties.entity_name = AAZStrType( + serialized_name="entityName", + ) + project_properties.history_retention = AAZIntType( + serialized_name="historyRetention", + ) + project_properties.pg_version = AAZIntType( + serialized_name="pgVersion", + ) + project_properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + project_properties.region_id = AAZStrType( + serialized_name="regionId", + ) + project_properties.roles = AAZListType() + project_properties.storage = AAZIntType() + + attributes = cls._schema_on_200.value.Element.properties.project_properties.attributes + attributes.Element = AAZObjectType() + _ListHelper._build_schema_attributes_read(attributes.Element) + + branch = cls._schema_on_200.value.Element.properties.project_properties.branch + branch.attributes = AAZListType() + branch.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + branch.database_name = AAZStrType( + serialized_name="databaseName", + ) + branch.databases = AAZListType() + branch.endpoints = AAZListType() + branch.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + branch.entity_name = AAZStrType( + serialized_name="entityName", + ) + branch.parent_id = AAZStrType( + serialized_name="parentId", + ) + branch.project_id = AAZStrType( + serialized_name="projectId", + ) + branch.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + branch.role_name = AAZStrType( + serialized_name="roleName", + ) + branch.roles = AAZListType() + + attributes = cls._schema_on_200.value.Element.properties.project_properties.branch.attributes + attributes.Element = AAZObjectType() + _ListHelper._build_schema_attributes_read(attributes.Element) + + databases = cls._schema_on_200.value.Element.properties.project_properties.branch.databases + databases.Element = AAZObjectType() + _ListHelper._build_schema_neon_database_properties_read(databases.Element) + + endpoints = cls._schema_on_200.value.Element.properties.project_properties.branch.endpoints + endpoints.Element = AAZObjectType() + _ListHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.value.Element.properties.project_properties.branch.roles + roles.Element = AAZObjectType() + _ListHelper._build_schema_neon_role_properties_read(roles.Element) + + databases = cls._schema_on_200.value.Element.properties.project_properties.databases + databases.Element = AAZObjectType() + _ListHelper._build_schema_neon_database_properties_read(databases.Element) + + default_endpoint_settings = cls._schema_on_200.value.Element.properties.project_properties.default_endpoint_settings + default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( + serialized_name="autoscalingLimitMaxCu", + flags={"required": True}, + ) + default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( + serialized_name="autoscalingLimitMinCu", + flags={"required": True}, + ) + + endpoints = cls._schema_on_200.value.Element.properties.project_properties.endpoints + endpoints.Element = AAZObjectType() + _ListHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.value.Element.properties.project_properties.roles + roles.Element = AAZObjectType() + _ListHelper._build_schema_neon_role_properties_read(roles.Element) + user_details = cls._schema_on_200.value.Element.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -323,7 +431,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 - class OrganizationsListBySubscription(AAZHttpOperation): + class OrganizationsListByResourceGroup(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -337,7 +445,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Neon.Postgres/organizations", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations", **self.url_parameters ) @@ -352,6 +460,10 @@ def error_format(self): @property def url_parameters(self): parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, @@ -363,7 +475,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-08-01-preview", + "api-version", "2025-03-01", required=True, ), } @@ -438,6 +550,9 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) + properties.project_properties = AAZObjectType( + serialized_name="projectProperties", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -527,6 +642,116 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.value.Element.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() + project_properties = cls._schema_on_200.value.Element.properties.project_properties + project_properties.attributes = AAZListType() + project_properties.branch = AAZObjectType() + project_properties.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + project_properties.databases = AAZListType() + project_properties.default_endpoint_settings = AAZObjectType( + serialized_name="defaultEndpointSettings", + ) + project_properties.endpoints = AAZListType() + project_properties.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + project_properties.entity_name = AAZStrType( + serialized_name="entityName", + ) + project_properties.history_retention = AAZIntType( + serialized_name="historyRetention", + ) + project_properties.pg_version = AAZIntType( + serialized_name="pgVersion", + ) + project_properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + project_properties.region_id = AAZStrType( + serialized_name="regionId", + ) + project_properties.roles = AAZListType() + project_properties.storage = AAZIntType() + + attributes = cls._schema_on_200.value.Element.properties.project_properties.attributes + attributes.Element = AAZObjectType() + _ListHelper._build_schema_attributes_read(attributes.Element) + + branch = cls._schema_on_200.value.Element.properties.project_properties.branch + branch.attributes = AAZListType() + branch.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + branch.database_name = AAZStrType( + serialized_name="databaseName", + ) + branch.databases = AAZListType() + branch.endpoints = AAZListType() + branch.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + branch.entity_name = AAZStrType( + serialized_name="entityName", + ) + branch.parent_id = AAZStrType( + serialized_name="parentId", + ) + branch.project_id = AAZStrType( + serialized_name="projectId", + ) + branch.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + branch.role_name = AAZStrType( + serialized_name="roleName", + ) + branch.roles = AAZListType() + + attributes = cls._schema_on_200.value.Element.properties.project_properties.branch.attributes + attributes.Element = AAZObjectType() + _ListHelper._build_schema_attributes_read(attributes.Element) + + databases = cls._schema_on_200.value.Element.properties.project_properties.branch.databases + databases.Element = AAZObjectType() + _ListHelper._build_schema_neon_database_properties_read(databases.Element) + + endpoints = cls._schema_on_200.value.Element.properties.project_properties.branch.endpoints + endpoints.Element = AAZObjectType() + _ListHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.value.Element.properties.project_properties.branch.roles + roles.Element = AAZObjectType() + _ListHelper._build_schema_neon_role_properties_read(roles.Element) + + databases = cls._schema_on_200.value.Element.properties.project_properties.databases + databases.Element = AAZObjectType() + _ListHelper._build_schema_neon_database_properties_read(databases.Element) + + default_endpoint_settings = cls._schema_on_200.value.Element.properties.project_properties.default_endpoint_settings + default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( + serialized_name="autoscalingLimitMaxCu", + flags={"required": True}, + ) + default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( + serialized_name="autoscalingLimitMinCu", + flags={"required": True}, + ) + + endpoints = cls._schema_on_200.value.Element.properties.project_properties.endpoints + endpoints.Element = AAZObjectType() + _ListHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.value.Element.properties.project_properties.roles + roles.Element = AAZObjectType() + _ListHelper._build_schema_neon_role_properties_read(roles.Element) + user_details = cls._schema_on_200.value.Element.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -571,5 +796,194 @@ def _build_schema_on_200(cls): class _ListHelper: """Helper class for List""" + _schema_attributes_read = None + + @classmethod + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + return + + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() + + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( + flags={"required": True}, + ) + attributes_read.value = AAZStrType( + flags={"required": True}, + ) + + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + + _schema_endpoint_properties_read = None + + @classmethod + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + return + + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() + + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + endpoint_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + endpoint_properties_read.endpoint_type = AAZStrType( + serialized_name="endpointType", + ) + endpoint_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + endpoint_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + endpoint_properties_read.project_id = AAZStrType( + serialized_name="projectId", + ) + endpoint_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_endpoint_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + + _schema_neon_database_properties_read = None + + @classmethod + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + return + + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() + + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_database_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_database_properties_read.owner_name = AAZStrType( + serialized_name="ownerName", + ) + neon_database_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_database_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + + _schema_neon_role_properties_read = None + + @classmethod + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + return + + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() + + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_role_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_role_properties_read.is_super_user = AAZBoolType( + serialized_name="isSuperUser", + ) + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_role_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + permissions = _schema_neon_role_properties_read.permissions + permissions.Element = AAZStrType() + + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + __all__ = ["List"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py index de03b269af1..11a5fb9fdda 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_show.py @@ -13,19 +13,18 @@ @register_command( "neon postgres organization show", - is_preview=True, ) class Show(AAZCommand): """Retrieve details of a specific Neon organization. - :example: Organizations_Get - az neon postgres organization show --subscription 12345678-1234-1234-1234-123456789abc --resource-group demoResourceGroup --name demoNeonResource + :example: Show Neon Postgres Organization + az neon postgres organization show --resource-group demoResourceGroup --name demoNeonResource """ _aaz_info = { - "version": "2024-08-01-preview", + "version": "2025-03-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], ] } @@ -57,7 +56,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="Name of the resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -127,7 +126,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-08-01-preview", + "api-version", "2025-03-01", required=True, ), } @@ -191,6 +190,9 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) + properties.project_properties = AAZObjectType( + serialized_name="projectProperties", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -280,6 +282,116 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() + project_properties = cls._schema_on_200.properties.project_properties + project_properties.attributes = AAZListType() + project_properties.branch = AAZObjectType() + project_properties.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + project_properties.databases = AAZListType() + project_properties.default_endpoint_settings = AAZObjectType( + serialized_name="defaultEndpointSettings", + ) + project_properties.endpoints = AAZListType() + project_properties.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + project_properties.entity_name = AAZStrType( + serialized_name="entityName", + ) + project_properties.history_retention = AAZIntType( + serialized_name="historyRetention", + ) + project_properties.pg_version = AAZIntType( + serialized_name="pgVersion", + ) + project_properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + project_properties.region_id = AAZStrType( + serialized_name="regionId", + ) + project_properties.roles = AAZListType() + project_properties.storage = AAZIntType() + + attributes = cls._schema_on_200.properties.project_properties.attributes + attributes.Element = AAZObjectType() + _ShowHelper._build_schema_attributes_read(attributes.Element) + + branch = cls._schema_on_200.properties.project_properties.branch + branch.attributes = AAZListType() + branch.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + branch.database_name = AAZStrType( + serialized_name="databaseName", + ) + branch.databases = AAZListType() + branch.endpoints = AAZListType() + branch.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + branch.entity_name = AAZStrType( + serialized_name="entityName", + ) + branch.parent_id = AAZStrType( + serialized_name="parentId", + ) + branch.project_id = AAZStrType( + serialized_name="projectId", + ) + branch.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + branch.role_name = AAZStrType( + serialized_name="roleName", + ) + branch.roles = AAZListType() + + attributes = cls._schema_on_200.properties.project_properties.branch.attributes + attributes.Element = AAZObjectType() + _ShowHelper._build_schema_attributes_read(attributes.Element) + + databases = cls._schema_on_200.properties.project_properties.branch.databases + databases.Element = AAZObjectType() + _ShowHelper._build_schema_neon_database_properties_read(databases.Element) + + endpoints = cls._schema_on_200.properties.project_properties.branch.endpoints + endpoints.Element = AAZObjectType() + _ShowHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.properties.project_properties.branch.roles + roles.Element = AAZObjectType() + _ShowHelper._build_schema_neon_role_properties_read(roles.Element) + + databases = cls._schema_on_200.properties.project_properties.databases + databases.Element = AAZObjectType() + _ShowHelper._build_schema_neon_database_properties_read(databases.Element) + + default_endpoint_settings = cls._schema_on_200.properties.project_properties.default_endpoint_settings + default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( + serialized_name="autoscalingLimitMaxCu", + flags={"required": True}, + ) + default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( + serialized_name="autoscalingLimitMinCu", + flags={"required": True}, + ) + + endpoints = cls._schema_on_200.properties.project_properties.endpoints + endpoints.Element = AAZObjectType() + _ShowHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.properties.project_properties.roles + roles.Element = AAZObjectType() + _ShowHelper._build_schema_neon_role_properties_read(roles.Element) + user_details = cls._schema_on_200.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -324,5 +436,194 @@ def _build_schema_on_200(cls): class _ShowHelper: """Helper class for Show""" + _schema_attributes_read = None + + @classmethod + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + return + + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() + + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( + flags={"required": True}, + ) + attributes_read.value = AAZStrType( + flags={"required": True}, + ) + + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + + _schema_endpoint_properties_read = None + + @classmethod + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + return + + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() + + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + endpoint_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + endpoint_properties_read.endpoint_type = AAZStrType( + serialized_name="endpointType", + ) + endpoint_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + endpoint_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + endpoint_properties_read.project_id = AAZStrType( + serialized_name="projectId", + ) + endpoint_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_endpoint_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + + _schema_neon_database_properties_read = None + + @classmethod + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + return + + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() + + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_database_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_database_properties_read.owner_name = AAZStrType( + serialized_name="ownerName", + ) + neon_database_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_database_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + + _schema_neon_role_properties_read = None + + @classmethod + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + return + + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() + + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_role_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_role_properties_read.is_super_user = AAZBoolType( + serialized_name="isSuperUser", + ) + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_role_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + permissions = _schema_neon_role_properties_read.permissions + permissions.Element = AAZStrType() + + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + __all__ = ["Show"] diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py index a064a090109..01e344d584c 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_update.py @@ -13,19 +13,18 @@ @register_command( "neon postgres organization update", - is_preview=True, ) class Update(AAZCommand): """Update the properties of an existing Neon organization within Azure. - :example: Organization_Update - az az neon postgres organization update --resource-group demoResourceGroup --name demoNeonResource --user-details "{first-name:John,last-name:Doe,email-address:johndoe@example.com,upn:johndoe,phone-number:+1234567890}" --company-details "{company-name:DemoCompany,country:USA,office-address:'123 Azure Ave, Redmond, WA',business-phone:+9876543210,domain:democompany.com,number-of-employees:1000}" --partner-organization-properties "{organization-id:org-5678,org-name:PartnerOrg,single-sign-on-properties:{single-sign-on-state:Enable,enterprise-app-id:app-9876,single-sign-on-url:'https://sso.partnerorg.com',aad-domains:['partnerorg.com']}}" --tags "{environment:production}" + :example: Update Neon Postgres Organization + az neon postgres create --resource-group demoResourceGroup --name demoNeonResource --location eastus2 --subscription 12345678-1234-1234-1234-123456789abc --marketplace-details "{subscription-id:abcd1234-5678-90ab-cdef-12345678abcd,subscription-status:Subscribed,offer-details:{publisher-id:neon1722366567200,offer-id:neon_serverless_postgres_azure_prod,plan-id:neon_serverless_postgres_azure_prod_scale,plan-name:Scale Plan,term-unit:P1M,term-id:gmz7xq9ge3py}}" --company-details "{}" --partner-organization-properties "{}" """ _aaz_info = { - "version": "2024-08-01-preview", + "version": "2025-03-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], ] } @@ -60,7 +59,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="Name of the resource group", + help="Name of the Azure resource group.", required=True, ) @@ -72,16 +71,10 @@ def _build_arguments_schema(cls, *args, **kwargs): arg_group="Properties", help="Details of the company.", ) - _args_schema.partner_organization_properties = AAZObjectArg( - options=["--partner-org-props", "--partner-organization-properties"], + _args_schema.marketplace_details = AAZObjectArg( + options=["--marketplace-details"], arg_group="Properties", - help="Organization properties", - nullable=True, - ) - _args_schema.user_details = AAZObjectArg( - options=["--user-details"], - arg_group="Properties", - help="Details of the user.", + help="Marketplace details of the resource.", ) company_details = cls._args_schema.company_details @@ -116,100 +109,266 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) - partner_organization_properties = cls._args_schema.partner_organization_properties - partner_organization_properties.organization_id = AAZStrArg( - options=["organization-id"], - help="Organization Id in partner's system", - nullable=True, + marketplace_details = cls._args_schema.marketplace_details + marketplace_details.offer_details = AAZObjectArg( + options=["offer-details"], + help="Offer details for the marketplace that is selected by the user", ) - partner_organization_properties.org_name = AAZStrArg( - options=["org-name"], - help="Organization name in partner's system", - fmt=AAZStrArgFormat( - pattern="^[a-zA-Z0-9][a-zA-Z0-9_\\-.: ]*$", - max_length=50, - min_length=1, - ), + marketplace_details.subscription_id = AAZStrArg( + options=["subscription-id"], + help="SaaS subscription id for the the marketplace offer", + nullable=True, ) - partner_organization_properties.single_sign_on_properties = AAZObjectArg( - options=["single-sign-on-properties"], - help="Single Sign On properties for the organization", + marketplace_details.subscription_status = AAZStrArg( + options=["subscription-status"], + help="Marketplace subscription status", nullable=True, + enum={"PendingFulfillmentStart": "PendingFulfillmentStart", "Subscribed": "Subscribed", "Suspended": "Suspended", "Unsubscribed": "Unsubscribed"}, ) - single_sign_on_properties = cls._args_schema.partner_organization_properties.single_sign_on_properties - single_sign_on_properties.aad_domains = AAZListArg( - options=["aad-domains"], - help="List of AAD domains fetched from Microsoft Graph for user.", + offer_details = cls._args_schema.marketplace_details.offer_details + offer_details.offer_id = AAZStrArg( + options=["offer-id"], + help="Offer Id for the marketplace offer", + ) + offer_details.plan_id = AAZStrArg( + options=["plan-id"], + help="Plan Id for the marketplace offer", + ) + offer_details.plan_name = AAZStrArg( + options=["plan-name"], + help="Plan Name for the marketplace offer", nullable=True, ) - single_sign_on_properties.enterprise_app_id = AAZStrArg( - options=["enterprise-app-id"], - help="AAD enterprise application Id used to setup SSO", + offer_details.publisher_id = AAZStrArg( + options=["publisher-id"], + help="Publisher Id for the marketplace offer", + ) + offer_details.term_id = AAZStrArg( + options=["term-id"], + help="Term Id for the marketplace offer", nullable=True, ) - single_sign_on_properties.single_sign_on_state = AAZStrArg( - options=["single-sign-on-state"], - help="State of the Single Sign On for the organization", + offer_details.term_unit = AAZStrArg( + options=["term-unit"], + help="Term Name for the marketplace offer", nullable=True, - enum={"Disable": "Disable", "Enable": "Enable", "Initial": "Initial"}, ) - single_sign_on_properties.single_sign_on_url = AAZStrArg( - options=["single-sign-on-url"], - help="URL for SSO to be used by the partner to redirect the user to their system", + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", nullable=True, ) - aad_domains = cls._args_schema.partner_organization_properties.single_sign_on_properties.aad_domains - aad_domains.Element = AAZStrArg( + tags = cls._args_schema.tags + tags.Element = AAZStrArg( nullable=True, ) + return cls._args_schema - user_details = cls._args_schema.user_details - user_details.email_address = AAZStrArg( - options=["email-address"], - help="Email address of the user", + _args_attributes_update = None + + @classmethod + def _build_args_attributes_update(cls, _schema): + if cls._args_attributes_update is not None: + _schema.name = cls._args_attributes_update.name + _schema.value = cls._args_attributes_update.value + return + + cls._args_attributes_update = AAZObjectArg( + nullable=True, + ) + + attributes_update = cls._args_attributes_update + attributes_update.name = AAZStrArg( + options=["name"], + help="Name of the attribute", + ) + attributes_update.value = AAZStrArg( + options=["value"], + help="Value of the attribute", + ) + + _schema.name = cls._args_attributes_update.name + _schema.value = cls._args_attributes_update.value + + _args_endpoint_properties_update = None + + @classmethod + def _build_args_endpoint_properties_update(cls, _schema): + if cls._args_endpoint_properties_update is not None: + _schema.attributes = cls._args_endpoint_properties_update.attributes + _schema.branch_id = cls._args_endpoint_properties_update.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_update.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_update.entity_name + _schema.project_id = cls._args_endpoint_properties_update.project_id + return + + cls._args_endpoint_properties_update = AAZObjectArg( + nullable=True, + ) + + endpoint_properties_update = cls._args_endpoint_properties_update + endpoint_properties_update.attributes = AAZListArg( + options=["attributes"], + help="Additional attributes for the entity", + nullable=True, + ) + endpoint_properties_update.branch_id = AAZStrArg( + options=["branch-id"], + help="The ID of the branch this endpoint belongs to", + nullable=True, + ) + endpoint_properties_update.endpoint_type = AAZStrArg( + options=["endpoint-type"], + help="The type of the endpoint", + nullable=True, + enum={"read_only": "read_only", "read_write": "read_write"}, + ) + endpoint_properties_update.entity_name = AAZStrArg( + options=["entity-name"], + help="Name of the resource", nullable=True, fmt=AAZStrArgFormat( - pattern="^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$", + pattern="^\\S.{0,62}\\S$|^\\S$", ), ) - user_details.first_name = AAZStrArg( - options=["first-name"], - help="First name of the user", + endpoint_properties_update.project_id = AAZStrArg( + options=["project-id"], + help="The ID of the project this endpoint belongs to", nullable=True, ) - user_details.last_name = AAZStrArg( - options=["last-name"], - help="Last name of the user", + + attributes = cls._args_endpoint_properties_update.attributes + attributes.Element = AAZObjectArg( nullable=True, ) - user_details.phone_number = AAZStrArg( - options=["phone-number"], - help="User's phone number", + cls._build_args_attributes_update(attributes.Element) + + _schema.attributes = cls._args_endpoint_properties_update.attributes + _schema.branch_id = cls._args_endpoint_properties_update.branch_id + _schema.endpoint_type = cls._args_endpoint_properties_update.endpoint_type + _schema.entity_name = cls._args_endpoint_properties_update.entity_name + _schema.project_id = cls._args_endpoint_properties_update.project_id + + _args_neon_database_properties_update = None + + @classmethod + def _build_args_neon_database_properties_update(cls, _schema): + if cls._args_neon_database_properties_update is not None: + _schema.attributes = cls._args_neon_database_properties_update.attributes + _schema.branch_id = cls._args_neon_database_properties_update.branch_id + _schema.entity_name = cls._args_neon_database_properties_update.entity_name + _schema.owner_name = cls._args_neon_database_properties_update.owner_name + return + + cls._args_neon_database_properties_update = AAZObjectArg( nullable=True, ) - user_details.upn = AAZStrArg( - options=["upn"], - help="User's principal name", + + neon_database_properties_update = cls._args_neon_database_properties_update + neon_database_properties_update.attributes = AAZListArg( + options=["attributes"], + help="Additional attributes for the entity", + nullable=True, + ) + neon_database_properties_update.branch_id = AAZStrArg( + options=["branch-id"], + help="The ID of the branch this database belongs to", + nullable=True, + ) + neon_database_properties_update.entity_name = AAZStrArg( + options=["entity-name"], + help="Name of the resource", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^\\S.{0,62}\\S$|^\\S$", + ), + ) + neon_database_properties_update.owner_name = AAZStrArg( + options=["owner-name"], + help="The name of the role that owns the database", nullable=True, ) - # define Arg Group "Resource" + attributes = cls._args_neon_database_properties_update.attributes + attributes.Element = AAZObjectArg( + nullable=True, + ) + cls._build_args_attributes_update(attributes.Element) - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Resource", - help="Resource tags.", + _schema.attributes = cls._args_neon_database_properties_update.attributes + _schema.branch_id = cls._args_neon_database_properties_update.branch_id + _schema.entity_name = cls._args_neon_database_properties_update.entity_name + _schema.owner_name = cls._args_neon_database_properties_update.owner_name + + _args_neon_role_properties_update = None + + @classmethod + def _build_args_neon_role_properties_update(cls, _schema): + if cls._args_neon_role_properties_update is not None: + _schema.attributes = cls._args_neon_role_properties_update.attributes + _schema.branch_id = cls._args_neon_role_properties_update.branch_id + _schema.entity_name = cls._args_neon_role_properties_update.entity_name + _schema.is_super_user = cls._args_neon_role_properties_update.is_super_user + _schema.permissions = cls._args_neon_role_properties_update.permissions + return + + cls._args_neon_role_properties_update = AAZObjectArg( nullable=True, ) - tags = cls._args_schema.tags - tags.Element = AAZStrArg( + neon_role_properties_update = cls._args_neon_role_properties_update + neon_role_properties_update.attributes = AAZListArg( + options=["attributes"], + help="Additional attributes for the entity", + nullable=True, + ) + neon_role_properties_update.branch_id = AAZStrArg( + options=["branch-id"], + help="The ID of the branch this role belongs to", + nullable=True, + ) + neon_role_properties_update.entity_name = AAZStrArg( + options=["entity-name"], + help="Name of the resource", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^\\S.{0,62}\\S$|^\\S$", + ), + ) + neon_role_properties_update.is_super_user = AAZBoolArg( + options=["is-super-user"], + help="Indicates whether the role has superuser privileges", + nullable=True, + ) + neon_role_properties_update.permissions = AAZListArg( + options=["permissions"], + help="Permissions assigned to the role", + nullable=True, + ) + + attributes = cls._args_neon_role_properties_update.attributes + attributes.Element = AAZObjectArg( + nullable=True, + ) + cls._build_args_attributes_update(attributes.Element) + + permissions = cls._args_neon_role_properties_update.permissions + permissions.Element = AAZStrArg( nullable=True, ) - return cls._args_schema + + _schema.attributes = cls._args_neon_role_properties_update.attributes + _schema.branch_id = cls._args_neon_role_properties_update.branch_id + _schema.entity_name = cls._args_neon_role_properties_update.entity_name + _schema.is_super_user = cls._args_neon_role_properties_update.is_super_user + _schema.permissions = cls._args_neon_role_properties_update.permissions def _execute_operations(self): self.pre_operations() @@ -289,7 +448,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-08-01-preview", + "api-version", "2025-03-01", required=True, ), } @@ -388,7 +547,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-08-01-preview", + "api-version", "2025-03-01", required=True, ), } @@ -452,8 +611,7 @@ def _update_instance(self, instance): properties = _builder.get(".properties") if properties is not None: properties.set_prop("companyDetails", AAZObjectType, ".company_details", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("partnerOrganizationProperties", AAZObjectType, ".partner_organization_properties") - properties.set_prop("userDetails", AAZObjectType, ".user_details", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("marketplaceDetails", AAZObjectType, ".marketplace_details", typ_kwargs={"flags": {"required": True}}) company_details = _builder.get(".properties.companyDetails") if company_details is not None: @@ -464,30 +622,20 @@ def _update_instance(self, instance): company_details.set_prop("numberOfEmployees", AAZIntType, ".number_of_employees") company_details.set_prop("officeAddress", AAZStrType, ".office_address") - partner_organization_properties = _builder.get(".properties.partnerOrganizationProperties") - if partner_organization_properties is not None: - partner_organization_properties.set_prop("organizationId", AAZStrType, ".organization_id") - partner_organization_properties.set_prop("organizationName", AAZStrType, ".org_name", typ_kwargs={"flags": {"required": True}}) - partner_organization_properties.set_prop("singleSignOnProperties", AAZObjectType, ".single_sign_on_properties") - - single_sign_on_properties = _builder.get(".properties.partnerOrganizationProperties.singleSignOnProperties") - if single_sign_on_properties is not None: - single_sign_on_properties.set_prop("aadDomains", AAZListType, ".aad_domains") - single_sign_on_properties.set_prop("enterpriseAppId", AAZStrType, ".enterprise_app_id") - single_sign_on_properties.set_prop("singleSignOnState", AAZStrType, ".single_sign_on_state") - single_sign_on_properties.set_prop("singleSignOnUrl", AAZStrType, ".single_sign_on_url") - - aad_domains = _builder.get(".properties.partnerOrganizationProperties.singleSignOnProperties.aadDomains") - if aad_domains is not None: - aad_domains.set_elements(AAZStrType, ".") - - user_details = _builder.get(".properties.userDetails") - if user_details is not None: - user_details.set_prop("emailAddress", AAZStrType, ".email_address") - user_details.set_prop("firstName", AAZStrType, ".first_name") - user_details.set_prop("lastName", AAZStrType, ".last_name") - user_details.set_prop("phoneNumber", AAZStrType, ".phone_number") - user_details.set_prop("upn", AAZStrType, ".upn") + marketplace_details = _builder.get(".properties.marketplaceDetails") + if marketplace_details is not None: + marketplace_details.set_prop("offerDetails", AAZObjectType, ".offer_details", typ_kwargs={"flags": {"required": True}}) + marketplace_details.set_prop("subscriptionId", AAZStrType, ".subscription_id") + marketplace_details.set_prop("subscriptionStatus", AAZStrType, ".subscription_status") + + offer_details = _builder.get(".properties.marketplaceDetails.offerDetails") + if offer_details is not None: + offer_details.set_prop("offerId", AAZStrType, ".offer_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("planId", AAZStrType, ".plan_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("planName", AAZStrType, ".plan_name") + offer_details.set_prop("publisherId", AAZStrType, ".publisher_id", typ_kwargs={"flags": {"required": True}}) + offer_details.set_prop("termId", AAZStrType, ".term_id") + offer_details.set_prop("termUnit", AAZStrType, ".term_unit") tags = _builder.get(".tags") if tags is not None: @@ -507,6 +655,247 @@ def __call__(self, *args, **kwargs): class _UpdateHelper: """Helper class for Update""" + @classmethod + def _build_schema_attributes_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) + + @classmethod + def _build_schema_endpoint_properties_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("attributes", AAZListType, ".attributes") + _builder.set_prop("branchId", AAZStrType, ".branch_id") + _builder.set_prop("endpointType", AAZStrType, ".endpoint_type") + _builder.set_prop("entityName", AAZStrType, ".entity_name") + _builder.set_prop("projectId", AAZStrType, ".project_id") + + attributes = _builder.get(".attributes") + if attributes is not None: + cls._build_schema_attributes_update(attributes.set_elements(AAZObjectType, ".")) + + @classmethod + def _build_schema_neon_database_properties_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("attributes", AAZListType, ".attributes") + _builder.set_prop("branchId", AAZStrType, ".branch_id") + _builder.set_prop("entityName", AAZStrType, ".entity_name") + _builder.set_prop("ownerName", AAZStrType, ".owner_name") + + attributes = _builder.get(".attributes") + if attributes is not None: + cls._build_schema_attributes_update(attributes.set_elements(AAZObjectType, ".")) + + @classmethod + def _build_schema_neon_role_properties_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("attributes", AAZListType, ".attributes") + _builder.set_prop("branchId", AAZStrType, ".branch_id") + _builder.set_prop("entityName", AAZStrType, ".entity_name") + _builder.set_prop("isSuperUser", AAZBoolType, ".is_super_user") + _builder.set_prop("permissions", AAZListType, ".permissions") + + attributes = _builder.get(".attributes") + if attributes is not None: + cls._build_schema_attributes_update(attributes.set_elements(AAZObjectType, ".")) + + permissions = _builder.get(".permissions") + if permissions is not None: + permissions.set_elements(AAZStrType, ".") + + _schema_attributes_read = None + + @classmethod + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + return + + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() + + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( + flags={"required": True}, + ) + attributes_read.value = AAZStrType( + flags={"required": True}, + ) + + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + + _schema_endpoint_properties_read = None + + @classmethod + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + return + + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() + + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + endpoint_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + endpoint_properties_read.endpoint_type = AAZStrType( + serialized_name="endpointType", + ) + endpoint_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + endpoint_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + endpoint_properties_read.project_id = AAZStrType( + serialized_name="projectId", + ) + endpoint_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_endpoint_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + + _schema_neon_database_properties_read = None + + @classmethod + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + return + + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() + + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_database_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_database_properties_read.owner_name = AAZStrType( + serialized_name="ownerName", + ) + neon_database_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_database_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + + _schema_neon_role_properties_read = None + + @classmethod + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + return + + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() + + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_role_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_role_properties_read.is_super_user = AAZBoolType( + serialized_name="isSuperUser", + ) + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_role_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + permissions = _schema_neon_role_properties_read.permissions + permissions.Element = AAZStrType() + + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + _schema_organization_resource_read = None @classmethod @@ -555,6 +944,9 @@ def _build_schema_organization_resource_read(cls, _schema): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) + properties.project_properties = AAZObjectType( + serialized_name="projectProperties", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -644,6 +1036,116 @@ def _build_schema_organization_resource_read(cls, _schema): aad_domains = _schema_organization_resource_read.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() + project_properties = _schema_organization_resource_read.properties.project_properties + project_properties.attributes = AAZListType() + project_properties.branch = AAZObjectType() + project_properties.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + project_properties.databases = AAZListType() + project_properties.default_endpoint_settings = AAZObjectType( + serialized_name="defaultEndpointSettings", + ) + project_properties.endpoints = AAZListType() + project_properties.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + project_properties.entity_name = AAZStrType( + serialized_name="entityName", + ) + project_properties.history_retention = AAZIntType( + serialized_name="historyRetention", + ) + project_properties.pg_version = AAZIntType( + serialized_name="pgVersion", + ) + project_properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + project_properties.region_id = AAZStrType( + serialized_name="regionId", + ) + project_properties.roles = AAZListType() + project_properties.storage = AAZIntType() + + attributes = _schema_organization_resource_read.properties.project_properties.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + branch = _schema_organization_resource_read.properties.project_properties.branch + branch.attributes = AAZListType() + branch.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + branch.database_name = AAZStrType( + serialized_name="databaseName", + ) + branch.databases = AAZListType() + branch.endpoints = AAZListType() + branch.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + branch.entity_name = AAZStrType( + serialized_name="entityName", + ) + branch.parent_id = AAZStrType( + serialized_name="parentId", + ) + branch.project_id = AAZStrType( + serialized_name="projectId", + ) + branch.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + branch.role_name = AAZStrType( + serialized_name="roleName", + ) + branch.roles = AAZListType() + + attributes = _schema_organization_resource_read.properties.project_properties.branch.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + databases = _schema_organization_resource_read.properties.project_properties.branch.databases + databases.Element = AAZObjectType() + cls._build_schema_neon_database_properties_read(databases.Element) + + endpoints = _schema_organization_resource_read.properties.project_properties.branch.endpoints + endpoints.Element = AAZObjectType() + cls._build_schema_endpoint_properties_read(endpoints.Element) + + roles = _schema_organization_resource_read.properties.project_properties.branch.roles + roles.Element = AAZObjectType() + cls._build_schema_neon_role_properties_read(roles.Element) + + databases = _schema_organization_resource_read.properties.project_properties.databases + databases.Element = AAZObjectType() + cls._build_schema_neon_database_properties_read(databases.Element) + + default_endpoint_settings = _schema_organization_resource_read.properties.project_properties.default_endpoint_settings + default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( + serialized_name="autoscalingLimitMaxCu", + flags={"required": True}, + ) + default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( + serialized_name="autoscalingLimitMinCu", + flags={"required": True}, + ) + + endpoints = _schema_organization_resource_read.properties.project_properties.endpoints + endpoints.Element = AAZObjectType() + cls._build_schema_endpoint_properties_read(endpoints.Element) + + roles = _schema_organization_resource_read.properties.project_properties.roles + roles.Element = AAZObjectType() + cls._build_schema_neon_role_properties_read(roles.Element) + user_details = _schema_organization_resource_read.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", diff --git a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py index f32cc2d49dd..5c599700c06 100644 --- a/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py +++ b/src/neon/azext_neon/aaz/latest/neon/postgres/organization/_wait.py @@ -20,7 +20,7 @@ class Wait(AAZWaitCommand): _aaz_info = { "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"], ] } @@ -52,7 +52,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.resource_group = AAZResourceGroupNameArg( - help="Name of the resource group", + help="Name of the Azure resource group.", required=True, ) return cls._args_schema @@ -122,7 +122,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-08-01-preview", + "api-version", "2025-03-01", required=True, ), } @@ -186,6 +186,9 @@ def _build_schema_on_200(cls): properties.partner_organization_properties = AAZObjectType( serialized_name="partnerOrganizationProperties", ) + properties.project_properties = AAZObjectType( + serialized_name="projectProperties", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -275,6 +278,116 @@ def _build_schema_on_200(cls): aad_domains = cls._schema_on_200.properties.partner_organization_properties.single_sign_on_properties.aad_domains aad_domains.Element = AAZStrType() + project_properties = cls._schema_on_200.properties.project_properties + project_properties.attributes = AAZListType() + project_properties.branch = AAZObjectType() + project_properties.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + project_properties.databases = AAZListType() + project_properties.default_endpoint_settings = AAZObjectType( + serialized_name="defaultEndpointSettings", + ) + project_properties.endpoints = AAZListType() + project_properties.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + project_properties.entity_name = AAZStrType( + serialized_name="entityName", + ) + project_properties.history_retention = AAZIntType( + serialized_name="historyRetention", + ) + project_properties.pg_version = AAZIntType( + serialized_name="pgVersion", + ) + project_properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + project_properties.region_id = AAZStrType( + serialized_name="regionId", + ) + project_properties.roles = AAZListType() + project_properties.storage = AAZIntType() + + attributes = cls._schema_on_200.properties.project_properties.attributes + attributes.Element = AAZObjectType() + _WaitHelper._build_schema_attributes_read(attributes.Element) + + branch = cls._schema_on_200.properties.project_properties.branch + branch.attributes = AAZListType() + branch.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + branch.database_name = AAZStrType( + serialized_name="databaseName", + ) + branch.databases = AAZListType() + branch.endpoints = AAZListType() + branch.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + branch.entity_name = AAZStrType( + serialized_name="entityName", + ) + branch.parent_id = AAZStrType( + serialized_name="parentId", + ) + branch.project_id = AAZStrType( + serialized_name="projectId", + ) + branch.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + branch.role_name = AAZStrType( + serialized_name="roleName", + ) + branch.roles = AAZListType() + + attributes = cls._schema_on_200.properties.project_properties.branch.attributes + attributes.Element = AAZObjectType() + _WaitHelper._build_schema_attributes_read(attributes.Element) + + databases = cls._schema_on_200.properties.project_properties.branch.databases + databases.Element = AAZObjectType() + _WaitHelper._build_schema_neon_database_properties_read(databases.Element) + + endpoints = cls._schema_on_200.properties.project_properties.branch.endpoints + endpoints.Element = AAZObjectType() + _WaitHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.properties.project_properties.branch.roles + roles.Element = AAZObjectType() + _WaitHelper._build_schema_neon_role_properties_read(roles.Element) + + databases = cls._schema_on_200.properties.project_properties.databases + databases.Element = AAZObjectType() + _WaitHelper._build_schema_neon_database_properties_read(databases.Element) + + default_endpoint_settings = cls._schema_on_200.properties.project_properties.default_endpoint_settings + default_endpoint_settings.autoscaling_limit_max_cu = AAZFloatType( + serialized_name="autoscalingLimitMaxCu", + flags={"required": True}, + ) + default_endpoint_settings.autoscaling_limit_min_cu = AAZFloatType( + serialized_name="autoscalingLimitMinCu", + flags={"required": True}, + ) + + endpoints = cls._schema_on_200.properties.project_properties.endpoints + endpoints.Element = AAZObjectType() + _WaitHelper._build_schema_endpoint_properties_read(endpoints.Element) + + roles = cls._schema_on_200.properties.project_properties.roles + roles.Element = AAZObjectType() + _WaitHelper._build_schema_neon_role_properties_read(roles.Element) + user_details = cls._schema_on_200.properties.user_details user_details.email_address = AAZStrType( serialized_name="emailAddress", @@ -319,5 +432,194 @@ def _build_schema_on_200(cls): class _WaitHelper: """Helper class for Wait""" + _schema_attributes_read = None + + @classmethod + def _build_schema_attributes_read(cls, _schema): + if cls._schema_attributes_read is not None: + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + return + + cls._schema_attributes_read = _schema_attributes_read = AAZObjectType() + + attributes_read = _schema_attributes_read + attributes_read.name = AAZStrType( + flags={"required": True}, + ) + attributes_read.value = AAZStrType( + flags={"required": True}, + ) + + _schema.name = cls._schema_attributes_read.name + _schema.value = cls._schema_attributes_read.value + + _schema_endpoint_properties_read = None + + @classmethod + def _build_schema_endpoint_properties_read(cls, _schema): + if cls._schema_endpoint_properties_read is not None: + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + return + + cls._schema_endpoint_properties_read = _schema_endpoint_properties_read = AAZObjectType() + + endpoint_properties_read = _schema_endpoint_properties_read + endpoint_properties_read.attributes = AAZListType() + endpoint_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + endpoint_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + endpoint_properties_read.endpoint_type = AAZStrType( + serialized_name="endpointType", + ) + endpoint_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + endpoint_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + endpoint_properties_read.project_id = AAZStrType( + serialized_name="projectId", + ) + endpoint_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_endpoint_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_endpoint_properties_read.attributes + _schema.branch_id = cls._schema_endpoint_properties_read.branch_id + _schema.created_at = cls._schema_endpoint_properties_read.created_at + _schema.endpoint_type = cls._schema_endpoint_properties_read.endpoint_type + _schema.entity_id = cls._schema_endpoint_properties_read.entity_id + _schema.entity_name = cls._schema_endpoint_properties_read.entity_name + _schema.project_id = cls._schema_endpoint_properties_read.project_id + _schema.provisioning_state = cls._schema_endpoint_properties_read.provisioning_state + + _schema_neon_database_properties_read = None + + @classmethod + def _build_schema_neon_database_properties_read(cls, _schema): + if cls._schema_neon_database_properties_read is not None: + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + return + + cls._schema_neon_database_properties_read = _schema_neon_database_properties_read = AAZObjectType() + + neon_database_properties_read = _schema_neon_database_properties_read + neon_database_properties_read.attributes = AAZListType() + neon_database_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_database_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_database_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_database_properties_read.owner_name = AAZStrType( + serialized_name="ownerName", + ) + neon_database_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_database_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + _schema.attributes = cls._schema_neon_database_properties_read.attributes + _schema.branch_id = cls._schema_neon_database_properties_read.branch_id + _schema.created_at = cls._schema_neon_database_properties_read.created_at + _schema.entity_id = cls._schema_neon_database_properties_read.entity_id + _schema.entity_name = cls._schema_neon_database_properties_read.entity_name + _schema.owner_name = cls._schema_neon_database_properties_read.owner_name + _schema.provisioning_state = cls._schema_neon_database_properties_read.provisioning_state + + _schema_neon_role_properties_read = None + + @classmethod + def _build_schema_neon_role_properties_read(cls, _schema): + if cls._schema_neon_role_properties_read is not None: + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + return + + cls._schema_neon_role_properties_read = _schema_neon_role_properties_read = AAZObjectType() + + neon_role_properties_read = _schema_neon_role_properties_read + neon_role_properties_read.attributes = AAZListType() + neon_role_properties_read.branch_id = AAZStrType( + serialized_name="branchId", + ) + neon_role_properties_read.created_at = AAZStrType( + serialized_name="createdAt", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_id = AAZStrType( + serialized_name="entityId", + flags={"read_only": True}, + ) + neon_role_properties_read.entity_name = AAZStrType( + serialized_name="entityName", + ) + neon_role_properties_read.is_super_user = AAZBoolType( + serialized_name="isSuperUser", + ) + neon_role_properties_read.permissions = AAZListType() + neon_role_properties_read.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + attributes = _schema_neon_role_properties_read.attributes + attributes.Element = AAZObjectType() + cls._build_schema_attributes_read(attributes.Element) + + permissions = _schema_neon_role_properties_read.permissions + permissions.Element = AAZStrType() + + _schema.attributes = cls._schema_neon_role_properties_read.attributes + _schema.branch_id = cls._schema_neon_role_properties_read.branch_id + _schema.created_at = cls._schema_neon_role_properties_read.created_at + _schema.entity_id = cls._schema_neon_role_properties_read.entity_id + _schema.entity_name = cls._schema_neon_role_properties_read.entity_name + _schema.is_super_user = cls._schema_neon_role_properties_read.is_super_user + _schema.permissions = cls._schema_neon_role_properties_read.permissions + _schema.provisioning_state = cls._schema_neon_role_properties_read.provisioning_state + __all__ = ["Wait"] From d0f2c51eaa2a4eeed300a242a74c62fbe2b47e18 Mon Sep 17 00:00:00 2001 From: Srinivas Alluri Date: Thu, 5 Jun 2025 09:55:24 +0530 Subject: [PATCH 6/6] updated neon test recordings --- src/neon/azext_neon/tests/latest/recordings/test_neon.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neon/azext_neon/tests/latest/recordings/test_neon.yaml b/src/neon/azext_neon/tests/latest/recordings/test_neon.yaml index 5cc44dee7b6..77219defb8b 100644 --- a/src/neon/azext_neon/tests/latest/recordings/test_neon.yaml +++ b/src/neon/azext_neon/tests/latest/recordings/test_neon.yaml @@ -852,7 +852,7 @@ interactions: User-Agent: - AZURECLI/2.72.0 azsdk-python-core/1.31.0 Python/3.10.11 (Windows-10-10.0.26100-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/neonrg/providers/Neon.Postgres/organizations/Test-Neon-Org-Cli-IT/projects/withered-sea-55021972/branches/br-frosty-bird-a85qx3j8/neondatabases?api-version=2025-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/neonrg/providers/Neon.Postgres/organizations/Test-Neon-Org-Cli-IT/projects/withered-sea-55021972/branches/br-frosty-bird-a85qx3j8/neonDatabases?api-version=2025-03-01 response: body: string: '{"value":[{"properties":{"branchId":"br-frosty-bird-a85qx3j8","ownerName":"neondb_owner","entityId":"1643012","entityName":"neondb","createdAt":"Apr @@ -905,7 +905,7 @@ interactions: User-Agent: - AZURECLI/2.72.0 azsdk-python-core/1.31.0 Python/3.10.11 (Windows-10-10.0.26100-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/neonrg/providers/Neon.Postgres/organizations/Test-Neon-Org-Cli-IT/projects/withered-sea-55021972/branches/br-frosty-bird-a85qx3j8/neonroles?api-version=2025-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/neonrg/providers/Neon.Postgres/organizations/Test-Neon-Org-Cli-IT/projects/withered-sea-55021972/branches/br-frosty-bird-a85qx3j8/neonRoles?api-version=2025-03-01 response: body: string: '{"value":[{"properties":{"branchId":"br-frosty-bird-a85qx3j8","isSuperUser":false,"entityName":"neondb_owner","createdAt":"Apr