diff --git a/src/mixed-reality/HISTORY.rst b/src/mixed-reality/HISTORY.rst index dd2e6946c16..aa465b826c6 100644 --- a/src/mixed-reality/HISTORY.rst +++ b/src/mixed-reality/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.0.5 +++++++ +* Migrate to CodeGen V2 + 0.0.4 ++++++ * Migrate to track2 SDK diff --git a/src/mixed-reality/azext_mixed_reality/__init__.py b/src/mixed-reality/azext_mixed_reality/__init__.py index e690e6983af..ecb7c80b68a 100644 --- a/src/mixed-reality/azext_mixed_reality/__init__.py +++ b/src/mixed-reality/azext_mixed_reality/__init__.py @@ -17,6 +17,17 @@ def __init__(self, cli_ctx=None): def load_command_table(self, args): from .commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) load_command_table(self, args) return self.command_table diff --git a/src/mixed-reality/azext_mixed_reality/_client_factory.py b/src/mixed-reality/azext_mixed_reality/_client_factory.py deleted file mode 100644 index 173bf090462..00000000000 --- a/src/mixed-reality/azext_mixed_reality/_client_factory.py +++ /dev/null @@ -1,18 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def cf_mixedreality_cl(cli_ctx): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_mixed_reality.vendored_sdks.mixedreality import MixedRealityClient - return get_mgmt_service_client(cli_ctx, MixedRealityClient) - - -def cf_spatial_anchor_account(cli_ctx): - return cf_mixedreality_cl(cli_ctx).spatial_anchors_accounts - - -def cf_remote_rendering_account(cli_ctx): - return cf_mixedreality_cl(cli_ctx).remote_rendering_accounts diff --git a/src/mixed-reality/azext_mixed_reality/_help.py b/src/mixed-reality/azext_mixed_reality/_help.py index 081e23d4365..50f8d5125e2 100644 --- a/src/mixed-reality/azext_mixed_reality/_help.py +++ b/src/mixed-reality/azext_mixed_reality/_help.py @@ -4,282 +4,3 @@ # -------------------------------------------------------------------------------------------- from knack.help_files import helps - -helps['spatial-anchors-account'] = """ - type: group - short-summary: Manage spatial anchor account with mixed reality -""" - -helps['spatial-anchors-account list'] = """ - type: command - short-summary: List resources by resource group and list spatial anchors accounts by subscription. - examples: - - name: List spatial anchor accounts by resource group - text: |- - az spatial-anchors-account list --resource-group "MyResourceGroup" - - name: List spatial anchors accounts by subscription - text: |- - az spatial-anchors-account list -""" - -helps['spatial-anchors-account show'] = """ - type: command - short-summary: Retrieve a spatial anchors account. - examples: - - name: Get spatial anchors account - text: |- - az spatial-anchors-account show -n "MyAccount" --resource-group \ -"MyResourceGroup" -""" - -helps['spatial-anchors-account create'] = """ - type: command - short-summary: Create a spatial anchors account. - parameters: - - name: --sku - short-summary: The SKU associated with this account - long-summary: | - Usage: --sku name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - - name: --kind - short-summary: The kind of account, if supported - long-summary: | - Usage: --kind name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - examples: - - name: Create spatial anchor account - text: |- - az spatial-anchors-account create -n "MyAccount" --resource-group "MyResourceGroup" -""" - -helps['spatial-anchors-account update'] = """ - type: command - short-summary: Update a spatial anchors account. - parameters: - - name: --sku - short-summary: The SKU associated with this account - long-summary: | - Usage: --sku name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - - name: --kind - short-summary: The kind of account, if supported - long-summary: | - Usage: --kind name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - examples: - - name: Update spatial anchors account - text: |- - az spatial-anchors-account update -n "MyAccount" --resource-group \ -"MyResourceGroup" --location "eastus2euap" --tags hero="romeo" heroine="juliet" -""" - -helps['spatial-anchors-account delete'] = """ - type: command - short-summary: Delete a spatial anchors account. - examples: - - name: Delete spatial anchors account - text: |- - az spatial-anchors-account delete -n "MyAccount" --resource-group \ -"MyResourceGroup" -""" - -helps['spatial-anchors-account key show'] = """ - type: command - short-summary: List both of the 2 keys of a spatial anchors account. - examples: - - name: List spatial anchor account key - text: |- - az spatial-anchors-account key show -n "MyAccount" --resource-group \ -"MyResourceGroup" -""" - -helps['spatial-anchors-account key renew'] = """ - type: command - short-summary: Regenerate specified key of a spatial anchors account. - examples: - - name: Regenerate spatial anchors account keys - text: |- - az spatial-anchors-account key renew -n "MyAccount" -k primary \ ---resource-group "MyResourceGroup" -""" - -helps['remote-rendering-account'] = """ - type: group - short-summary: Manage remote rendering account with mixed reality -""" - -helps['remote-rendering-account list'] = """ - type: command - short-summary: List resources by resource group and list remote rendering accounts by subscription. - examples: - - name: List remote rendering accounts by resource group - text: |- - az remote-rendering-account list --resource-group "MyResourceGroup" - - name: List remote rendering accounts by subscription - text: |- - az remote-rendering-account list -""" - -helps['remote-rendering-account show'] = """ - type: command - short-summary: Retrieve a remote rendering account. - examples: - - name: Get remote rendering account - text: |- - az remote-rendering-account show -n "MyAccount" --resource-group \ -"MyResourceGroup" -""" - -helps['remote-rendering-account create'] = """ - type: command - short-summary: Create a remote rendering account. - parameters: - - name: --sku - short-summary: The SKU associated with this account - long-summary: | - Usage: --sku name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - - name: --kind - short-summary: The kind of account, if supported - long-summary: | - Usage: --kind name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - examples: - - name: Create remote rendering account - text: |- - az remote-rendering-account create -n "MyAccount" --location "eastus2euap" \ ---resource-group "MyResourceGroup" -""" - -helps['remote-rendering-account update'] = """ - type: command - short-summary: Update a remote rendering account. - parameters: - - name: --sku - short-summary: The SKU associated with this account - long-summary: | - Usage: --sku name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - - name: --kind - short-summary: The kind of account, if supported - long-summary: | - Usage: --kind name=XX tier=XX size=XX family=XX capacity=XX - - name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code - tier: This field is required to be implemented by the resource provider if the service has more than one \ -tier, but is not required on a PUT. - size: The SKU size. When the name field is the combination of tier and some other value, this would be the \ -standalone code. - family: If the service has different generations of hardware, for the same SKU, then that can be captured \ -here. - capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in \ -is not possible for the resource this may be omitted. - examples: - - name: Update remote rendering account - text: |- - az remote-rendering-account update -n "MyAccount" --tags hero="romeo" heroine="juliet" \ ---resource-group "MyResourceGroup" -""" - -helps['remote-rendering-account delete'] = """ - type: command - short-summary: Delete a remote rendering account. - examples: - - name: Delete remote rendering account - text: |- - az remote-rendering-account delete -n "MyAccount" --resource-group \ -"MyResourceGroup" -""" - -helps['remote-rendering-account key show'] = """ - type: command - short-summary: List both of the 2 keys of a remote rendering account. - examples: - - name: List remote rendering account key - text: |- - az remote-rendering-account key show -n "MyAccount" --resource-group \ -"MyResourceGroup" -""" - -helps['remote-rendering-account key renew'] = """ - type: command - short-summary: Regenerate specified key of a remote rendering account. - examples: - - name: Regenerate remote rendering account keys - text: |- - az remote-rendering-account key renew -n "MyAccount" -k primary \ ---resource-group "MyResourceGroup" -""" - -helps['spatial-anchors-account key'] = """ - type: group - short-summary: Manage developer keys of a spatial anchors account. -""" - -helps['remote-rendering-account key'] = """ - type: group - short-summary: Manage developer keys of a remote rendering account. -""" diff --git a/src/mixed-reality/azext_mixed_reality/_params.py b/src/mixed-reality/azext_mixed_reality/_params.py index 9deecaa377b..24951195f7f 100644 --- a/src/mixed-reality/azext_mixed_reality/_params.py +++ b/src/mixed-reality/azext_mixed_reality/_params.py @@ -3,45 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from knack.arguments import CLIArgumentType -from azure.cli.core.commands.validators import get_default_location_from_resource_group -from azure.cli.core.commands.parameters import ( - resource_group_name_type, - get_location_type, - get_enum_type, - tags_type, - name_type -) -from azext_mixed_reality.action import AddSku - -account_key_type = CLIArgumentType( - help='Key to be regenerated.', - arg_type=get_enum_type(['primary', 'secondary'], default='primary'), - options_list=['--key', '-k'], -) - def load_arguments(self, _): - with self.argument_context('spatial-anchors-account') as c: - c.argument('resource_group_name', arg_type=resource_group_name_type) - c.argument('account_name', type=str, help='Name of an mixed reality account.', arg_type=name_type, id_part='name') # pylint: disable=line-too-long - c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) # pylint: disable=line-too-long - c.argument('tags', arg_type=tags_type) - c.argument('sku', action=AddSku, nargs='+', help='The SKU associated with this account') - c.argument('kind', action=AddSku, nargs='+', help='The kind of account, if supported') - c.argument('storage_account_name', type=str, help='The name of the storage account associated with this accountId') # pylint: disable=line-too-long - - with self.argument_context('spatial-anchors-account key renew') as c: - c.argument('key', arg_type=account_key_type) - - with self.argument_context('remote-rendering-account') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Name of an mixed reality account.', arg_type=name_type, id_part='name') # pylint: disable=line-too-long - c.argument('tags', arg_type=tags_type) - c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) # pylint: disable=line-too-long - c.argument('sku', action=AddSku, nargs='+', help='The SKU associated with this account') - c.argument('kind', action=AddSku, nargs='+', help='The kind of account, if supported') - c.argument('storage_account_name', type=str, help='The name of the storage account associated with this accountId') # pylint: disable=line-too-long - - with self.argument_context('remote-rendering-account key renew') as c: - c.argument('key', arg_type=account_key_type) + pass diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/__init__.py b/src/mixed-reality/azext_mixed_reality/aaz/__init__.py similarity index 84% rename from src/mixed-reality/azext_mixed_reality/vendored_sdks/__init__.py rename to src/mixed-reality/azext_mixed_reality/aaz/__init__.py index 7183870ee56..5757aea3175 100644 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/__init__.py +++ b/src/mixed-reality/azext_mixed_reality/aaz/__init__.py @@ -1,6 +1,6 @@ # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools # -------------------------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_version.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/__init__.py similarity index 58% rename from src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_version.py rename to src/mixed-reality/azext_mixed_reality/aaz/latest/__init__.py index 8dbbc07e356..5757aea3175 100644 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_version.py +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/__init__.py @@ -1,9 +1,6 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.0.1" +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/__cmd_group.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/__cmd_group.py new file mode 100644 index 00000000000..e2615296cc6 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "remote-rendering-account", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage remote rendering account with mixed reality. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/__init__.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_create.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_create.py new file mode 100644 index 00000000000..0b54b2cd1ad --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_create.py @@ -0,0 +1,442 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "remote-rendering-account create", + is_preview=True, +) +class Create(AAZCommand): + """Create a Remote Rendering Account. + + :example: Create remote rendering account + az remote-rendering-account create -n "MyAccount" --location "eastus2euap" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/remoterenderingaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.storage_account_name = AAZStrArg( + options=["--storage-account-name"], + arg_group="Properties", + help="The name of the storage account associated with this accountId", + ) + + # define Arg Group "RemoteRenderingAccount" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="RemoteRenderingAccount", + help="The identity associated with this account", + ) + cls._build_args_identity_create(_args_schema.identity) + _args_schema.kind = AAZObjectArg( + options=["--kind"], + arg_group="RemoteRenderingAccount", + help="The kind of account, if supported", + ) + cls._build_args_sku_create(_args_schema.kind) + _args_schema.location = AAZResourceLocationArg( + arg_group="RemoteRenderingAccount", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.sku = AAZObjectArg( + options=["--sku"], + arg_group="RemoteRenderingAccount", + help="The sku associated with this account", + ) + cls._build_args_sku_create(_args_schema.sku) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="RemoteRenderingAccount", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + _args_identity_create = None + + @classmethod + def _build_args_identity_create(cls, _schema): + if cls._args_identity_create is not None: + _schema.type = cls._args_identity_create.type + return + + cls._args_identity_create = AAZObjectArg() + + identity_create = cls._args_identity_create + identity_create.type = AAZStrArg( + options=["type"], + help="The identity type.", + enum={"SystemAssigned": "SystemAssigned"}, + ) + + _schema.type = cls._args_identity_create.type + + _args_sku_create = None + + @classmethod + def _build_args_sku_create(cls, _schema): + if cls._args_sku_create is not None: + _schema.capacity = cls._args_sku_create.capacity + _schema.family = cls._args_sku_create.family + _schema.name = cls._args_sku_create.name + _schema.size = cls._args_sku_create.size + _schema.tier = cls._args_sku_create.tier + return + + cls._args_sku_create = AAZObjectArg() + + sku_create = cls._args_sku_create + sku_create.capacity = AAZIntArg( + options=["capacity"], + help="If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.", + ) + sku_create.family = AAZStrArg( + options=["family"], + help="If the service has different generations of hardware, for the same SKU, then that can be captured here.", + ) + sku_create.name = AAZStrArg( + options=["name"], + help="The name of the SKU. Ex - P3. It is typically a letter+number code", + required=True, + ) + sku_create.size = AAZStrArg( + options=["size"], + help="The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. ", + ) + sku_create.tier = AAZStrArg( + options=["tier"], + help="This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.", + enum={"Basic": "Basic", "Free": "Free", "Premium": "Premium", "Standard": "Standard"}, + ) + + _schema.capacity = cls._args_sku_create.capacity + _schema.family = cls._args_sku_create.family + _schema.name = cls._args_sku_create.name + _schema.size = cls._args_sku_create.size + _schema.tier = cls._args_sku_create.tier + + def _execute_operations(self): + self.pre_operations() + self.RemoteRenderingAccountsCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class RemoteRenderingAccountsCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _CreateHelper._build_schema_identity_create(_builder.set_prop("identity", AAZObjectType, ".identity")) + _CreateHelper._build_schema_sku_create(_builder.set_prop("kind", AAZObjectType, ".kind")) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _CreateHelper._build_schema_sku_create(_builder.set_prop("sku", AAZObjectType, ".sku")) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("storageAccountName", AAZStrType, ".storage_account_name") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.identity = AAZObjectType() + _CreateHelper._build_schema_identity_read(_schema_on_200_201.identity) + _schema_on_200_201.kind = AAZObjectType() + _CreateHelper._build_schema_sku_read(_schema_on_200_201.kind) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.plan = AAZObjectType() + _CreateHelper._build_schema_identity_read(_schema_on_200_201.plan) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _CreateHelper._build_schema_sku_read(_schema_on_200_201.sku) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + @classmethod + def _build_schema_identity_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("type", AAZStrType, ".type") + + @classmethod + def _build_schema_sku_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("capacity", AAZIntType, ".capacity") + _builder.set_prop("family", AAZStrType, ".family") + _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("size", AAZStrType, ".size") + _builder.set_prop("tier", AAZStrType, ".tier") + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["Create"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_delete.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_delete.py new file mode 100644 index 00000000000..080cc2a90b4 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_delete.py @@ -0,0 +1,144 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "remote-rendering-account delete", + is_preview=True, +) +class Delete(AAZCommand): + """Delete a Remote Rendering Account. + + :example: Delete remote rendering account + az remote-rendering-account delete -n "MyAccount" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/remoterenderingaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.RemoteRenderingAccountsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class RemoteRenderingAccountsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_list.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_list.py new file mode 100644 index 00000000000..b88dd0ed644 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_list.py @@ -0,0 +1,440 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "remote-rendering-account list", + is_preview=True, +) +class List(AAZCommand): + """List Remote Rendering Accounts by Subscription + + :example: List remote rendering accounts by resource group + az remote-rendering-account list --resource-group "MyResourceGroup" + + :example: List remote rendering accounts by subscription + az remote-rendering-account list + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.mixedreality/remoterenderingaccounts", "2021-03-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/remoterenderingaccounts", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + 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 + if condition_0: + self.RemoteRenderingAccountsListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.RemoteRenderingAccountsListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class RemoteRenderingAccountsListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.identity) + _element.kind = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.kind) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.plan) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.sku) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class RemoteRenderingAccountsListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.identity) + _element.kind = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.kind) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.plan) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.sku) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["List"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_show.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_show.py new file mode 100644 index 00000000000..0487ca86a0c --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_show.py @@ -0,0 +1,290 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "remote-rendering-account show", + is_preview=True, +) +class Show(AAZCommand): + """Get a Remote Rendering Account. + + :example: Get remote rendering account + az remote-rendering-account show -n "MyAccount" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/remoterenderingaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.RemoteRenderingAccountsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class RemoteRenderingAccountsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _ShowHelper._build_schema_identity_read(_schema_on_200.identity) + _schema_on_200.kind = AAZObjectType() + _ShowHelper._build_schema_sku_read(_schema_on_200.kind) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.plan = AAZObjectType() + _ShowHelper._build_schema_identity_read(_schema_on_200.plan) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _ShowHelper._build_schema_sku_read(_schema_on_200.sku) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["Show"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_update.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_update.py new file mode 100644 index 00000000000..a60a74529a1 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/_update.py @@ -0,0 +1,434 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "remote-rendering-account update", + is_preview=True, +) +class Update(AAZCommand): + """Update a Remote Rendering Account. + + :example: Update remote rendering account + az remote-rendering-account update -n "MyAccount" --tags hero="romeo" heroine="juliet" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/remoterenderingaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.storage_account_name = AAZStrArg( + options=["--storage-account-name"], + arg_group="Properties", + help="The name of the storage account associated with this accountId", + ) + + # define Arg Group "RemoteRenderingAccount" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="RemoteRenderingAccount", + help="The identity associated with this account", + ) + cls._build_args_identity_update(_args_schema.identity) + _args_schema.kind = AAZObjectArg( + options=["--kind"], + arg_group="RemoteRenderingAccount", + help="The kind of account, if supported", + ) + cls._build_args_sku_update(_args_schema.kind) + _args_schema.sku = AAZObjectArg( + options=["--sku"], + arg_group="RemoteRenderingAccount", + help="The sku associated with this account", + ) + cls._build_args_sku_update(_args_schema.sku) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="RemoteRenderingAccount", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + _args_identity_update = None + + @classmethod + def _build_args_identity_update(cls, _schema): + if cls._args_identity_update is not None: + _schema.type = cls._args_identity_update.type + return + + cls._args_identity_update = AAZObjectArg() + + identity_update = cls._args_identity_update + identity_update.type = AAZStrArg( + options=["type"], + help="The identity type.", + enum={"SystemAssigned": "SystemAssigned"}, + ) + + _schema.type = cls._args_identity_update.type + + _args_sku_update = None + + @classmethod + def _build_args_sku_update(cls, _schema): + if cls._args_sku_update is not None: + _schema.capacity = cls._args_sku_update.capacity + _schema.family = cls._args_sku_update.family + _schema.name = cls._args_sku_update.name + _schema.size = cls._args_sku_update.size + _schema.tier = cls._args_sku_update.tier + return + + cls._args_sku_update = AAZObjectArg() + + sku_update = cls._args_sku_update + sku_update.capacity = AAZIntArg( + options=["capacity"], + help="If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.", + ) + sku_update.family = AAZStrArg( + options=["family"], + help="If the service has different generations of hardware, for the same SKU, then that can be captured here.", + ) + sku_update.name = AAZStrArg( + options=["name"], + help="The name of the SKU. Ex - P3. It is typically a letter+number code", + required=True, + ) + sku_update.size = AAZStrArg( + options=["size"], + help="The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. ", + ) + sku_update.tier = AAZStrArg( + options=["tier"], + help="This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.", + enum={"Basic": "Basic", "Free": "Free", "Premium": "Premium", "Standard": "Standard"}, + ) + + _schema.capacity = cls._args_sku_update.capacity + _schema.family = cls._args_sku_update.family + _schema.name = cls._args_sku_update.name + _schema.size = cls._args_sku_update.size + _schema.tier = cls._args_sku_update.tier + + def _execute_operations(self): + self.pre_operations() + self.RemoteRenderingAccountsUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class RemoteRenderingAccountsUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "PATCH" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _UpdateHelper._build_schema_identity_update(_builder.set_prop("identity", AAZObjectType, ".identity")) + _UpdateHelper._build_schema_sku_update(_builder.set_prop("kind", AAZObjectType, ".kind")) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _UpdateHelper._build_schema_sku_update(_builder.set_prop("sku", AAZObjectType, ".sku")) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("storageAccountName", AAZStrType, ".storage_account_name") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _UpdateHelper._build_schema_identity_read(_schema_on_200.identity) + _schema_on_200.kind = AAZObjectType() + _UpdateHelper._build_schema_sku_read(_schema_on_200.kind) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.plan = AAZObjectType() + _UpdateHelper._build_schema_identity_read(_schema_on_200.plan) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _UpdateHelper._build_schema_sku_read(_schema_on_200.sku) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_identity_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("type", AAZStrType, ".type") + + @classmethod + def _build_schema_sku_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("capacity", AAZIntType, ".capacity") + _builder.set_prop("family", AAZStrType, ".family") + _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("size", AAZStrType, ".size") + _builder.set_prop("tier", AAZStrType, ".tier") + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["Update"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/__cmd_group.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/__cmd_group.py new file mode 100644 index 00000000000..cdace4dcc9c --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "remote-rendering-account key", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage developer keys of a remote rendering account. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/__init__.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/__init__.py similarity index 51% rename from src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/__init__.py rename to src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/__init__.py index e254a9f5f57..1a68789fce7 100644 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/__init__.py +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/__init__.py @@ -1,10 +1,13 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- -from ._mixed_reality_client import MixedRealityClient -__all__ = ['MixedRealityClient'] +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._renew import * +from ._show import * diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/_renew.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/_renew.py new file mode 100644 index 00000000000..ee87ee99b64 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/_renew.py @@ -0,0 +1,203 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "remote-rendering-account key renew", + is_preview=True, +) +class Renew(AAZCommand): + """Regenerate specified Key of a Remote Rendering Account + + :example: Regenerate remote rendering account keys + az remote-rendering-account key renew -n "MyAccount" -k primary --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/remoterenderingaccounts/{}/regeneratekeys", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Regenerate" + + _args_schema = cls._args_schema + _args_schema.serial = AAZIntArg( + options=["--serial"], + arg_group="Regenerate", + help="Serial of key to be regenerated", + default=1, + enum={"1": 1, "2": 2}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.RemoteRenderingAccountsRegenerateKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class RemoteRenderingAccountsRegenerateKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("serial", AAZIntType, ".serial") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + return cls._schema_on_200 + + +class _RenewHelper: + """Helper class for Renew""" + + +__all__ = ["Renew"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/_show.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/_show.py new file mode 100644 index 00000000000..99865335f9d --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/remote_rendering_account/key/_show.py @@ -0,0 +1,178 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "remote-rendering-account key show", + is_preview=True, +) +class Show(AAZCommand): + """List Both of the 2 Keys of a Remote Rendering Account + + :example: List remote rendering account key + az remote-rendering-account key show -n "MyAccount" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/remoterenderingaccounts/{}/listkeys", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.RemoteRenderingAccountsListKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class RemoteRenderingAccountsListKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/__cmd_group.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/__cmd_group.py new file mode 100644 index 00000000000..ff02fc03957 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "spatial-anchors-account", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage spatial anchor account with mixed reality. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/__init__.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_create.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_create.py new file mode 100644 index 00000000000..1080f7163ca --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_create.py @@ -0,0 +1,435 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "spatial-anchors-account create", + is_preview=True, +) +class Create(AAZCommand): + """Create a Spatial Anchors Account. + + :example: Create spatial anchor account + az spatial-anchors-account create -n "MyAccount" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/spatialanchorsaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.storage_account_name = AAZStrArg( + options=["--storage-account-name"], + arg_group="Properties", + help="The name of the storage account associated with this accountId", + ) + + # define Arg Group "SpatialAnchorsAccount" + + _args_schema = cls._args_schema + _args_schema.kind = AAZObjectArg( + options=["--kind"], + arg_group="SpatialAnchorsAccount", + help="The kind of account, if supported", + ) + cls._build_args_sku_create(_args_schema.kind) + _args_schema.location = AAZResourceLocationArg( + arg_group="SpatialAnchorsAccount", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.sku = AAZObjectArg( + options=["--sku"], + arg_group="SpatialAnchorsAccount", + help="The sku associated with this account", + ) + cls._build_args_sku_create(_args_schema.sku) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="SpatialAnchorsAccount", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + _args_identity_create = None + + @classmethod + def _build_args_identity_create(cls, _schema): + if cls._args_identity_create is not None: + _schema.type = cls._args_identity_create.type + return + + cls._args_identity_create = AAZObjectArg() + + identity_create = cls._args_identity_create + identity_create.type = AAZStrArg( + options=["type"], + help="The identity type.", + enum={"SystemAssigned": "SystemAssigned"}, + ) + + _schema.type = cls._args_identity_create.type + + _args_sku_create = None + + @classmethod + def _build_args_sku_create(cls, _schema): + if cls._args_sku_create is not None: + _schema.capacity = cls._args_sku_create.capacity + _schema.family = cls._args_sku_create.family + _schema.name = cls._args_sku_create.name + _schema.size = cls._args_sku_create.size + _schema.tier = cls._args_sku_create.tier + return + + cls._args_sku_create = AAZObjectArg() + + sku_create = cls._args_sku_create + sku_create.capacity = AAZIntArg( + options=["capacity"], + help="If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.", + ) + sku_create.family = AAZStrArg( + options=["family"], + help="If the service has different generations of hardware, for the same SKU, then that can be captured here.", + ) + sku_create.name = AAZStrArg( + options=["name"], + help="The name of the SKU. Ex - P3. It is typically a letter+number code", + required=True, + ) + sku_create.size = AAZStrArg( + options=["size"], + help="The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. ", + ) + sku_create.tier = AAZStrArg( + options=["tier"], + help="This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.", + enum={"Basic": "Basic", "Free": "Free", "Premium": "Premium", "Standard": "Standard"}, + ) + + _schema.capacity = cls._args_sku_create.capacity + _schema.family = cls._args_sku_create.family + _schema.name = cls._args_sku_create.name + _schema.size = cls._args_sku_create.size + _schema.tier = cls._args_sku_create.tier + + def _execute_operations(self): + self.pre_operations() + self.SpatialAnchorsAccountsCreate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SpatialAnchorsAccountsCreate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _CreateHelper._build_schema_sku_create(_builder.set_prop("kind", AAZObjectType, ".kind")) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _CreateHelper._build_schema_sku_create(_builder.set_prop("sku", AAZObjectType, ".sku")) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("storageAccountName", AAZStrType, ".storage_account_name") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.identity = AAZObjectType() + _CreateHelper._build_schema_identity_read(_schema_on_200_201.identity) + _schema_on_200_201.kind = AAZObjectType() + _CreateHelper._build_schema_sku_read(_schema_on_200_201.kind) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.plan = AAZObjectType() + _CreateHelper._build_schema_identity_read(_schema_on_200_201.plan) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _CreateHelper._build_schema_sku_read(_schema_on_200_201.sku) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + @classmethod + def _build_schema_identity_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("type", AAZStrType, ".type") + + @classmethod + def _build_schema_sku_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("capacity", AAZIntType, ".capacity") + _builder.set_prop("family", AAZStrType, ".family") + _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("size", AAZStrType, ".size") + _builder.set_prop("tier", AAZStrType, ".tier") + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["Create"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_delete.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_delete.py new file mode 100644 index 00000000000..53e032e5ad8 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_delete.py @@ -0,0 +1,144 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "spatial-anchors-account delete", + is_preview=True, +) +class Delete(AAZCommand): + """Delete a Spatial Anchors Account. + + :example: Delete spatial anchors account + az spatial-anchors-account delete -n "MyAccount" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/spatialanchorsaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SpatialAnchorsAccountsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SpatialAnchorsAccountsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_list.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_list.py new file mode 100644 index 00000000000..268405f3dd5 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_list.py @@ -0,0 +1,440 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "spatial-anchors-account list", + is_preview=True, +) +class List(AAZCommand): + """List Spatial Anchors Accounts by Subscription + + :example: List spatial anchor accounts by resource group + az spatial-anchors-account list --resource-group "MyResourceGroup" + + :example: List spatial anchors accounts by subscription + az spatial-anchors-account list + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.mixedreality/spatialanchorsaccounts", "2021-03-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/spatialanchorsaccounts", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + 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 + if condition_0: + self.SpatialAnchorsAccountsListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.SpatialAnchorsAccountsListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class SpatialAnchorsAccountsListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.identity) + _element.kind = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.kind) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.plan) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.sku) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class SpatialAnchorsAccountsListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.identity) + _element.kind = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.kind) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.plan = AAZObjectType() + _ListHelper._build_schema_identity_read(_element.plan) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.sku = AAZObjectType() + _ListHelper._build_schema_sku_read(_element.sku) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["List"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_show.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_show.py new file mode 100644 index 00000000000..ad976a15325 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_show.py @@ -0,0 +1,290 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "spatial-anchors-account show", + is_preview=True, +) +class Show(AAZCommand): + """Get a Spatial Anchors Account. + + :example: Get spatial anchors account + az spatial-anchors-account show -n "MyAccount" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/spatialanchorsaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SpatialAnchorsAccountsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SpatialAnchorsAccountsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _ShowHelper._build_schema_identity_read(_schema_on_200.identity) + _schema_on_200.kind = AAZObjectType() + _ShowHelper._build_schema_sku_read(_schema_on_200.kind) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.plan = AAZObjectType() + _ShowHelper._build_schema_identity_read(_schema_on_200.plan) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _ShowHelper._build_schema_sku_read(_schema_on_200.sku) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["Show"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_update.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_update.py new file mode 100644 index 00000000000..f00a3d97f5b --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/_update.py @@ -0,0 +1,427 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "spatial-anchors-account update", + is_preview=True, +) +class Update(AAZCommand): + """Update a Spatial Anchors Account. + + :example: Update spatial anchors account + az spatial-anchors-account update -n "MyAccount" --resource-group "MyResourceGroup" --location "eastus2euap" --tags hero="romeo" heroine="juliet" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/spatialanchorsaccounts/{}", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.storage_account_name = AAZStrArg( + options=["--storage-account-name"], + arg_group="Properties", + help="The name of the storage account associated with this accountId", + ) + + # define Arg Group "SpatialAnchorsAccount" + + _args_schema = cls._args_schema + _args_schema.kind = AAZObjectArg( + options=["--kind"], + arg_group="SpatialAnchorsAccount", + help="The kind of account, if supported", + ) + cls._build_args_sku_update(_args_schema.kind) + _args_schema.sku = AAZObjectArg( + options=["--sku"], + arg_group="SpatialAnchorsAccount", + help="The sku associated with this account", + ) + cls._build_args_sku_update(_args_schema.sku) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="SpatialAnchorsAccount", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + _args_identity_update = None + + @classmethod + def _build_args_identity_update(cls, _schema): + if cls._args_identity_update is not None: + _schema.type = cls._args_identity_update.type + return + + cls._args_identity_update = AAZObjectArg() + + identity_update = cls._args_identity_update + identity_update.type = AAZStrArg( + options=["type"], + help="The identity type.", + enum={"SystemAssigned": "SystemAssigned"}, + ) + + _schema.type = cls._args_identity_update.type + + _args_sku_update = None + + @classmethod + def _build_args_sku_update(cls, _schema): + if cls._args_sku_update is not None: + _schema.capacity = cls._args_sku_update.capacity + _schema.family = cls._args_sku_update.family + _schema.name = cls._args_sku_update.name + _schema.size = cls._args_sku_update.size + _schema.tier = cls._args_sku_update.tier + return + + cls._args_sku_update = AAZObjectArg() + + sku_update = cls._args_sku_update + sku_update.capacity = AAZIntArg( + options=["capacity"], + help="If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.", + ) + sku_update.family = AAZStrArg( + options=["family"], + help="If the service has different generations of hardware, for the same SKU, then that can be captured here.", + ) + sku_update.name = AAZStrArg( + options=["name"], + help="The name of the SKU. Ex - P3. It is typically a letter+number code", + required=True, + ) + sku_update.size = AAZStrArg( + options=["size"], + help="The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. ", + ) + sku_update.tier = AAZStrArg( + options=["tier"], + help="This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.", + enum={"Basic": "Basic", "Free": "Free", "Premium": "Premium", "Standard": "Standard"}, + ) + + _schema.capacity = cls._args_sku_update.capacity + _schema.family = cls._args_sku_update.family + _schema.name = cls._args_sku_update.name + _schema.size = cls._args_sku_update.size + _schema.tier = cls._args_sku_update.tier + + def _execute_operations(self): + self.pre_operations() + self.SpatialAnchorsAccountsUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SpatialAnchorsAccountsUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", + **self.url_parameters + ) + + @property + def method(self): + return "PATCH" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _UpdateHelper._build_schema_sku_update(_builder.set_prop("kind", AAZObjectType, ".kind")) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _UpdateHelper._build_schema_sku_update(_builder.set_prop("sku", AAZObjectType, ".sku")) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("storageAccountName", AAZStrType, ".storage_account_name") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _UpdateHelper._build_schema_identity_read(_schema_on_200.identity) + _schema_on_200.kind = AAZObjectType() + _UpdateHelper._build_schema_sku_read(_schema_on_200.kind) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.plan = AAZObjectType() + _UpdateHelper._build_schema_identity_read(_schema_on_200.plan) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _UpdateHelper._build_schema_sku_read(_schema_on_200.sku) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.account_domain = AAZStrType( + serialized_name="accountDomain", + flags={"read_only": True}, + ) + properties.account_id = AAZStrType( + serialized_name="accountId", + flags={"read_only": True}, + ) + properties.storage_account_name = AAZStrType( + serialized_name="storageAccountName", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_identity_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("type", AAZStrType, ".type") + + @classmethod + def _build_schema_sku_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("capacity", AAZIntType, ".capacity") + _builder.set_prop("family", AAZStrType, ".family") + _builder.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("size", AAZStrType, ".size") + _builder.set_prop("tier", AAZStrType, ".tier") + + _schema_identity_read = None + + @classmethod + def _build_schema_identity_read(cls, _schema): + if cls._schema_identity_read is not None: + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + return + + cls._schema_identity_read = _schema_identity_read = AAZObjectType() + + identity_read = _schema_identity_read + identity_read.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity_read.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity_read.type = AAZStrType() + + _schema.principal_id = cls._schema_identity_read.principal_id + _schema.tenant_id = cls._schema_identity_read.tenant_id + _schema.type = cls._schema_identity_read.type + + _schema_sku_read = None + + @classmethod + def _build_schema_sku_read(cls, _schema): + if cls._schema_sku_read is not None: + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + return + + cls._schema_sku_read = _schema_sku_read = AAZObjectType() + + sku_read = _schema_sku_read + sku_read.capacity = AAZIntType() + sku_read.family = AAZStrType() + sku_read.name = AAZStrType( + flags={"required": True}, + ) + sku_read.size = AAZStrType() + sku_read.tier = AAZStrType() + + _schema.capacity = cls._schema_sku_read.capacity + _schema.family = cls._schema_sku_read.family + _schema.name = cls._schema_sku_read.name + _schema.size = cls._schema_sku_read.size + _schema.tier = cls._schema_sku_read.tier + + +__all__ = ["Update"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/__cmd_group.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/__cmd_group.py new file mode 100644 index 00000000000..3b468143657 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "spatial-anchors-account key", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage developer keys of a spatial anchors account. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/__init__.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/__init__.py new file mode 100644 index 00000000000..1a68789fce7 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/__init__.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._renew import * +from ._show import * diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/_renew.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/_renew.py new file mode 100644 index 00000000000..ad1499dbaaa --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/_renew.py @@ -0,0 +1,203 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "spatial-anchors-account key renew", + is_preview=True, +) +class Renew(AAZCommand): + """Regenerate specified Key of a Spatial Anchors Account + + :example: Regenerate spatial anchors account keys + az spatial-anchors-account key renew -n "MyAccount" -k primary --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/spatialanchorsaccounts/{}/regeneratekeys", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Regenerate" + + _args_schema = cls._args_schema + _args_schema.serial = AAZIntArg( + options=["--serial"], + arg_group="Regenerate", + help="Serial of key to be regenerated", + default=1, + enum={"1": 1, "2": 2}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SpatialAnchorsAccountsRegenerateKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SpatialAnchorsAccountsRegenerateKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("serial", AAZIntType, ".serial") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + return cls._schema_on_200 + + +class _RenewHelper: + """Helper class for Renew""" + + +__all__ = ["Renew"] diff --git a/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/_show.py b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/_show.py new file mode 100644 index 00000000000..3c2ecb39848 --- /dev/null +++ b/src/mixed-reality/azext_mixed_reality/aaz/latest/spatial_anchors_account/key/_show.py @@ -0,0 +1,178 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "spatial-anchors-account key show", + is_preview=True, +) +class Show(AAZCommand): + """List Both of the 2 Keys of a Spatial Anchors Account + + :example: List spatial anchor account key + az spatial-anchors-account key show -n "MyAccount" --resource-group "MyResourceGroup" + """ + + _aaz_info = { + "version": "2021-03-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mixedreality/spatialanchorsaccounts/{}/listkeys", "2021-03-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="Name of an Mixed Reality Account.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[-\w\._\(\)]+$", + max_length=90, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SpatialAnchorsAccountsListKeys(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SpatialAnchorsAccountsListKeys(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "accountName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-03-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.primary_key = AAZStrType( + serialized_name="primaryKey", + flags={"read_only": True}, + ) + _schema_on_200.secondary_key = AAZStrType( + serialized_name="secondaryKey", + flags={"read_only": True}, + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mixed-reality/azext_mixed_reality/action.py b/src/mixed-reality/azext_mixed_reality/action.py deleted file mode 100644 index 6597db6e2d0..00000000000 --- a/src/mixed-reality/azext_mixed_reality/action.py +++ /dev/null @@ -1,47 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=protected-access - -import argparse -from collections import defaultdict -from azure.cli.core.azclierror import ArgumentUsageError, InvalidArgumentValueError - - -class AddSku(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.sku = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise ArgumentUsageError('usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'name': - d['name'] = v[0] - elif kl == 'tier': - d['tier'] = v[0] - elif kl == 'size': - d['size'] = v[0] - elif kl == 'family': - d['family'] = v[0] - elif kl == 'capacity': - d['capacity'] = v[0] - else: - raise InvalidArgumentValueError('Unsupported Key {} is provided for parameter sku. All possible keys ' - 'are: name, tier, size, family, capacity'.format(k)) - return d diff --git a/src/mixed-reality/azext_mixed_reality/azext_metadata.json b/src/mixed-reality/azext_mixed_reality/azext_metadata.json index 30fdaf614ee..7923ce3c67b 100644 --- a/src/mixed-reality/azext_mixed_reality/azext_metadata.json +++ b/src/mixed-reality/azext_mixed_reality/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.15.0" + "azext.minCliCoreVersion": "2.49.0" } \ No newline at end of file diff --git a/src/mixed-reality/azext_mixed_reality/commands.py b/src/mixed-reality/azext_mixed_reality/commands.py index 0f4c81c8b14..9015fd00cc1 100644 --- a/src/mixed-reality/azext_mixed_reality/commands.py +++ b/src/mixed-reality/azext_mixed_reality/commands.py @@ -3,41 +3,16 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure.cli.core.commands import CliCommandType -from ._client_factory import cf_spatial_anchor_account, cf_remote_rendering_account - # pylint: disable=line-too-long def load_command_table(self, _): - spatial_anchor_account = CliCommandType( - operations_tmpl='azext_mixed_reality.vendored_sdks.mixedreality.operations._spatial_anchors_accounts_operations#SpatialAnchorsAccountsOperations.{}', - client_factory=cf_spatial_anchor_account - ) - - remote_rendering_account = CliCommandType( - operations_tmpl='azext_mixed_reality.vendored_sdks.mixedreality.operations._remote_rendering_accounts_operations#RemoteRenderingAccountsOperations.{}', - client_factory=cf_remote_rendering_account - ) - - with self.command_group('spatial-anchors-account', spatial_anchor_account, is_preview=True) as g: - g.custom_command('create', 'spatial_anchor_account_create') - g.custom_command('list', 'spatial_anchor_account_list') - g.custom_show_command('show', 'spatial_anchor_account_show') - g.generic_update_command('update', setter_name='update', custom_func_name='spatial_anchor_account_update', setter_arg_name='spatial_anchors_account') - g.custom_command('delete', 'spatial_anchor_account_delete') - - with self.command_group('spatial-anchors-account key', spatial_anchor_account, is_preview=True) as g: - g.custom_show_command('show', 'spatial_anchor_account_list_key') - g.custom_command('renew', 'spatial_anchor_account_regenerate_key') - - with self.command_group('remote-rendering-account', remote_rendering_account, is_preview=True) as g: - g.custom_command('create', 'remote_rendering_account_create') - g.custom_command('update', 'remote_rendering_account_update') - g.custom_command('list', 'remote_rendering_account_list') - g.custom_show_command('show', 'remote_rendering_account_show') - g.custom_command('delete', 'remote_rendering_account_delete') + with self.command_group('spatial-anchors-account'): + from .custom import SpatialAnchorsCreate, SpatialAnchorsKeyRenew + self.command_table['spatial-anchors-account create'] = SpatialAnchorsCreate(loader=self) + self.command_table['spatial-anchors-account key renew'] = SpatialAnchorsKeyRenew(loader=self) - with self.command_group('remote-rendering-account key', remote_rendering_account, is_preview=True) as g: - g.custom_show_command('show', 'remote_rendering_account_list_key') - g.custom_command('renew', 'remote_rendering_account_regenerate_key') + with self.command_group('remote-rendering-account'): + from .custom import RemoteRenderingCreate, RemoteRenderingKeyRenew + self.command_table['remote-rendering-account create'] = RemoteRenderingCreate(loader=self) + self.command_table['remote-rendering-account key renew'] = RemoteRenderingKeyRenew(loader=self) diff --git a/src/mixed-reality/azext_mixed_reality/custom.py b/src/mixed-reality/azext_mixed_reality/custom.py index 5180a038514..c315a2356c5 100644 --- a/src/mixed-reality/azext_mixed_reality/custom.py +++ b/src/mixed-reality/azext_mixed_reality/custom.py @@ -7,171 +7,75 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -import json -from ._client_factory import cf_spatial_anchor_account, cf_remote_rendering_account - - -def spatial_anchor_account_list(cmd, - resource_group_name=None): - client = cf_spatial_anchor_account(cmd.cli_ctx) - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def spatial_anchor_account_show(cmd, - resource_group_name, - account_name): - client = cf_spatial_anchor_account(cmd.cli_ctx) - return client.get(resource_group_name=resource_group_name, - account_name=account_name) - - -def spatial_anchor_account_create(cmd, - resource_group_name, - account_name, - location=None, - tags=None, - sku=None, - kind=None, - storage_account_name=None): - spatial_anchors_account = {} - spatial_anchors_account['tags'] = tags - spatial_anchors_account['location'] = location - spatial_anchors_account['sku'] = sku - spatial_anchors_account['kind'] = kind - spatial_anchors_account['storage_account_name'] = storage_account_name - client = cf_spatial_anchor_account(cmd.cli_ctx) - return client.create(resource_group_name=resource_group_name, - account_name=account_name, - spatial_anchors_account=spatial_anchors_account) - - -def spatial_anchor_account_update(cmd, - instance, - location=None, - tags=None, - sku=None, - kind=None, - storage_account_name=None): - with cmd.update_context(instance) as c: - c.set_param('tags', tags) - c.set_param('location', location) - c.set_param('sku', sku) - c.set_param('kind', kind) - c.set_param('storage_account_name', storage_account_name) - return instance - - -def spatial_anchor_account_delete(cmd, - resource_group_name, - account_name): - client = cf_spatial_anchor_account(cmd.cli_ctx) - return client.delete(resource_group_name=resource_group_name, - account_name=account_name) - - -def spatial_anchor_account_list_key(cmd, - resource_group_name, - account_name): - client = cf_spatial_anchor_account(cmd.cli_ctx) - return client.list_keys(resource_group_name=resource_group_name, - account_name=account_name) - - -def spatial_anchor_account_regenerate_key(cmd, - resource_group_name, - account_name, - key=None): - regenerate = {} - regenerate['serial'] = ['primary', 'secondary'].index(key) + 1 - client = cf_spatial_anchor_account(cmd.cli_ctx) - return client.regenerate_keys(resource_group_name=resource_group_name, - account_name=account_name, - regenerate=regenerate) - - -def remote_rendering_account_list(cmd, - resource_group_name=None): - client = cf_remote_rendering_account(cmd.cli_ctx) - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def remote_rendering_account_show(cmd, - resource_group_name, - account_name): - client = cf_remote_rendering_account(cmd.cli_ctx) - return client.get(resource_group_name=resource_group_name, - account_name=account_name) - - -def remote_rendering_account_create(cmd, - resource_group_name, - account_name, - location=None, - tags=None, - sku=None, - kind=None, - storage_account_name=None): - remote_rendering_account = {} - remote_rendering_account['tags'] = tags - remote_rendering_account['location'] = location - remote_rendering_account['identity'] = json.loads("{\"type\": \"SystemAssigned\"}") - remote_rendering_account['sku'] = sku - remote_rendering_account['kind'] = kind - remote_rendering_account['storage_account_name'] = storage_account_name - client = cf_remote_rendering_account(cmd.cli_ctx) - return client.create(resource_group_name=resource_group_name, - account_name=account_name, - remote_rendering_account=remote_rendering_account) - - -def remote_rendering_account_update(cmd, - resource_group_name, - account_name, - location=None, - tags=None, - sku=None, - kind=None, - storage_account_name=None): - remote_rendering_account = {} - remote_rendering_account['tags'] = tags - remote_rendering_account['location'] = location - remote_rendering_account['identity'] = json.loads("{\"type\": \"SystemAssigned\"}") - remote_rendering_account['sku'] = sku - remote_rendering_account['kind'] = kind - remote_rendering_account['storage_account_name'] = storage_account_name - client = cf_remote_rendering_account(cmd.cli_ctx) - return client.update(resource_group_name=resource_group_name, - account_name=account_name, - remote_rendering_account=remote_rendering_account) - - -def remote_rendering_account_delete(cmd, - resource_group_name, - account_name): - client = cf_remote_rendering_account(cmd.cli_ctx) - return client.delete(resource_group_name=resource_group_name, - account_name=account_name) - - -def remote_rendering_account_list_key(cmd, - resource_group_name, - account_name): - client = cf_remote_rendering_account(cmd.cli_ctx) - return client.list_keys(resource_group_name=resource_group_name, - account_name=account_name) - - -def remote_rendering_account_regenerate_key(cmd, - resource_group_name, - account_name, - key=None): - regenerate = {} - regenerate['serial'] = ['primary', 'secondary'].index(key) + 1 - client = cf_remote_rendering_account(cmd.cli_ctx) - return client.regenerate_keys(resource_group_name=resource_group_name, - account_name=account_name, - regenerate=regenerate) +from azure.cli.core.aaz import has_value +from .aaz.latest.spatial_anchors_account import Create as _SpatialAnchorsCreate +from .aaz.latest.spatial_anchors_account.key import Renew as _SpatialAnchorsKeyRenew +from .aaz.latest.remote_rendering_account import Create as _RemoteRenderingCreate +from .aaz.latest.remote_rendering_account.key import Renew as _RemoteRenderingKeyRenew +from knack.log import get_logger + + +logger = get_logger(__name__) + + +class SpatialAnchorsCreate(_SpatialAnchorsCreate): + def pre_operations(self): + args = self.ctx.args + if has_value(args.kind): + args.sku = args.kind + del args.kind + + +class RemoteRenderingCreate(_RemoteRenderingCreate): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.identity._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + if has_value(args.kind): + args.sku = args.kind + del args.kind + args.identity = {"type": "SystemAssigned"} + + +class SpatialAnchorsKeyRenew(_SpatialAnchorsKeyRenew): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZArgEnum + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.key = AAZStrArg( + options=["--key", "-k"], + help="Key to be regenerated.", + default="primary", + enum={"primary": "primary", "secondary": "secondary"} + ) + args_schema.serial._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + if has_value(args.key): + args.serial = 1 if str(args.key).lower() == 'primary' else 2 + + +class RemoteRenderingKeyRenew(_RemoteRenderingKeyRenew): + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + from azure.cli.core.aaz import AAZStrArg, AAZArgEnum + args_schema = super()._build_arguments_schema(*args, **kwargs) + args_schema.key = AAZStrArg( + options=["--key", "-k"], + help="Key to be regenerated.", + default="primary", + enum={"primary": "primary", "secondary": "secondary"} + ) + args_schema.serial._registered = False + return args_schema + + def pre_operations(self): + args = self.ctx.args + if has_value(args.key): + args.serial = 1 if str(args.key).lower() == 'primary' else 2 diff --git a/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_remote_rendering_account_scenario.yaml b/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_remote_rendering_account_scenario.yaml index e683377990a..207b01c391a 100644 --- a/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_remote_rendering_account_scenario.yaml +++ b/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_remote_rendering_account_scenario.yaml @@ -13,22 +13,22 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) azsdk-python-azure-mgmt-resource/23.0.1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2023-03-28T10:59:36Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","test":"test_remote_rendering_account_scenario","date":"2023-06-28T03:55:10Z","module":"mixed-reality"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '311' + - '384' content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:36 GMT + - Wed, 28 Jun 2023 03:55:14 GMT expires: - '-1' pragma: @@ -43,7 +43,7 @@ interactions: code: 200 message: OK - request: - body: '{"location": "eastus2", "identity": {"type": "SystemAssigned"}}' + body: '{"identity": {"type": "SystemAssigned"}, "location": "eastus2"}' headers: Accept: - application/json @@ -60,13 +60,12 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"3b98f6c5-ba25-467c-b89b-ab8a5b63c8fe","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"accountDomain":"eastus2.mixedreality.azure.com","accountId":"b0b697e2-3fb8-4558-a02d-06054db7b78d"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"93c02df3-a821-41b1-bf71-75768c3ba7a5","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"accountDomain":"eastus2.mixedreality.azure.com","accountId":"01ebe302-0fdf-4dd5-b7c7-fc3fa111a6f1"}}' headers: cache-control: - no-cache @@ -75,13 +74,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:43 GMT + - Wed, 28 Jun 2023 03:55:24 GMT expires: - '-1' location: - subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name ms-cv: - - IJaPoQS2I0CKYOcCB7rETg.0 + - dar1aJT+xUmiNuSyt2pm2A.0 pragma: - no-cache strict-transport-security: @@ -89,7 +88,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1182' + - '1199' status: code: 201 message: Created @@ -105,24 +104,24 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g -n --storage-account-name --tag + - -g -n --storage-account-name --tag --kind User-Agent: - - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) azsdk-python-azure-mgmt-resource/23.0.1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2023-03-28T10:59:36Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","test":"test_remote_rendering_account_scenario","date":"2023-06-28T03:55:10Z","module":"mixed-reality"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '311' + - '384' content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:43 GMT + - Wed, 28 Jun 2023 03:55:24 GMT expires: - '-1' pragma: @@ -137,8 +136,9 @@ interactions: code: 200 message: OK - request: - body: '{"tags": {"tag": "tag"}, "location": "eastus2", "identity": {"type": "SystemAssigned"}, - "properties": {"storageAccountName": "storage_account_name"}}' + body: '{"identity": {"type": "SystemAssigned"}, "location": "eastus2", "properties": + {"storageAccountName": "storage_account_name"}, "sku": {"name": "P3"}, "tags": + {"tag": "tag"}}' headers: Accept: - application/json @@ -149,19 +149,18 @@ interactions: Connection: - keep-alive Content-Length: - - '149' + - '172' Content-Type: - application/json ParameterSetName: - - -g -n --storage-account-name --tag + - -g -n --storage-account-name --tag --kind User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1","name":"remote-rendering-account-name1","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"7f98ca0d-ba77-4bfb-a3cd-18f0fba9b5a1","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"eastus2.mixedreality.azure.com","accountId":"628e5618-41de-4c63-b6ab-b024cfac3b5c"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1","name":"remote-rendering-account-name1","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"4b8e044c-9978-4a80-bf79-c72aaf5ce4f2","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"eastus2.mixedreality.azure.com","accountId":"87166169-9b62-46eb-ad55-e594f3dd679e"}}' headers: cache-control: - no-cache @@ -170,13 +169,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:50 GMT + - Wed, 28 Jun 2023 03:55:39 GMT expires: - '-1' location: - subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1 ms-cv: - - 4oXr9QNGWECEsTnueAzh+Q.0 + - RTIYbVXdjkeWPf2YISxHjA.0 pragma: - no-cache strict-transport-security: @@ -184,56 +183,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1190' + - '1199' status: code: 201 message: Created - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - remote-rendering-account update - Connection: - - keep-alive - ParameterSetName: - - -g -n --storage-account-name - User-Agent: - - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2023-03-28T10:59:36Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '311' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 28 Mar 2023 10:59:50 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus2", "identity": {"type": "SystemAssigned"}, "properties": - {"storageAccountName": "storage_account_name1"}}' + body: '{"properties": {"storageAccountName": "storage_account_name1"}}' headers: Accept: - application/json @@ -244,19 +199,18 @@ interactions: Connection: - keep-alive Content-Length: - - '126' + - '63' Content-Type: - application/json ParameterSetName: - -g -n --storage-account-name User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"3b98f6c5-ba25-467c-b89b-ab8a5b63c8fe","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"b0b697e2-3fb8-4558-a02d-06054db7b78d"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"93c02df3-a821-41b1-bf71-75768c3ba7a5","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"01ebe302-0fdf-4dd5-b7c7-fc3fa111a6f1"}}' headers: cache-control: - no-cache @@ -265,11 +219,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:51 GMT + - Wed, 28 Jun 2023 03:55:40 GMT expires: - '-1' ms-cv: - - /F4vjJYNS0y9dInrx11aaw.0 + - cEjp1E1sH0Gd9ZvfaEbU3A.0 pragma: - no-cache strict-transport-security: @@ -281,7 +235,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1189' + - '1199' status: code: 200 message: OK @@ -299,13 +253,12 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"3b98f6c5-ba25-467c-b89b-ab8a5b63c8fe","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"b0b697e2-3fb8-4558-a02d-06054db7b78d"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"93c02df3-a821-41b1-bf71-75768c3ba7a5","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"01ebe302-0fdf-4dd5-b7c7-fc3fa111a6f1"}}' headers: cache-control: - no-cache @@ -314,11 +267,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:51 GMT + - Wed, 28 Jun 2023 03:55:43 GMT expires: - '-1' ms-cv: - - 0j8QntmX1E+K58jMj+VejQ.0 + - TUb2T8dxe0G7GRZRGZ7UFg.0 pragma: - no-cache strict-transport-security: @@ -346,13 +299,12 @@ interactions: ParameterSetName: - -g User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts?api-version=2021-03-01-preview response: body: - string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"3b98f6c5-ba25-467c-b89b-ab8a5b63c8fe","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"b0b697e2-3fb8-4558-a02d-06054db7b78d"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1","name":"remote-rendering-account-name1","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"7f98ca0d-ba77-4bfb-a3cd-18f0fba9b5a1","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"eastus2.mixedreality.azure.com","accountId":"628e5618-41de-4c63-b6ab-b024cfac3b5c"}}]}' + string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"93c02df3-a821-41b1-bf71-75768c3ba7a5","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"01ebe302-0fdf-4dd5-b7c7-fc3fa111a6f1"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1","name":"remote-rendering-account-name1","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"4b8e044c-9978-4a80-bf79-c72aaf5ce4f2","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"eastus2.mixedreality.azure.com","accountId":"87166169-9b62-46eb-ad55-e594f3dd679e"}}]}' headers: cache-control: - no-cache @@ -361,11 +313,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:54 GMT + - Wed, 28 Jun 2023 03:55:47 GMT expires: - '-1' ms-cv: - - //96z/osE0+Sl2cHDLg1Zw.0 + - F8eGNICBRE6sTx32xayJng.0 pragma: - no-cache strict-transport-security: @@ -383,7 +335,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -395,10 +347,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name1?api-version=2021-03-01-preview response: body: string: '' @@ -408,11 +359,11 @@ interactions: content-length: - '0' date: - - Tue, 28 Mar 2023 10:59:55 GMT + - Wed, 28 Jun 2023 03:55:53 GMT expires: - '-1' ms-cv: - - 4bNQfsa7zk+zbzyJ4KK0UQ.0 + - 4KLByxqhwE6MoO9YdVfPeA.0 pragma: - no-cache strict-transport-security: @@ -420,7 +371,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14992' + - '14999' status: code: 200 message: OK @@ -438,13 +389,12 @@ interactions: ParameterSetName: - -g User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts?api-version=2021-03-01-preview response: body: - string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"3b98f6c5-ba25-467c-b89b-ab8a5b63c8fe","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"b0b697e2-3fb8-4558-a02d-06054db7b78d"}}]}' + string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name","name":"remote-rendering-account-name","type":"Microsoft.MixedReality/remoteRenderingAccounts","identity":{"type":"SystemAssigned","principalId":"93c02df3-a821-41b1-bf71-75768c3ba7a5","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"eastus2.mixedreality.azure.com","accountId":"01ebe302-0fdf-4dd5-b7c7-fc3fa111a6f1"}}]}' headers: cache-control: - no-cache @@ -453,15 +403,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:57 GMT + - Wed, 28 Jun 2023 03:55:57 GMT expires: - '-1' ms-cv: - - Gt7uQuLx3U6rtv/C3jZGnw.0 + - s8JxaDcDIkepC3law9r+qg.0 pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff status: @@ -483,10 +437,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/listKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/listKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -498,11 +451,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:58 GMT + - Wed, 28 Jun 2023 03:55:59 GMT expires: - '-1' ms-cv: - - Na7YkQcfH0Ki4Jity3nlEg.0 + - uMOxo2McakO5ZHIBD/d0mQ.0 pragma: - no-cache strict-transport-security: @@ -536,10 +489,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/regenerateKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/regenerateKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -551,11 +503,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:57 GMT + - Wed, 28 Jun 2023 03:56:01 GMT expires: - '-1' ms-cv: - - qrwnUrRsXE255DIqC5WscA.0 + - Z6qqpRFpJUmTVgiJkqU9Ag.0 pragma: - no-cache strict-transport-security: @@ -589,10 +541,9 @@ interactions: ParameterSetName: - -g -n -k User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/regenerateKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/regenerateKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -604,11 +555,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:57 GMT + - Wed, 28 Jun 2023 03:56:03 GMT expires: - '-1' ms-cv: - - 41PGC+Vc9UCR01pzbLwnbA.0 + - jTPhbgRCik60MlN+ecsTYA.0 pragma: - no-cache strict-transport-security: @@ -620,7 +571,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -642,10 +593,9 @@ interactions: ParameterSetName: - -g -n -k User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/regenerateKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/remoteRenderingAccounts/remote-rendering-account-name/regenerateKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -657,11 +607,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 10:59:59 GMT + - Wed, 28 Jun 2023 03:56:04 GMT expires: - '-1' ms-cv: - - 81MUb03GoE2dfA/BFBjnQg.0 + - qAr9tTNp5UyLGLj16aAOJw.0 pragma: - no-cache strict-transport-security: @@ -673,7 +623,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK diff --git a/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_spatial_anchors_account_scenario.yaml b/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_spatial_anchors_account_scenario.yaml index 66537e318d3..574c303113b 100644 --- a/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_spatial_anchors_account_scenario.yaml +++ b/src/mixed-reality/azext_mixed_reality/tests/latest/recordings/test_spatial_anchors_account_scenario.yaml @@ -13,28 +13,30 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) azsdk-python-azure-mgmt-resource/23.0.1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2023-03-28T10:59:59Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","test":"test_spatial_anchors_account_scenario","date":"2023-06-28T03:55:10Z","module":"mixed-reality"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '311' + - '383' content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:00 GMT + - Wed, 28 Jun 2023 03:55:14 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding x-content-type-options: - nosniff status: @@ -58,13 +60,12 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"accountDomain":"mixedreality.azure.com","accountId":"6b65d2ec-f9ad-42fe-83b0-b4f688e2232a"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"accountDomain":"mixedreality.azure.com","accountId":"dd5dd1d8-de66-4c41-ab35-fc21694690e5"}}' headers: cache-control: - no-cache @@ -73,13 +74,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:01 GMT + - Wed, 28 Jun 2023 03:55:20 GMT expires: - '-1' location: - subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name ms-cv: - - 3bhZj/w9W0ubPV4Kgi0Iww.0 + - H7yy/fHgxUGs0b8UmT5lTw.0 pragma: - no-cache strict-transport-security: @@ -87,7 +88,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' status: code: 201 message: Created @@ -103,24 +104,24 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g -n --storage-account-name --tag + - -g -n --storage-account-name --tag --kind User-Agent: - - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) azsdk-python-azure-mgmt-resource/23.0.1 Python/3.9.6 + (Windows-10-10.0.19045-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2023-03-28T10:59:59Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","test":"test_spatial_anchors_account_scenario","date":"2023-06-28T03:55:10Z","module":"mixed-reality"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '311' + - '383' content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:01 GMT + - Wed, 28 Jun 2023 03:55:21 GMT expires: - '-1' pragma: @@ -135,8 +136,8 @@ interactions: code: 200 message: OK - request: - body: '{"tags": {"tag": "tag"}, "location": "eastus2", "properties": {"storageAccountName": - "storage_account_name"}}' + body: '{"location": "eastus2", "properties": {"storageAccountName": "storage_account_name"}, + "sku": {"name": "P3"}, "tags": {"tag": "tag"}}' headers: Accept: - application/json @@ -147,19 +148,18 @@ interactions: Connection: - keep-alive Content-Length: - - '109' + - '132' Content-Type: - application/json ParameterSetName: - - -g -n --storage-account-name --tag + - -g -n --storage-account-name --tag --kind User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1","name":"spatial-anchors-account-name1","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"mixedreality.azure.com","accountId":"c5c3bfc2-b343-4ac6-a4cc-c12acf1d38e8"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1","name":"spatial-anchors-account-name1","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"mixedreality.azure.com","accountId":"ec99725e-bb22-4a97-9e96-68b74937e4ae"}}' headers: cache-control: - no-cache @@ -168,13 +168,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:02 GMT + - Wed, 28 Jun 2023 03:55:28 GMT expires: - '-1' location: - subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1 ms-cv: - - 3VIAPG8aSkO638wxHsDWqA.0 + - NnCsAZ/OOU+ZTk7sj3G5Bg.0 pragma: - no-cache strict-transport-security: @@ -182,103 +182,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1198' status: code: 201 message: Created - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - spatial-anchors-account update - Connection: - - keep-alive - ParameterSetName: - - -g -n --storage-account-name - User-Agent: - - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2023-03-28T10:59:59Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '311' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 28 Mar 2023 11:00:02 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - spatial-anchors-account update - Connection: - - keep-alive - ParameterSetName: - - -g -n --storage-account-name - User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name?api-version=2021-01-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"accountDomain":"mixedreality.azure.com","accountId":"6b65d2ec-f9ad-42fe-83b0-b4f688e2232a"}}' - headers: - cache-control: - - no-cache - content-length: - - '459' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 28 Mar 2023 11:00:03 GMT - expires: - - '-1' - ms-cv: - - WjhypcMkh0GQrKQogPC/tw.0 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"tags": {}, "location": "eastus2", "properties": {"storageAccountName": - "storage_account_name1"}}' + body: '{"properties": {"storageAccountName": "storage_account_name1"}}' headers: Accept: - application/json @@ -289,19 +198,18 @@ interactions: Connection: - keep-alive Content-Length: - - '98' + - '63' Content-Type: - application/json ParameterSetName: - -g -n --storage-account-name User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"6b65d2ec-f9ad-42fe-83b0-b4f688e2232a"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"dd5dd1d8-de66-4c41-ab35-fc21694690e5"}}' headers: cache-control: - no-cache @@ -310,11 +218,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:03 GMT + - Wed, 28 Jun 2023 03:55:30 GMT expires: - '-1' ms-cv: - - zHtq6XOYykCryUY2gvff1Q.0 + - 1YUbAKLi1kGzgfjzYGdz4Q.0 pragma: - no-cache strict-transport-security: @@ -326,7 +234,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -344,13 +252,12 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name?api-version=2021-03-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"6b65d2ec-f9ad-42fe-83b0-b4f688e2232a"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"dd5dd1d8-de66-4c41-ab35-fc21694690e5"}}' headers: cache-control: - no-cache @@ -359,11 +266,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:03 GMT + - Wed, 28 Jun 2023 03:55:33 GMT expires: - '-1' ms-cv: - - Dk0XLHTzoUKaBrbbUJF01A.0 + - 1K1oe+qhBEyThU+m11jq+w.0 pragma: - no-cache strict-transport-security: @@ -391,13 +298,12 @@ interactions: ParameterSetName: - -g User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts?api-version=2021-03-01-preview response: body: - string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"6b65d2ec-f9ad-42fe-83b0-b4f688e2232a"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1","name":"spatial-anchors-account-name1","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"mixedreality.azure.com","accountId":"c5c3bfc2-b343-4ac6-a4cc-c12acf1d38e8"}}]}' + string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"dd5dd1d8-de66-4c41-ab35-fc21694690e5"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1","name":"spatial-anchors-account-name1","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{"tag":"tag"},"properties":{"storageAccountName":"storage_account_name","accountDomain":"mixedreality.azure.com","accountId":"ec99725e-bb22-4a97-9e96-68b74937e4ae"}}]}' headers: cache-control: - no-cache @@ -406,11 +312,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:03 GMT + - Wed, 28 Jun 2023 03:55:34 GMT expires: - '-1' ms-cv: - - sJajFyqS8EahdpAhtCN+ig.0 + - SjvkEVECAkaoI/3Oxy52tA.0 pragma: - no-cache strict-transport-security: @@ -428,7 +334,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -440,10 +346,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name1?api-version=2021-03-01-preview response: body: string: '' @@ -453,11 +358,11 @@ interactions: content-length: - '0' date: - - Tue, 28 Mar 2023 11:00:04 GMT + - Wed, 28 Jun 2023 03:55:41 GMT expires: - '-1' ms-cv: - - 3B7uoZnb60O10Qp0y2Yx/A.0 + - jbEjzy/2qkijOy5bX+yBcA.0 pragma: - no-cache strict-transport-security: @@ -483,13 +388,12 @@ interactions: ParameterSetName: - -g User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts?api-version=2021-03-01-preview response: body: - string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"6b65d2ec-f9ad-42fe-83b0-b4f688e2232a"}}]}' + string: '{"nextLink":null,"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name","name":"spatial-anchors-account-name","type":"Microsoft.MixedReality/spatialAnchorsAccounts","identity":null,"location":"eastus2","plan":null,"sku":null,"kind":null,"tags":{},"properties":{"storageAccountName":"storage_account_name1","accountDomain":"mixedreality.azure.com","accountId":"dd5dd1d8-de66-4c41-ab35-fc21694690e5"}}]}' headers: cache-control: - no-cache @@ -498,11 +402,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:04 GMT + - Wed, 28 Jun 2023 03:55:43 GMT expires: - '-1' ms-cv: - - jiRCRf9uMkGpsm3HoFMhBA.0 + - 3lXL9sORRUi7lxWkzNyByw.0 pragma: - no-cache strict-transport-security: @@ -532,10 +436,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/listKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/listKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -547,11 +450,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:05 GMT + - Wed, 28 Jun 2023 03:55:45 GMT expires: - '-1' ms-cv: - - uDS8zA9prEqzF2Zq4/imfw.0 + - wOPR/u1sTE+Ke4qPdi+HTA.0 pragma: - no-cache strict-transport-security: @@ -585,10 +488,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/regenerateKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/regenerateKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -600,11 +502,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:05 GMT + - Wed, 28 Jun 2023 03:55:46 GMT expires: - '-1' ms-cv: - - YggAmkjcz0CjK8OgAHcMcg.0 + - DEgnu6i7AUOKjedOxHRgMA.0 pragma: - no-cache strict-transport-security: @@ -616,7 +518,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -638,10 +540,9 @@ interactions: ParameterSetName: - -g -n -k User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/regenerateKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/regenerateKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -653,11 +554,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:06 GMT + - Wed, 28 Jun 2023 03:55:49 GMT expires: - '-1' ms-cv: - - Ogh9t+YT2kir0T7O0DInvw.0 + - zs60bZJaoUaCP8L4ugVXCQ.0 pragma: - no-cache strict-transport-security: @@ -691,10 +592,9 @@ interactions: ParameterSetName: - -g -n -k User-Agent: - - AZURECLI/2.46.0 azsdk-python-mgmt-mixedreality/0.0.1 Python/3.10.10 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0 + - AZURECLI/2.49.0 (PIP) (AAZ) azsdk-python-core/1.26.0 Python/3.9.6 (Windows-10-10.0.19045-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/regenerateKeys?api-version=2021-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatial-anchors-account-name/regenerateKeys?api-version=2021-03-01-preview response: body: string: '{"primaryKey":"mock_key","secondaryKey":"mock_key"}' @@ -706,11 +606,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 28 Mar 2023 11:00:06 GMT + - Wed, 28 Jun 2023 03:55:50 GMT expires: - '-1' ms-cv: - - WUtfJ8KnE0es8OZvgDhBkg.0 + - KA6x5Z37kEW3VpEPSlFYEw.0 pragma: - no-cache strict-transport-security: diff --git a/src/mixed-reality/azext_mixed_reality/tests/latest/test_remote_rendering_account.py b/src/mixed-reality/azext_mixed_reality/tests/latest/test_remote_rendering_account.py index f1c44af2998..1a9e2842fa0 100644 --- a/src/mixed-reality/azext_mixed_reality/tests/latest/test_remote_rendering_account.py +++ b/src/mixed-reality/azext_mixed_reality/tests/latest/test_remote_rendering_account.py @@ -29,7 +29,7 @@ def test_remote_rendering_account_scenario(self, resource_group, location): # Create with more parameters self.cmd('remote-rendering-account create -g {rg} -n {account_name1} ' - '--storage-account-name {storage_account_name} --tag tag=tag', + '--storage-account-name {storage_account_name} --tag tag=tag --kind name=P3', checks=[self.exists('tags'), self.check('storageAccountName', '{storage_account_name}')]) diff --git a/src/mixed-reality/azext_mixed_reality/tests/latest/test_spatial_anchors_account.py b/src/mixed-reality/azext_mixed_reality/tests/latest/test_spatial_anchors_account.py index f746cc41732..8c20342e607 100644 --- a/src/mixed-reality/azext_mixed_reality/tests/latest/test_spatial_anchors_account.py +++ b/src/mixed-reality/azext_mixed_reality/tests/latest/test_spatial_anchors_account.py @@ -30,7 +30,7 @@ def test_spatial_anchors_account_scenario(self, resource_group, location): # Create with more parameters self.cmd('spatial-anchors-account create -g {rg} -n {account_name1} ' - '--storage-account-name {storage_account_name} --tag tag=tag', + '--storage-account-name {storage_account_name} --tag tag=tag --kind name=P3', checks=[self.exists('tags'), self.check('storageAccountName', '{storage_account_name}')]) diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/__init__.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/__init__.py deleted file mode 100644 index 91382c74357..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._mixed_reality_client import MixedRealityClient -from ._version import VERSION - -__version__ = VERSION -__all__ = ['MixedRealityClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_configuration.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_configuration.py deleted file mode 100644 index c18f56d541f..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_configuration.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -class MixedRealityClientConfiguration(Configuration): - """Configuration for MixedRealityClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :type subscription_id: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - super(MixedRealityClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2021-01-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-mixedreality/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_mixed_reality_client.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_mixed_reality_client.py deleted file mode 100644 index 5fd801b9b5b..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/_mixed_reality_client.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import MixedRealityClientConfiguration -from .operations import Operations -from .operations import MixedRealityClientOperationsMixin -from .operations import SpatialAnchorsAccountsOperations -from .operations import RemoteRenderingAccountsOperations -from . import models - - -class MixedRealityClient(MixedRealityClientOperationsMixin): - """Mixed Reality Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.mixedreality.operations.Operations - :ivar spatial_anchors_accounts: SpatialAnchorsAccountsOperations operations - :vartype spatial_anchors_accounts: azure.mgmt.mixedreality.operations.SpatialAnchorsAccountsOperations - :ivar remote_rendering_accounts: RemoteRenderingAccountsOperations operations - :vartype remote_rendering_accounts: azure.mgmt.mixedreality.operations.RemoteRenderingAccountsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = MixedRealityClientConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.spatial_anchors_accounts = SpatialAnchorsAccountsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.remote_rendering_accounts = RemoteRenderingAccountsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse - """Runs the network request through the client's chained policies. - - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse - """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> MixedRealityClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/_configuration.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/_configuration.py deleted file mode 100644 index 9655a959c45..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/_configuration.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class MixedRealityClientConfiguration(Configuration): - """Configuration for MixedRealityClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :type subscription_id: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - super(MixedRealityClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2021-01-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-mixedreality/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/_mixed_reality_client.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/_mixed_reality_client.py deleted file mode 100644 index ee6a492afff..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/_mixed_reality_client.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Optional, TYPE_CHECKING - -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import MixedRealityClientConfiguration -from .operations import Operations -from .operations import MixedRealityClientOperationsMixin -from .operations import SpatialAnchorsAccountsOperations -from .operations import RemoteRenderingAccountsOperations -from .. import models - - -class MixedRealityClient(MixedRealityClientOperationsMixin): - """Mixed Reality Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.mixedreality.aio.operations.Operations - :ivar spatial_anchors_accounts: SpatialAnchorsAccountsOperations operations - :vartype spatial_anchors_accounts: azure.mgmt.mixedreality.aio.operations.SpatialAnchorsAccountsOperations - :ivar remote_rendering_accounts: RemoteRenderingAccountsOperations operations - :vartype remote_rendering_accounts: azure.mgmt.mixedreality.aio.operations.RemoteRenderingAccountsOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = MixedRealityClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.spatial_anchors_accounts = SpatialAnchorsAccountsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.remote_rendering_accounts = RemoteRenderingAccountsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: - """Runs the network request through the client's chained policies. - - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse - """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "MixedRealityClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/__init__.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/__init__.py deleted file mode 100644 index 93f9fc77519..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._mixed_reality_client_operations import MixedRealityClientOperationsMixin -from ._spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations -from ._remote_rendering_accounts_operations import RemoteRenderingAccountsOperations - -__all__ = [ - 'Operations', - 'MixedRealityClientOperationsMixin', - 'SpatialAnchorsAccountsOperations', - 'RemoteRenderingAccountsOperations', -] diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_mixed_reality_client_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_mixed_reality_client_operations.py deleted file mode 100644 index 94a32b391c3..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_mixed_reality_client_operations.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class MixedRealityClientOperationsMixin: - - async def check_name_availability_local( - self, - location: str, - check_name_availability: "_models.CheckNameAvailabilityRequest", - **kwargs - ) -> "_models.CheckNameAvailabilityResponse": - """Check Name Availability for local uniqueness. - - :param location: The location in which uniqueness will be verified. - :type location: str - :param check_name_availability: Check Name Availability Request. - :type check_name_availability: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameAvailabilityResponse, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability_local.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(check_name_availability, 'CheckNameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CheckNameAvailabilityResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - check_name_availability_local.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_operations.py deleted file mode 100644 index e802da0f5a9..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_operations.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.mixedreality.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.OperationPage"]: - """Exposing Available Operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationPage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.OperationPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MixedReality/operations'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_remote_rendering_accounts_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_remote_rendering_accounts_operations.py deleted file mode 100644 index 323e533cee1..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_remote_rendering_accounts_operations.py +++ /dev/null @@ -1,551 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RemoteRenderingAccountsOperations: - """RemoteRenderingAccountsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.mixedreality.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["_models.RemoteRenderingAccountPage"]: - """List Remote Rendering Accounts by Subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RemoteRenderingAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.RemoteRenderingAccountPage"]: - """List Resources by Resource Group. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RemoteRenderingAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore - - async def delete( - self, - resource_group_name: str, - account_name: str, - **kwargs - ) -> None: - """Delete a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - account_name: str, - **kwargs - ) -> "_models.RemoteRenderingAccount": - """Retrieve a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RemoteRenderingAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - account_name: str, - remote_rendering_account: "_models.RemoteRenderingAccount", - **kwargs - ) -> "_models.RemoteRenderingAccount": - """Updating a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param remote_rendering_account: Remote Rendering Account parameter. - :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RemoteRenderingAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(remote_rendering_account, 'RemoteRenderingAccount') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - async def create( - self, - resource_group_name: str, - account_name: str, - remote_rendering_account: "_models.RemoteRenderingAccount", - **kwargs - ) -> "_models.RemoteRenderingAccount": - """Creating or Updating a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param remote_rendering_account: Remote Rendering Account parameter. - :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RemoteRenderingAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(remote_rendering_account, 'RemoteRenderingAccount') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - async def list_keys( - self, - resource_group_name: str, - account_name: str, - **kwargs - ) -> "_models.AccountKeys": - """List Both of the 2 Keys of a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.list_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys'} # type: ignore - - async def regenerate_keys( - self, - resource_group_name: str, - account_name: str, - regenerate: "_models.AccountKeyRegenerateRequest", - **kwargs - ) -> "_models.AccountKeys": - """Regenerate specified Key of a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param regenerate: Required information for key regeneration. - :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.regenerate_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(regenerate, 'AccountKeyRegenerateRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_spatial_anchors_accounts_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_spatial_anchors_accounts_operations.py deleted file mode 100644 index 2f412610f7f..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/aio/operations/_spatial_anchors_accounts_operations.py +++ /dev/null @@ -1,551 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SpatialAnchorsAccountsOperations: - """SpatialAnchorsAccountsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.mixedreality.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["_models.SpatialAnchorsAccountPage"]: - """List Spatial Anchors Accounts by Subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.SpatialAnchorsAccountPage"]: - """List Resources by Resource Group. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore - - async def delete( - self, - resource_group_name: str, - account_name: str, - **kwargs - ) -> None: - """Delete a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - account_name: str, - **kwargs - ) -> "_models.SpatialAnchorsAccount": - """Retrieve a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SpatialAnchorsAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - account_name: str, - spatial_anchors_account: "_models.SpatialAnchorsAccount", - **kwargs - ) -> "_models.SpatialAnchorsAccount": - """Updating a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param spatial_anchors_account: Spatial Anchors Account parameter. - :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SpatialAnchorsAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - async def create( - self, - resource_group_name: str, - account_name: str, - spatial_anchors_account: "_models.SpatialAnchorsAccount", - **kwargs - ) -> "_models.SpatialAnchorsAccount": - """Creating or Updating a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param spatial_anchors_account: Spatial Anchors Account parameter. - :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SpatialAnchorsAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - async def list_keys( - self, - resource_group_name: str, - account_name: str, - **kwargs - ) -> "_models.AccountKeys": - """List Both of the 2 Keys of a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.list_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys'} # type: ignore - - async def regenerate_keys( - self, - resource_group_name: str, - account_name: str, - regenerate: "_models.AccountKeyRegenerateRequest", - **kwargs - ) -> "_models.AccountKeys": - """Regenerate specified Key of a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param regenerate: Required information for key regeneration. - :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.regenerate_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(regenerate, 'AccountKeyRegenerateRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/__init__.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/__init__.py deleted file mode 100644 index 7b0b0140a17..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/__init__.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AccountKeyRegenerateRequest - from ._models_py3 import AccountKeys - from ._models_py3 import CheckNameAvailabilityRequest - from ._models_py3 import CheckNameAvailabilityResponse - from ._models_py3 import CloudErrorBody - from ._models_py3 import Identity - from ._models_py3 import LogSpecification - from ._models_py3 import MetricDimension - from ._models_py3 import MetricSpecification - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationPage - from ._models_py3 import OperationProperties - from ._models_py3 import RemoteRenderingAccount - from ._models_py3 import RemoteRenderingAccountPage - from ._models_py3 import Resource - from ._models_py3 import ServiceSpecification - from ._models_py3 import Sku - from ._models_py3 import SpatialAnchorsAccount - from ._models_py3 import SpatialAnchorsAccountPage - from ._models_py3 import SystemData - from ._models_py3 import TrackedResource -except (SyntaxError, ImportError): - from ._models import AccountKeyRegenerateRequest # type: ignore - from ._models import AccountKeys # type: ignore - from ._models import CheckNameAvailabilityRequest # type: ignore - from ._models import CheckNameAvailabilityResponse # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import Identity # type: ignore - from ._models import LogSpecification # type: ignore - from ._models import MetricDimension # type: ignore - from ._models import MetricSpecification # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationPage # type: ignore - from ._models import OperationProperties # type: ignore - from ._models import RemoteRenderingAccount # type: ignore - from ._models import RemoteRenderingAccountPage # type: ignore - from ._models import Resource # type: ignore - from ._models import ServiceSpecification # type: ignore - from ._models import Sku # type: ignore - from ._models import SpatialAnchorsAccount # type: ignore - from ._models import SpatialAnchorsAccountPage # type: ignore - from ._models import SystemData # type: ignore - from ._models import TrackedResource # type: ignore - -from ._mixed_reality_client_enums import ( - CreatedByType, - NameUnavailableReason, - Serial, - SkuTier, -) - -__all__ = [ - 'AccountKeyRegenerateRequest', - 'AccountKeys', - 'CheckNameAvailabilityRequest', - 'CheckNameAvailabilityResponse', - 'CloudErrorBody', - 'Identity', - 'LogSpecification', - 'MetricDimension', - 'MetricSpecification', - 'Operation', - 'OperationDisplay', - 'OperationPage', - 'OperationProperties', - 'RemoteRenderingAccount', - 'RemoteRenderingAccountPage', - 'Resource', - 'ServiceSpecification', - 'Sku', - 'SpatialAnchorsAccount', - 'SpatialAnchorsAccountPage', - 'SystemData', - 'TrackedResource', - 'CreatedByType', - 'NameUnavailableReason', - 'Serial', - 'SkuTier', -] diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_mixed_reality_client_enums.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_mixed_reality_client_enums.py deleted file mode 100644 index 3c095b56888..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_mixed_reality_client_enums.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class NameUnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """reason of name unavailable. - """ - - INVALID = "Invalid" - ALREADY_EXISTS = "AlreadyExists" - -class Serial(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): - """serial of key to be regenerated - """ - - #: The Primary Key. - PRIMARY = 1 - #: The Secondary Key. - SECONDARY = 2 - -class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """This field is required to be implemented by the Resource Provider if the service has more than - one tier, but is not required on a PUT. - """ - - FREE = "Free" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_models.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_models.py deleted file mode 100644 index c3f82735ec3..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_models.py +++ /dev/null @@ -1,802 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class AccountKeyRegenerateRequest(msrest.serialization.Model): - """Request for account key regeneration. - - :param serial: serial of key to be regenerated. Possible values include: 1, 2. Default value: - "1". - :type serial: str or ~azure.mgmt.mixedreality.models.Serial - """ - - _attribute_map = { - 'serial': {'key': 'serial', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(AccountKeyRegenerateRequest, self).__init__(**kwargs) - self.serial = kwargs.get('serial', "1") - - -class AccountKeys(msrest.serialization.Model): - """Developer Keys of account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_key: value of primary key. - :vartype primary_key: str - :ivar secondary_key: value of secondary key. - :vartype secondary_key: str - """ - - _validation = { - 'primary_key': {'readonly': True}, - 'secondary_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AccountKeys, self).__init__(**kwargs) - self.primary_key = None - self.secondary_key = None - - -class CheckNameAvailabilityRequest(msrest.serialization.Model): - """Check Name Availability Request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Resource Name To Verify. - :type name: str - :param type: Required. Fully qualified resource type which includes provider namespace. - :type type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckNameAvailabilityRequest, self).__init__(**kwargs) - self.name = kwargs['name'] - self.type = kwargs['type'] - - -class CheckNameAvailabilityResponse(msrest.serialization.Model): - """Check Name Availability Response. - - All required parameters must be populated in order to send to Azure. - - :param name_available: Required. if name Available. - :type name_available: bool - :param reason: Resource Name To Verify. Possible values include: "Invalid", "AlreadyExists". - :type reason: str or ~azure.mgmt.mixedreality.models.NameUnavailableReason - :param message: detail message. - :type message: str - """ - - _validation = { - 'name_available': {'required': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckNameAvailabilityResponse, self).__init__(**kwargs) - self.name_available = kwargs['name_available'] - self.reason = kwargs.get('reason', None) - self.message = kwargs.get('message', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from Azure. - - :param code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :type code: str - :param message: A message describing the error, intended to be suitable for displaying in a - user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.mixedreality.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__( - self, - **kwargs - ): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - - -class LogSpecification(msrest.serialization.Model): - """Specifications of the Log for Azure Monitoring. - - :param name: Name of the log. - :type name: str - :param display_name: Localized friendly display name of the log. - :type display_name: str - :param blob_duration: Blob duration of the log. - :type blob_duration: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LogSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.blob_duration = kwargs.get('blob_duration', None) - - -class MetricDimension(msrest.serialization.Model): - """Specifications of the Dimension of metrics. - - :param name: Name of the dimension. - :type name: str - :param display_name: Localized friendly display name of the dimension. - :type display_name: str - :param internal_name: Internal name of the dimension. - :type internal_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'internal_name': {'key': 'internalName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MetricDimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.internal_name = kwargs.get('internal_name', None) - - -class MetricSpecification(msrest.serialization.Model): - """Specifications of the Metrics for Azure Monitoring. - - :param name: Name of the metric. - :type name: str - :param display_name: Localized friendly display name of the metric. - :type display_name: str - :param display_description: Localized friendly description of the metric. - :type display_description: str - :param unit: Unit that makes sense for the metric. - :type unit: str - :param aggregation_type: Only provide one value for this field. Valid values: Average, Minimum, - Maximum, Total, Count. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - :param dimensions: Dimensions of the metric. - :type dimensions: list[~azure.mgmt.mixedreality.models.MetricDimension] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, - } - - def __init__( - self, - **kwargs - ): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.internal_metric_name = kwargs.get('internal_metric_name', None) - self.dimensions = kwargs.get('dimensions', None) - - -class Operation(msrest.serialization.Model): - """REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation}. - :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.mixedreality.models.OperationDisplay - :param is_data_action: Whether or not this is a data plane operation. - :type is_data_action: bool - :param origin: The origin. - :type origin: str - :param properties: Properties of the operation. - :type properties: ~azure.mgmt.mixedreality.models.OperationProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OperationProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) - - -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. - - All required parameters must be populated in order to send to Azure. - - :param provider: Required. Service provider: Microsoft.ResourceProvider. - :type provider: str - :param resource: Required. Resource on which the operation is performed: Profile, endpoint, - etc. - :type resource: str - :param operation: Required. Operation type: Read, write, delete, etc. - :type operation: str - :param description: Required. Description of operation. - :type description: str - """ - - _validation = { - 'provider': {'required': True}, - 'resource': {'required': True}, - 'operation': {'required': True}, - 'description': {'required': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs['provider'] - self.resource = kwargs['resource'] - self.operation = kwargs['operation'] - self.description = kwargs['description'] - - -class OperationPage(msrest.serialization.Model): - """Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get the next set of results. - - :param value: List of operations supported by the Resource Provider. - :type value: list[~azure.mgmt.mixedreality.models.Operation] - :param next_link: URL to get the next set of operation list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationPage, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class OperationProperties(msrest.serialization.Model): - """Operation properties. - - :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.mixedreality.models.ServiceSpecification - """ - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationProperties, self).__init__(**kwargs) - self.service_specification = kwargs.get('service_specification', None) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class RemoteRenderingAccount(TrackedResource): - """RemoteRenderingAccount Response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param identity: The identity associated with this account. - :type identity: ~azure.mgmt.mixedreality.models.Identity - :param plan: The plan associated with this account. - :type plan: ~azure.mgmt.mixedreality.models.Identity - :param sku: The sku associated with this account. - :type sku: ~azure.mgmt.mixedreality.models.Sku - :param kind: The kind of account, if supported. - :type kind: ~azure.mgmt.mixedreality.models.Sku - :ivar system_data: System metadata for this account. - :vartype system_data: ~azure.mgmt.mixedreality.models.SystemData - :param storage_account_name: The name of the storage account associated with this accountId. - :type storage_account_name: str - :ivar account_id: unique id of certain account. - :vartype account_id: str - :ivar account_domain: Correspond domain name of certain Spatial Anchors Account. - :vartype account_domain: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'account_id': {'readonly': True}, - 'account_domain': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'plan': {'key': 'plan', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, - 'account_id': {'key': 'properties.accountId', 'type': 'str'}, - 'account_domain': {'key': 'properties.accountDomain', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RemoteRenderingAccount, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.plan = kwargs.get('plan', None) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.system_data = None - self.storage_account_name = kwargs.get('storage_account_name', None) - self.account_id = None - self.account_domain = None - - -class RemoteRenderingAccountPage(msrest.serialization.Model): - """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. - - :param value: List of resources supported by the Resource Provider. - :type value: list[~azure.mgmt.mixedreality.models.RemoteRenderingAccount] - :param next_link: URL to get the next set of resource list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RemoteRenderingAccount]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RemoteRenderingAccountPage, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ServiceSpecification(msrest.serialization.Model): - """Service specification payload. - - :param log_specifications: Specifications of the Log for Azure Monitoring. - :type log_specifications: list[~azure.mgmt.mixedreality.models.LogSpecification] - :param metric_specifications: Specifications of the Metrics for Azure Monitoring. - :type metric_specifications: list[~azure.mgmt.mixedreality.models.MetricSpecification] - """ - - _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = kwargs.get('log_specifications', None) - self.metric_specifications = kwargs.get('metric_specifications', None) - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :type name: str - :param tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :type tier: str or ~azure.mgmt.mixedreality.models.SkuTier - :param size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :type size: str - :param family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :type family: str - :param capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :type capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) - - -class SpatialAnchorsAccount(TrackedResource): - """SpatialAnchorsAccount Response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param identity: The identity associated with this account. - :type identity: ~azure.mgmt.mixedreality.models.Identity - :param plan: The plan associated with this account. - :type plan: ~azure.mgmt.mixedreality.models.Identity - :param sku: The sku associated with this account. - :type sku: ~azure.mgmt.mixedreality.models.Sku - :param kind: The kind of account, if supported. - :type kind: ~azure.mgmt.mixedreality.models.Sku - :ivar system_data: System metadata for this account. - :vartype system_data: ~azure.mgmt.mixedreality.models.SystemData - :param storage_account_name: The name of the storage account associated with this accountId. - :type storage_account_name: str - :ivar account_id: unique id of certain account. - :vartype account_id: str - :ivar account_domain: Correspond domain name of certain Spatial Anchors Account. - :vartype account_domain: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'account_id': {'readonly': True}, - 'account_domain': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'plan': {'key': 'plan', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, - 'account_id': {'key': 'properties.accountId', 'type': 'str'}, - 'account_domain': {'key': 'properties.accountDomain', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SpatialAnchorsAccount, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.plan = kwargs.get('plan', None) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.system_data = None - self.storage_account_name = kwargs.get('storage_account_name', None) - self.account_id = None - self.account_domain = None - - -class SpatialAnchorsAccountPage(msrest.serialization.Model): - """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. - - :param value: List of resources supported by the Resource Provider. - :type value: list[~azure.mgmt.mixedreality.models.SpatialAnchorsAccount] - :param next_link: URL to get the next set of resource list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SpatialAnchorsAccount]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SpatialAnchorsAccountPage, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.mixedreality.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.mixedreality.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_models_py3.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_models_py3.py deleted file mode 100644 index aff31315baa..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/models/_models_py3.py +++ /dev/null @@ -1,894 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Dict, List, Optional, Union - -import msrest.serialization - -from ._mixed_reality_client_enums import * - - -class AccountKeyRegenerateRequest(msrest.serialization.Model): - """Request for account key regeneration. - - :param serial: serial of key to be regenerated. Possible values include: 1, 2. Default value: - "1". - :type serial: str or ~azure.mgmt.mixedreality.models.Serial - """ - - _attribute_map = { - 'serial': {'key': 'serial', 'type': 'int'}, - } - - def __init__( - self, - *, - serial: Optional[Union[int, "Serial"]] = "1", - **kwargs - ): - super(AccountKeyRegenerateRequest, self).__init__(**kwargs) - self.serial = serial - - -class AccountKeys(msrest.serialization.Model): - """Developer Keys of account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_key: value of primary key. - :vartype primary_key: str - :ivar secondary_key: value of secondary key. - :vartype secondary_key: str - """ - - _validation = { - 'primary_key': {'readonly': True}, - 'secondary_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AccountKeys, self).__init__(**kwargs) - self.primary_key = None - self.secondary_key = None - - -class CheckNameAvailabilityRequest(msrest.serialization.Model): - """Check Name Availability Request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Resource Name To Verify. - :type name: str - :param type: Required. Fully qualified resource type which includes provider namespace. - :type type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - type: str, - **kwargs - ): - super(CheckNameAvailabilityRequest, self).__init__(**kwargs) - self.name = name - self.type = type - - -class CheckNameAvailabilityResponse(msrest.serialization.Model): - """Check Name Availability Response. - - All required parameters must be populated in order to send to Azure. - - :param name_available: Required. if name Available. - :type name_available: bool - :param reason: Resource Name To Verify. Possible values include: "Invalid", "AlreadyExists". - :type reason: str or ~azure.mgmt.mixedreality.models.NameUnavailableReason - :param message: detail message. - :type message: str - """ - - _validation = { - 'name_available': {'required': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - *, - name_available: bool, - reason: Optional[Union[str, "NameUnavailableReason"]] = None, - message: Optional[str] = None, - **kwargs - ): - super(CheckNameAvailabilityResponse, self).__init__(**kwargs) - self.name_available = name_available - self.reason = reason - self.message = message - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from Azure. - - :param code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :type code: str - :param message: A message describing the error, intended to be suitable for displaying in a - user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.mixedreality.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - target: Optional[str] = None, - details: Optional[List["CloudErrorBody"]] = None, - **kwargs - ): - super(CloudErrorBody, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__( - self, - **kwargs - ): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - - -class LogSpecification(msrest.serialization.Model): - """Specifications of the Log for Azure Monitoring. - - :param name: Name of the log. - :type name: str - :param display_name: Localized friendly display name of the log. - :type display_name: str - :param blob_duration: Blob duration of the log. - :type blob_duration: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - blob_duration: Optional[str] = None, - **kwargs - ): - super(LogSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration - - -class MetricDimension(msrest.serialization.Model): - """Specifications of the Dimension of metrics. - - :param name: Name of the dimension. - :type name: str - :param display_name: Localized friendly display name of the dimension. - :type display_name: str - :param internal_name: Internal name of the dimension. - :type internal_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'internal_name': {'key': 'internalName', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - internal_name: Optional[str] = None, - **kwargs - ): - super(MetricDimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.internal_name = internal_name - - -class MetricSpecification(msrest.serialization.Model): - """Specifications of the Metrics for Azure Monitoring. - - :param name: Name of the metric. - :type name: str - :param display_name: Localized friendly display name of the metric. - :type display_name: str - :param display_description: Localized friendly description of the metric. - :type display_description: str - :param unit: Unit that makes sense for the metric. - :type unit: str - :param aggregation_type: Only provide one value for this field. Valid values: Average, Minimum, - Maximum, Total, Count. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - :param dimensions: Dimensions of the metric. - :type dimensions: list[~azure.mgmt.mixedreality.models.MetricDimension] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - display_description: Optional[str] = None, - unit: Optional[str] = None, - aggregation_type: Optional[str] = None, - internal_metric_name: Optional[str] = None, - dimensions: Optional[List["MetricDimension"]] = None, - **kwargs - ): - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.internal_metric_name = internal_metric_name - self.dimensions = dimensions - - -class Operation(msrest.serialization.Model): - """REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation}. - :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.mixedreality.models.OperationDisplay - :param is_data_action: Whether or not this is a data plane operation. - :type is_data_action: bool - :param origin: The origin. - :type origin: str - :param properties: Properties of the operation. - :type properties: ~azure.mgmt.mixedreality.models.OperationProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OperationProperties'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["OperationDisplay"] = None, - is_data_action: Optional[bool] = None, - origin: Optional[str] = None, - properties: Optional["OperationProperties"] = None, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.is_data_action = is_data_action - self.origin = origin - self.properties = properties - - -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. - - All required parameters must be populated in order to send to Azure. - - :param provider: Required. Service provider: Microsoft.ResourceProvider. - :type provider: str - :param resource: Required. Resource on which the operation is performed: Profile, endpoint, - etc. - :type resource: str - :param operation: Required. Operation type: Read, write, delete, etc. - :type operation: str - :param description: Required. Description of operation. - :type description: str - """ - - _validation = { - 'provider': {'required': True}, - 'resource': {'required': True}, - 'operation': {'required': True}, - 'description': {'required': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - provider: str, - resource: str, - operation: str, - description: str, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationPage(msrest.serialization.Model): - """Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get the next set of results. - - :param value: List of operations supported by the Resource Provider. - :type value: list[~azure.mgmt.mixedreality.models.Operation] - :param next_link: URL to get the next set of operation list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Operation"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(OperationPage, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class OperationProperties(msrest.serialization.Model): - """Operation properties. - - :param service_specification: Service specification. - :type service_specification: ~azure.mgmt.mixedreality.models.ServiceSpecification - """ - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - *, - service_specification: Optional["ServiceSpecification"] = None, - **kwargs - ): - super(OperationProperties, self).__init__(**kwargs) - self.service_specification = service_specification - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class RemoteRenderingAccount(TrackedResource): - """RemoteRenderingAccount Response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param identity: The identity associated with this account. - :type identity: ~azure.mgmt.mixedreality.models.Identity - :param plan: The plan associated with this account. - :type plan: ~azure.mgmt.mixedreality.models.Identity - :param sku: The sku associated with this account. - :type sku: ~azure.mgmt.mixedreality.models.Sku - :param kind: The kind of account, if supported. - :type kind: ~azure.mgmt.mixedreality.models.Sku - :ivar system_data: System metadata for this account. - :vartype system_data: ~azure.mgmt.mixedreality.models.SystemData - :param storage_account_name: The name of the storage account associated with this accountId. - :type storage_account_name: str - :ivar account_id: unique id of certain account. - :vartype account_id: str - :ivar account_domain: Correspond domain name of certain Spatial Anchors Account. - :vartype account_domain: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'account_id': {'readonly': True}, - 'account_domain': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'plan': {'key': 'plan', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, - 'account_id': {'key': 'properties.accountId', 'type': 'str'}, - 'account_domain': {'key': 'properties.accountDomain', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - plan: Optional["Identity"] = None, - sku: Optional["Sku"] = None, - kind: Optional["Sku"] = None, - storage_account_name: Optional[str] = None, - **kwargs - ): - super(RemoteRenderingAccount, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.plan = plan - self.sku = sku - self.kind = kind - self.system_data = None - self.storage_account_name = storage_account_name - self.account_id = None - self.account_domain = None - - -class RemoteRenderingAccountPage(msrest.serialization.Model): - """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. - - :param value: List of resources supported by the Resource Provider. - :type value: list[~azure.mgmt.mixedreality.models.RemoteRenderingAccount] - :param next_link: URL to get the next set of resource list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RemoteRenderingAccount]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["RemoteRenderingAccount"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(RemoteRenderingAccountPage, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ServiceSpecification(msrest.serialization.Model): - """Service specification payload. - - :param log_specifications: Specifications of the Log for Azure Monitoring. - :type log_specifications: list[~azure.mgmt.mixedreality.models.LogSpecification] - :param metric_specifications: Specifications of the Metrics for Azure Monitoring. - :type metric_specifications: list[~azure.mgmt.mixedreality.models.MetricSpecification] - """ - - _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__( - self, - *, - log_specifications: Optional[List["LogSpecification"]] = None, - metric_specifications: Optional[List["MetricSpecification"]] = None, - **kwargs - ): - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = log_specifications - self.metric_specifications = metric_specifications - - -class Sku(msrest.serialization.Model): - """The resource model definition representing SKU. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. - :type name: str - :param tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier, but is not required on a PUT. Possible values include: "Free", "Basic", - "Standard", "Premium". - :type tier: str or ~azure.mgmt.mixedreality.models.SkuTier - :param size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :type size: str - :param family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :type family: str - :param capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :type capacity: int - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SpatialAnchorsAccount(TrackedResource): - """SpatialAnchorsAccount Response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :param identity: The identity associated with this account. - :type identity: ~azure.mgmt.mixedreality.models.Identity - :param plan: The plan associated with this account. - :type plan: ~azure.mgmt.mixedreality.models.Identity - :param sku: The sku associated with this account. - :type sku: ~azure.mgmt.mixedreality.models.Sku - :param kind: The kind of account, if supported. - :type kind: ~azure.mgmt.mixedreality.models.Sku - :ivar system_data: System metadata for this account. - :vartype system_data: ~azure.mgmt.mixedreality.models.SystemData - :param storage_account_name: The name of the storage account associated with this accountId. - :type storage_account_name: str - :ivar account_id: unique id of certain account. - :vartype account_id: str - :ivar account_domain: Correspond domain name of certain Spatial Anchors Account. - :vartype account_domain: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'account_id': {'readonly': True}, - 'account_domain': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'plan': {'key': 'plan', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, - 'account_id': {'key': 'properties.accountId', 'type': 'str'}, - 'account_domain': {'key': 'properties.accountDomain', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - plan: Optional["Identity"] = None, - sku: Optional["Sku"] = None, - kind: Optional["Sku"] = None, - storage_account_name: Optional[str] = None, - **kwargs - ): - super(SpatialAnchorsAccount, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.plan = plan - self.sku = sku - self.kind = kind - self.system_data = None - self.storage_account_name = storage_account_name - self.account_id = None - self.account_domain = None - - -class SpatialAnchorsAccountPage(msrest.serialization.Model): - """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. - - :param value: List of resources supported by the Resource Provider. - :type value: list[~azure.mgmt.mixedreality.models.SpatialAnchorsAccount] - :param next_link: URL to get the next set of resource list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SpatialAnchorsAccount]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["SpatialAnchorsAccount"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(SpatialAnchorsAccountPage, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.mixedreality.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.mixedreality.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/__init__.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/__init__.py deleted file mode 100644 index 93f9fc77519..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._mixed_reality_client_operations import MixedRealityClientOperationsMixin -from ._spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations -from ._remote_rendering_accounts_operations import RemoteRenderingAccountsOperations - -__all__ = [ - 'Operations', - 'MixedRealityClientOperationsMixin', - 'SpatialAnchorsAccountsOperations', - 'RemoteRenderingAccountsOperations', -] diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_mixed_reality_client_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_mixed_reality_client_operations.py deleted file mode 100644 index 2c8bd9b22be..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_mixed_reality_client_operations.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class MixedRealityClientOperationsMixin(object): - - def check_name_availability_local( - self, - location, # type: str - check_name_availability, # type: "_models.CheckNameAvailabilityRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.CheckNameAvailabilityResponse" - """Check Name Availability for local uniqueness. - - :param location: The location in which uniqueness will be verified. - :type location: str - :param check_name_availability: Check Name Availability Request. - :type check_name_availability: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CheckNameAvailabilityResponse, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability_local.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(check_name_availability, 'CheckNameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CheckNameAvailabilityResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - check_name_availability_local.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_operations.py deleted file mode 100644 index 9e1eb53efef..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_operations.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.mixedreality.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationPage"] - """Exposing Available Operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationPage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.OperationPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MixedReality/operations'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_remote_rendering_accounts_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_remote_rendering_accounts_operations.py deleted file mode 100644 index 4c414958d1f..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_remote_rendering_accounts_operations.py +++ /dev/null @@ -1,563 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class RemoteRenderingAccountsOperations(object): - """RemoteRenderingAccountsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.mixedreality.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RemoteRenderingAccountPage"] - """List Remote Rendering Accounts by Subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RemoteRenderingAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RemoteRenderingAccountPage"] - """List Resources by Resource Group. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RemoteRenderingAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - account_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - account_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RemoteRenderingAccount" - """Retrieve a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RemoteRenderingAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - account_name, # type: str - remote_rendering_account, # type: "_models.RemoteRenderingAccount" - **kwargs # type: Any - ): - # type: (...) -> "_models.RemoteRenderingAccount" - """Updating a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param remote_rendering_account: Remote Rendering Account parameter. - :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RemoteRenderingAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(remote_rendering_account, 'RemoteRenderingAccount') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - def create( - self, - resource_group_name, # type: str - account_name, # type: str - remote_rendering_account, # type: "_models.RemoteRenderingAccount" - **kwargs # type: Any - ): - # type: (...) -> "_models.RemoteRenderingAccount" - """Creating or Updating a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param remote_rendering_account: Remote Rendering Account parameter. - :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RemoteRenderingAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(remote_rendering_account, 'RemoteRenderingAccount') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore - - def list_keys( - self, - resource_group_name, # type: str - account_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountKeys" - """List Both of the 2 Keys of a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.list_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys'} # type: ignore - - def regenerate_keys( - self, - resource_group_name, # type: str - account_name, # type: str - regenerate, # type: "_models.AccountKeyRegenerateRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountKeys" - """Regenerate specified Key of a Remote Rendering Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param regenerate: Required information for key regeneration. - :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.regenerate_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(regenerate, 'AccountKeyRegenerateRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_spatial_anchors_accounts_operations.py b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_spatial_anchors_accounts_operations.py deleted file mode 100644 index 2b87553c3eb..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/operations/_spatial_anchors_accounts_operations.py +++ /dev/null @@ -1,563 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SpatialAnchorsAccountsOperations(object): - """SpatialAnchorsAccountsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.mixedreality.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SpatialAnchorsAccountPage"] - """List Spatial Anchors Accounts by Subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SpatialAnchorsAccountPage"] - """List Resources by Resource Group. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - account_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - account_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SpatialAnchorsAccount" - """Retrieve a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SpatialAnchorsAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - account_name, # type: str - spatial_anchors_account, # type: "_models.SpatialAnchorsAccount" - **kwargs # type: Any - ): - # type: (...) -> "_models.SpatialAnchorsAccount" - """Updating a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param spatial_anchors_account: Spatial Anchors Account parameter. - :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SpatialAnchorsAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - def create( - self, - resource_group_name, # type: str - account_name, # type: str - spatial_anchors_account, # type: "_models.SpatialAnchorsAccount" - **kwargs # type: Any - ): - # type: (...) -> "_models.SpatialAnchorsAccount" - """Creating or Updating a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param spatial_anchors_account: Spatial Anchors Account parameter. - :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SpatialAnchorsAccount, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore - - def list_keys( - self, - resource_group_name, # type: str - account_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountKeys" - """List Both of the 2 Keys of a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - accept = "application/json" - - # Construct URL - url = self.list_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys'} # type: ignore - - def regenerate_keys( - self, - resource_group_name, # type: str - account_name, # type: str - regenerate, # type: "_models.AccountKeyRegenerateRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.AccountKeys" - """Regenerate specified Key of a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Name of an Mixed Reality Account. - :type account_name: str - :param regenerate: Required information for key regeneration. - :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountKeys, or the result of cls(response) - :rtype: ~azure.mgmt.mixedreality.models.AccountKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.regenerate_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(regenerate, 'AccountKeyRegenerateRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AccountKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/py.typed b/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/mixed-reality/azext_mixed_reality/vendored_sdks/mixedreality/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/mixed-reality/setup.py b/src/mixed-reality/setup.py index 957148b010d..968bd348a50 100644 --- a/src/mixed-reality/setup.py +++ b/src/mixed-reality/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.0.4" +VERSION = "0.0.5" CLASSIFIERS = [ 'Development Status :: 4 - Beta',