From c113c4e7fb16234e2b75ea6dd855a1492256569d Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Tue, 27 Apr 2021 16:10:42 +0800 Subject: [PATCH] [AutoRelease] t2-mixedreality-2021-04-27-17135(wave4) (#18339) * CodeGen from PR 14105 in Azure/azure-rest-api-specs mixedreality t2 readme config(wave4) (#14105) * mixedreality t2 readme config * t2 config del * version,CHANGELOG * changelog config Co-authored-by: SDKAuto Co-authored-by: PythonSdkPipelines Co-authored-by: Zed <601306339@qq.com> --- .../azure-mgmt-mixedreality/CHANGELOG.md | 20 + .../azure-mgmt-mixedreality/MANIFEST.in | 1 + .../azure-mgmt-mixedreality/_meta.json | 8 + .../azure/mgmt/mixedreality/_configuration.py | 1 + .../azure/mgmt/mixedreality/_metadata.json | 124 ++++ .../mixedreality/_mixed_reality_client.py | 24 + .../azure/mgmt/mixedreality/_version.py | 3 +- .../mgmt/mixedreality/aio/_configuration.py | 1 + .../mixedreality/aio/_mixed_reality_client.py | 23 + .../mixedreality/aio/operations/__init__.py | 2 + .../_mixed_reality_client_operations.py | 2 +- .../_object_anchors_accounts_operations.py | 551 +++++++++++++++ .../aio/operations/_operations.py | 2 +- .../_remote_rendering_accounts_operations.py | 40 +- .../_spatial_anchors_accounts_operations.py | 16 +- .../mgmt/mixedreality/models/__init__.py | 45 +- .../models/_mixed_reality_client_enums.py | 28 +- .../azure/mgmt/mixedreality/models/_models.py | 550 +++++++++++---- .../mgmt/mixedreality/models/_models_py3.py | 630 ++++++++++++++---- .../mgmt/mixedreality/operations/__init__.py | 2 + .../_mixed_reality_client_operations.py | 2 +- .../_object_anchors_accounts_operations.py | 563 ++++++++++++++++ .../mixedreality/operations/_operations.py | 2 +- .../_remote_rendering_accounts_operations.py | 40 +- .../_spatial_anchors_accounts_operations.py | 16 +- .../azure-mgmt-mixedreality/setup.py | 2 +- shared_requirements.txt | 1 + 27 files changed, 2364 insertions(+), 335 deletions(-) create mode 100644 sdk/mixedreality/azure-mgmt-mixedreality/_meta.json create mode 100644 sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_metadata.json create mode 100644 sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_object_anchors_accounts_operations.py create mode 100644 sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_object_anchors_accounts_operations.py diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md b/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md index 1252453de711..e86064540a8a 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md +++ b/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md @@ -1,5 +1,25 @@ # Release History +## 1.0.0 (2021-04-27) + +**Features** + + - Model Operation has a new parameter properties + - Model Operation has a new parameter origin + - Model Operation has a new parameter is_data_action + - Model SpatialAnchorsAccount has a new parameter plan + - Model SpatialAnchorsAccount has a new parameter system_data + - Model SpatialAnchorsAccount has a new parameter sku + - Model SpatialAnchorsAccount has a new parameter identity + - Model SpatialAnchorsAccount has a new parameter storage_account_name + - Model SpatialAnchorsAccount has a new parameter kind + - Model RemoteRenderingAccount has a new parameter plan + - Model RemoteRenderingAccount has a new parameter system_data + - Model RemoteRenderingAccount has a new parameter sku + - Model RemoteRenderingAccount has a new parameter storage_account_name + - Model RemoteRenderingAccount has a new parameter kind + - Added operation group ObjectAnchorsAccountsOperations + ## 1.0.0b1 (2020-12-14) This is beta preview version. diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/MANIFEST.in b/sdk/mixedreality/azure-mgmt-mixedreality/MANIFEST.in index fa6ea7e65b7a..d85e83afdf6e 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/MANIFEST.in +++ b/sdk/mixedreality/azure-mgmt-mixedreality/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json include *.md include azure/__init__.py include azure/mgmt/__init__.py diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/_meta.json b/sdk/mixedreality/azure-mgmt-mixedreality/_meta.json new file mode 100644 index 000000000000..ed178900391b --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "3.3.0", + "use": "@autorest/python@5.6.6", + "commit": "4e6a4ff608dde7a2312d13ce0d939e2126aa86e1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/mixedreality/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0", + "readme": "specification/mixedreality/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_configuration.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_configuration.py index 7bb1ebd2b551..12558168cad0 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_configuration.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_configuration.py @@ -48,6 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-03-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-mixedreality/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_metadata.json b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_metadata.json new file mode 100644 index 000000000000..3bce270dec23 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_metadata.json @@ -0,0 +1,124 @@ +{ + "chosen_version": "2021-03-01-preview", + "total_api_version_list": ["2021-03-01-preview"], + "client": { + "name": "MixedRealityClient", + "filename": "_mixed_reality_client", + "description": "Mixed Reality Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MixedRealityClientConfiguration\"], \"._operations_mixin\": [\"MixedRealityClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MixedRealityClientConfiguration\"], \"._operations_mixin\": [\"MixedRealityClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "spatial_anchors_accounts": "SpatialAnchorsAccountsOperations", + "remote_rendering_accounts": "RemoteRenderingAccountsOperations", + "object_anchors_accounts": "ObjectAnchorsAccountsOperations" + }, + "operation_mixins": { + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "operations": { + "check_name_availability_local" : { + "sync": { + "signature": "def check_name_availability_local(\n self,\n location, # type: str\n check_name_availability, # type: \"_models.CheckNameAvailabilityRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Check Name Availability for local uniqueness.\n\n:param location: The location in which uniqueness will be verified.\n:type location: str\n:param check_name_availability: Check Name Availability Request.\n:type check_name_availability: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CheckNameAvailabilityResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def check_name_availability_local(\n self,\n location: str,\n check_name_availability: \"_models.CheckNameAvailabilityRequest\",\n **kwargs\n) -\u003e \"_models.CheckNameAvailabilityResponse\":\n", + "doc": "\"\"\"Check Name Availability for local uniqueness.\n\n:param location: The location in which uniqueness will be verified.\n:type location: str\n:param check_name_availability: Check Name Availability Request.\n:type check_name_availability: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CheckNameAvailabilityResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "location, check_name_availability" + } + } + } +} \ No newline at end of file diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_mixed_reality_client.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_mixed_reality_client.py index d5680b34be3a..4c1c6376906f 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_mixed_reality_client.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_mixed_reality_client.py @@ -16,12 +16,14 @@ 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 .operations import ObjectAnchorsAccountsOperations from . import models @@ -34,6 +36,8 @@ class MixedRealityClient(MixedRealityClientOperationsMixin): :vartype spatial_anchors_accounts: azure.mgmt.mixedreality.operations.SpatialAnchorsAccountsOperations :ivar remote_rendering_accounts: RemoteRenderingAccountsOperations operations :vartype remote_rendering_accounts: azure.mgmt.mixedreality.operations.RemoteRenderingAccountsOperations + :ivar object_anchors_accounts: ObjectAnchorsAccountsOperations operations + :vartype object_anchors_accounts: azure.mgmt.mixedreality.operations.ObjectAnchorsAccountsOperations :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). @@ -65,6 +69,26 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.remote_rendering_accounts = RemoteRenderingAccountsOperations( self._client, self._config, self._serialize, self._deserialize) + self.object_anchors_accounts = ObjectAnchorsAccountsOperations( + 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 diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_version.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_version.py index 515f51c112dd..c47f66669f1b 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_version.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_version.py @@ -6,5 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" - +VERSION = "1.0.0" diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_configuration.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_configuration.py index 7db18cbeb100..c24b816fdef7 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_configuration.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_configuration.py @@ -45,6 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-03-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-mixedreality/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_mixed_reality_client.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_mixed_reality_client.py index 67a2d75e177c..da7db155d7f1 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_mixed_reality_client.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_mixed_reality_client.py @@ -8,6 +8,7 @@ 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 @@ -20,6 +21,7 @@ from .operations import MixedRealityClientOperationsMixin from .operations import SpatialAnchorsAccountsOperations from .operations import RemoteRenderingAccountsOperations +from .operations import ObjectAnchorsAccountsOperations from .. import models @@ -32,6 +34,8 @@ class MixedRealityClient(MixedRealityClientOperationsMixin): :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 + :ivar object_anchors_accounts: ObjectAnchorsAccountsOperations operations + :vartype object_anchors_accounts: azure.mgmt.mixedreality.aio.operations.ObjectAnchorsAccountsOperations :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). @@ -62,6 +66,25 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.remote_rendering_accounts = RemoteRenderingAccountsOperations( self._client, self._config, self._serialize, self._deserialize) + self.object_anchors_accounts = ObjectAnchorsAccountsOperations( + 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() diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/__init__.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/__init__.py index 93f9fc77519e..bd924689db66 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/__init__.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/__init__.py @@ -10,10 +10,12 @@ from ._mixed_reality_client_operations import MixedRealityClientOperationsMixin from ._spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations from ._remote_rendering_accounts_operations import RemoteRenderingAccountsOperations +from ._object_anchors_accounts_operations import ObjectAnchorsAccountsOperations __all__ = [ 'Operations', 'MixedRealityClientOperationsMixin', 'SpatialAnchorsAccountsOperations', 'RemoteRenderingAccountsOperations', + 'ObjectAnchorsAccountsOperations', ] diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_mixed_reality_client_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_mixed_reality_client_operations.py index 7e6e327f4fc9..1d435292a426 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_mixed_reality_client_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_mixed_reality_client_operations.py @@ -42,7 +42,7 @@ async def check_name_availability_local( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_object_anchors_accounts_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_object_anchors_accounts_operations.py new file mode 100644 index 000000000000..90bb7cccda3d --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_object_anchors_accounts_operations.py @@ -0,0 +1,551 @@ +# 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 ObjectAnchorsAccountsOperations: + """ObjectAnchorsAccountsOperations 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.ObjectAnchorsAccountPage"]: + """List Object 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 ObjectAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.ObjectAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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('ObjectAnchorsAccountPage', 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/objectAnchorsAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ObjectAnchorsAccountPage"]: + """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 ObjectAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.ObjectAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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('ObjectAnchorsAccountPage', 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/objectAnchorsAccounts'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + """Delete an Object 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-03-01-preview" + 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/objectAnchorsAccounts/{accountName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.ObjectAnchorsAccount": + """Retrieve an Object 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: ObjectAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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('ObjectAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + object_anchors_account: "_models.ObjectAnchorsAccount", + **kwargs + ) -> "_models.ObjectAnchorsAccount": + """Updating an Object 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 object_anchors_account: Object Anchors Account parameter. + :type object_anchors_account: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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(object_anchors_account, 'ObjectAnchorsAccount') + 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('ObjectAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + object_anchors_account: "_models.ObjectAnchorsAccount", + **kwargs + ) -> "_models.ObjectAnchorsAccount": + """Creating or Updating an object 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 object_anchors_account: Object Anchors Account parameter. + :type object_anchors_account: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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(object_anchors_account, 'ObjectAnchorsAccount') + 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('ObjectAnchorsAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ObjectAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{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 an object 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-03-01-preview" + 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/objectAnchorsAccounts/{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 an object 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-03-01-preview" + 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/objectAnchorsAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_operations.py index bf247590bb4d..f89f93a74875 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_remote_rendering_accounts_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_remote_rendering_accounts_operations.py index 7ad58b4565e2..99afd8c2148e 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_remote_rendering_accounts_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_remote_rendering_accounts_operations.py @@ -57,7 +57,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -97,9 +97,8 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.CloudErrorAutoGenerated, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response @@ -127,7 +126,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -168,9 +167,8 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.CloudErrorAutoGenerated, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response @@ -201,7 +199,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -227,8 +225,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -257,7 +254,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -283,8 +280,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) @@ -319,7 +315,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -350,8 +346,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) @@ -386,7 +381,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -417,8 +412,7 @@ async def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) @@ -454,7 +448,7 @@ async def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -480,8 +474,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('AccountKeys', pipeline_response) @@ -516,7 +509,7 @@ async def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -547,8 +540,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('AccountKeys', pipeline_response) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_spatial_anchors_accounts_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_spatial_anchors_accounts_operations.py index bc673555b606..6ef116fb0a3a 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_spatial_anchors_accounts_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_spatial_anchors_accounts_operations.py @@ -57,7 +57,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -126,7 +126,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -199,7 +199,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -254,7 +254,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -315,7 +315,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -381,7 +381,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -448,7 +448,7 @@ async def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -509,7 +509,7 @@ async def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/__init__.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/__init__.py index 2738523d4d0f..0b0f1c6f0b7f 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/__init__.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/__init__.py @@ -11,44 +11,59 @@ from ._models_py3 import AccountKeys from ._models_py3 import CheckNameAvailabilityRequest from ._models_py3 import CheckNameAvailabilityResponse - from ._models_py3 import CloudErrorAutoGenerated from ._models_py3 import CloudErrorBody - from ._models_py3 import CloudErrorBodyAutoGenerated from ._models_py3 import Identity + from ._models_py3 import LogSpecification + from ._models_py3 import MetricDimension + from ._models_py3 import MetricSpecification + from ._models_py3 import ObjectAnchorsAccount + from ._models_py3 import ObjectAnchorsAccountIdentity + from ._models_py3 import ObjectAnchorsAccountPage 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 RemoteRenderingAccountIdentity 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 CloudErrorAutoGenerated # type: ignore from ._models import CloudErrorBody # type: ignore - from ._models import CloudErrorBodyAutoGenerated # 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 ObjectAnchorsAccount # type: ignore + from ._models import ObjectAnchorsAccountIdentity # type: ignore + from ._models import ObjectAnchorsAccountPage # 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 RemoteRenderingAccountIdentity # 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 ( - NameAvailability, + CreatedByType, NameUnavailableReason, Serial, + SkuTier, ) __all__ = [ @@ -56,21 +71,29 @@ 'AccountKeys', 'CheckNameAvailabilityRequest', 'CheckNameAvailabilityResponse', - 'CloudErrorAutoGenerated', 'CloudErrorBody', - 'CloudErrorBodyAutoGenerated', 'Identity', + 'LogSpecification', + 'MetricDimension', + 'MetricSpecification', + 'ObjectAnchorsAccount', + 'ObjectAnchorsAccountIdentity', + 'ObjectAnchorsAccountPage', 'Operation', 'OperationDisplay', 'OperationPage', + 'OperationProperties', 'RemoteRenderingAccount', - 'RemoteRenderingAccountIdentity', 'RemoteRenderingAccountPage', 'Resource', + 'ServiceSpecification', + 'Sku', 'SpatialAnchorsAccount', 'SpatialAnchorsAccountPage', + 'SystemData', 'TrackedResource', - 'NameAvailability', + 'CreatedByType', 'NameUnavailableReason', 'Serial', + 'SkuTier', ] diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_mixed_reality_client_enums.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_mixed_reality_client_enums.py index a33dae69c509..f8224cca395a 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_mixed_reality_client_enums.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_mixed_reality_client_enums.py @@ -26,12 +26,14 @@ def __getattr__(cls, name): raise AttributeError(name) -class NameAvailability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Whether or not the name is available. +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. """ - TRUE = "true" - FALSE = "false" + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" class NameUnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """reason of name unavailable. @@ -41,8 +43,20 @@ class NameUnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) ALREADY_EXISTS = "AlreadyExists" class Serial(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): - """serial of key to be regenerated + """Serial of key to be regenerated """ - PRIMARY = 1 #: The Primary Key. - SECONDARY = 2 #: The Secondary Key. + #: 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/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models.py index 7bb0eaa77f5b..32f3dd1c25da 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models.py @@ -6,14 +6,13 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azure.core.exceptions import HttpResponseError 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: + :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 """ @@ -95,8 +94,8 @@ class CheckNameAvailabilityResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name_available: Required. if name Available. Possible values include: "true", "false". - :type name_available: str or ~azure.mgmt.mixedreality.models.NameAvailability + :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. @@ -108,7 +107,7 @@ class CheckNameAvailabilityResponse(msrest.serialization.Model): } _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, 'reason': {'key': 'reason', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, } @@ -123,25 +122,6 @@ def __init__( self.message = kwargs.get('message', None) -class CloudErrorAutoGenerated(msrest.serialization.Model): - """An Error response. - - :param error: An error response from Azure. - :type error: ~azure.mgmt.mixedreality.models.CloudErrorBodyAutoGenerated - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBodyAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudErrorAutoGenerated, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - class CloudErrorBody(msrest.serialization.Model): """An error response from Azure. @@ -176,40 +156,6 @@ def __init__( self.details = kwargs.get('details', None) -class CloudErrorBodyAutoGenerated(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.CloudErrorBodyAutoGenerated] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[CloudErrorBodyAutoGenerated]'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudErrorBodyAutoGenerated, 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. @@ -246,91 +192,102 @@ def __init__( self.tenant_id = None -class Operation(msrest.serialization.Model): - """REST API operation. +class LogSpecification(msrest.serialization.Model): + """Specifications of the Log for Azure Monitoring. - :param name: Operation name: {provider}/{resource}/{operation}. + :param name: Name of the log. :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.mixedreality.models.OperationDisplay + :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': {'key': 'display', 'type': 'OperationDisplay'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } def __init__( self, **kwargs ): - super(Operation, self).__init__(**kwargs) + super(LogSpecification, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. - All required parameters must be populated in order to send to Azure. +class MetricDimension(msrest.serialization.Model): + """Specifications of the Dimension of metrics. - :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 + :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 """ - _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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', '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'] + 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 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. +class MetricSpecification(msrest.serialization.Model): + """Specifications of the Metrics for Azure Monitoring. - :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 + :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 = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + '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(OperationPage, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + 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 Resource(msrest.serialization.Model): @@ -415,8 +372,8 @@ def __init__( self.location = kwargs['location'] -class RemoteRenderingAccount(TrackedResource): - """RemoteRenderingAccount Response. +class ObjectAnchorsAccount(TrackedResource): + """ObjectAnchorsAccount Response. Variables are only populated by the server, and will be ignored when sending a request. @@ -434,8 +391,12 @@ class RemoteRenderingAccount(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.mixedreality.models.Identity + :param identity: + :type identity: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccountIdentity + :ivar system_data: The system metadata related to an object anchors 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. @@ -447,6 +408,7 @@ class RemoteRenderingAccount(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, 'account_id': {'readonly': True}, 'account_domain': {'readonly': True}, } @@ -457,7 +419,9 @@ class RemoteRenderingAccount(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, + 'identity': {'key': 'identity', 'type': 'ObjectAnchorsAccountIdentity'}, + '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'}, } @@ -466,14 +430,16 @@ def __init__( self, **kwargs ): - super(RemoteRenderingAccount, self).__init__(**kwargs) + super(ObjectAnchorsAccount, self).__init__(**kwargs) self.identity = kwargs.get('identity', None) + self.system_data = None + self.storage_account_name = kwargs.get('storage_account_name', None) self.account_id = None self.account_domain = None -class RemoteRenderingAccountIdentity(Identity): - """RemoteRenderingAccountIdentity. +class ObjectAnchorsAccountIdentity(Identity): + """ObjectAnchorsAccountIdentity. Variables are only populated by the server, and will be ignored when sending a request. @@ -503,7 +469,226 @@ def __init__( self, **kwargs ): - super(RemoteRenderingAccountIdentity, self).__init__(**kwargs) + super(ObjectAnchorsAccountIdentity, self).__init__(**kwargs) + + +class ObjectAnchorsAccountPage(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.ObjectAnchorsAccount] + :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': '[ObjectAnchorsAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectAnchorsAccountPage, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', 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 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): @@ -529,6 +714,75 @@ def __init__( 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. @@ -548,6 +802,18 @@ class SpatialAnchorsAccount(TrackedResource): :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. @@ -559,6 +825,7 @@ class SpatialAnchorsAccount(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, 'account_id': {'readonly': True}, 'account_domain': {'readonly': True}, } @@ -569,6 +836,12 @@ class SpatialAnchorsAccount(TrackedResource): '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'}, } @@ -578,6 +851,12 @@ def __init__( **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 @@ -603,3 +882,44 @@ def __init__( 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/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models_py3.py index 8d27e6a7db66..985a66f73875 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models_py3.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models_py3.py @@ -6,9 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Dict, List, Optional, Union -from azure.core.exceptions import HttpResponseError import msrest.serialization from ._mixed_reality_client_enums import * @@ -17,7 +17,7 @@ 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: + :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 """ @@ -104,8 +104,8 @@ class CheckNameAvailabilityResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name_available: Required. if name Available. Possible values include: "true", "false". - :type name_available: str or ~azure.mgmt.mixedreality.models.NameAvailability + :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. @@ -117,7 +117,7 @@ class CheckNameAvailabilityResponse(msrest.serialization.Model): } _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, 'reason': {'key': 'reason', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, } @@ -125,7 +125,7 @@ class CheckNameAvailabilityResponse(msrest.serialization.Model): def __init__( self, *, - name_available: Union[str, "NameAvailability"], + name_available: bool, reason: Optional[Union[str, "NameUnavailableReason"]] = None, message: Optional[str] = None, **kwargs @@ -136,27 +136,6 @@ def __init__( self.message = message -class CloudErrorAutoGenerated(msrest.serialization.Model): - """An Error response. - - :param error: An error response from Azure. - :type error: ~azure.mgmt.mixedreality.models.CloudErrorBodyAutoGenerated - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBodyAutoGenerated'}, - } - - def __init__( - self, - *, - error: Optional["CloudErrorBodyAutoGenerated"] = None, - **kwargs - ): - super(CloudErrorAutoGenerated, self).__init__(**kwargs) - self.error = error - - class CloudErrorBody(msrest.serialization.Model): """An error response from Azure. @@ -196,45 +175,6 @@ def __init__( self.details = details -class CloudErrorBodyAutoGenerated(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.CloudErrorBodyAutoGenerated] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[CloudErrorBodyAutoGenerated]'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - target: Optional[str] = None, - details: Optional[List["CloudErrorBodyAutoGenerated"]] = None, - **kwargs - ): - super(CloudErrorBodyAutoGenerated, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - class Identity(msrest.serialization.Model): """Identity for the resource. @@ -271,102 +211,118 @@ def __init__( self.tenant_id = None -class Operation(msrest.serialization.Model): - """REST API operation. +class LogSpecification(msrest.serialization.Model): + """Specifications of the Log for Azure Monitoring. - :param name: Operation name: {provider}/{resource}/{operation}. + :param name: Name of the log. :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.mixedreality.models.OperationDisplay + :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': {'key': 'display', 'type': 'OperationDisplay'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } def __init__( self, *, name: Optional[str] = None, - display: Optional["OperationDisplay"] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, **kwargs ): - super(Operation, self).__init__(**kwargs) + super(LogSpecification, self).__init__(**kwargs) self.name = name - self.display = display + self.display_name = display_name + self.blob_duration = blob_duration -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. - - All required parameters must be populated in order to send to Azure. +class MetricDimension(msrest.serialization.Model): + """Specifications of the Dimension of metrics. - :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 + :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 """ - _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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, } def __init__( self, *, - provider: str, - resource: str, - operation: str, - description: str, + name: Optional[str] = None, + display_name: Optional[str] = None, + internal_name: Optional[str] = None, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + super(MetricDimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name -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. +class MetricSpecification(msrest.serialization.Model): + """Specifications of the Metrics for Azure Monitoring. - :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 + :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 = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + '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, *, - value: Optional[List["Operation"]] = None, - next_link: Optional[str] = None, + 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(OperationPage, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + 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 Resource(msrest.serialization.Model): @@ -454,8 +410,8 @@ def __init__( self.location = location -class RemoteRenderingAccount(TrackedResource): - """RemoteRenderingAccount Response. +class ObjectAnchorsAccount(TrackedResource): + """ObjectAnchorsAccount Response. Variables are only populated by the server, and will be ignored when sending a request. @@ -473,8 +429,12 @@ class RemoteRenderingAccount(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.mixedreality.models.Identity + :param identity: + :type identity: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccountIdentity + :ivar system_data: The system metadata related to an object anchors 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. @@ -486,6 +446,7 @@ class RemoteRenderingAccount(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, 'account_id': {'readonly': True}, 'account_domain': {'readonly': True}, } @@ -496,7 +457,9 @@ class RemoteRenderingAccount(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, + 'identity': {'key': 'identity', 'type': 'ObjectAnchorsAccountIdentity'}, + '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'}, } @@ -506,17 +469,20 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, + identity: Optional["ObjectAnchorsAccountIdentity"] = None, + storage_account_name: Optional[str] = None, **kwargs ): - super(RemoteRenderingAccount, self).__init__(tags=tags, location=location, **kwargs) + super(ObjectAnchorsAccount, self).__init__(tags=tags, location=location, **kwargs) self.identity = identity + self.system_data = None + self.storage_account_name = storage_account_name self.account_id = None self.account_domain = None -class RemoteRenderingAccountIdentity(Identity): - """RemoteRenderingAccountIdentity. +class ObjectAnchorsAccountIdentity(Identity): + """ObjectAnchorsAccountIdentity. Variables are only populated by the server, and will be ignored when sending a request. @@ -546,7 +512,253 @@ def __init__( self, **kwargs ): - super(RemoteRenderingAccountIdentity, self).__init__(**kwargs) + super(ObjectAnchorsAccountIdentity, self).__init__(**kwargs) + + +class ObjectAnchorsAccountPage(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.ObjectAnchorsAccount] + :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': '[ObjectAnchorsAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ObjectAnchorsAccount"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ObjectAnchorsAccountPage, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +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 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): @@ -575,6 +787,84 @@ def __init__( 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. @@ -594,6 +884,18 @@ class SpatialAnchorsAccount(TrackedResource): :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. @@ -605,6 +907,7 @@ class SpatialAnchorsAccount(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, 'account_id': {'readonly': True}, 'account_domain': {'readonly': True}, } @@ -615,6 +918,12 @@ class SpatialAnchorsAccount(TrackedResource): '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'}, } @@ -624,9 +933,20 @@ def __init__( *, 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 @@ -655,3 +975,51 @@ def __init__( 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/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/__init__.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/__init__.py index 93f9fc77519e..bd924689db66 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/__init__.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/__init__.py @@ -10,10 +10,12 @@ from ._mixed_reality_client_operations import MixedRealityClientOperationsMixin from ._spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations from ._remote_rendering_accounts_operations import RemoteRenderingAccountsOperations +from ._object_anchors_accounts_operations import ObjectAnchorsAccountsOperations __all__ = [ 'Operations', 'MixedRealityClientOperationsMixin', 'SpatialAnchorsAccountsOperations', 'RemoteRenderingAccountsOperations', + 'ObjectAnchorsAccountsOperations', ] diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_mixed_reality_client_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_mixed_reality_client_operations.py index 02a5456f2f44..315191501c61 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_mixed_reality_client_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_mixed_reality_client_operations.py @@ -47,7 +47,7 @@ def check_name_availability_local( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_object_anchors_accounts_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_object_anchors_accounts_operations.py new file mode 100644 index 000000000000..28cff00721b9 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_object_anchors_accounts_operations.py @@ -0,0 +1,563 @@ +# 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 ObjectAnchorsAccountsOperations(object): + """ObjectAnchorsAccountsOperations 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.ObjectAnchorsAccountPage"] + """List Object 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 ObjectAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.ObjectAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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('ObjectAnchorsAccountPage', 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/objectAnchorsAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ObjectAnchorsAccountPage"] + """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 ObjectAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.ObjectAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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('ObjectAnchorsAccountPage', 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/objectAnchorsAccounts'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an Object 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-03-01-preview" + 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/objectAnchorsAccounts/{accountName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ObjectAnchorsAccount" + """Retrieve an Object 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: ObjectAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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('ObjectAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + object_anchors_account, # type: "_models.ObjectAnchorsAccount" + **kwargs # type: Any + ): + # type: (...) -> "_models.ObjectAnchorsAccount" + """Updating an Object 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 object_anchors_account: Object Anchors Account parameter. + :type object_anchors_account: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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(object_anchors_account, 'ObjectAnchorsAccount') + 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('ObjectAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{accountName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + object_anchors_account, # type: "_models.ObjectAnchorsAccount" + **kwargs # type: Any + ): + # type: (...) -> "_models.ObjectAnchorsAccount" + """Creating or Updating an object 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 object_anchors_account: Object Anchors Account parameter. + :type object_anchors_account: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.ObjectAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + 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(object_anchors_account, 'ObjectAnchorsAccount') + 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('ObjectAnchorsAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ObjectAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/objectAnchorsAccounts/{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 an object 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-03-01-preview" + 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/objectAnchorsAccounts/{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 an object 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-03-01-preview" + 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/objectAnchorsAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_operations.py index 5dfefa22f1ac..3935c22b4b0c 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_remote_rendering_accounts_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_remote_rendering_accounts_operations.py index f4a0c34d8d2a..60cf4dae1b2b 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_remote_rendering_accounts_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_remote_rendering_accounts_operations.py @@ -62,7 +62,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -102,9 +102,8 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.CloudErrorAutoGenerated, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response @@ -133,7 +132,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -174,9 +173,8 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.CloudErrorAutoGenerated, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response @@ -208,7 +206,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -234,8 +232,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -265,7 +262,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -291,8 +288,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) @@ -328,7 +324,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -359,8 +355,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) @@ -396,7 +391,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -427,8 +422,7 @@ def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) @@ -465,7 +459,7 @@ def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -491,8 +485,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('AccountKeys', pipeline_response) @@ -528,7 +521,7 @@ def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-06-preview" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -559,8 +552,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.CloudErrorAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('AccountKeys', pipeline_response) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_spatial_anchors_accounts_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_spatial_anchors_accounts_operations.py index c05986cbfdd5..e16f4740e83b 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_spatial_anchors_accounts_operations.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_spatial_anchors_accounts_operations.py @@ -62,7 +62,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -132,7 +132,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -206,7 +206,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -262,7 +262,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -324,7 +324,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -391,7 +391,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -459,7 +459,7 @@ def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -521,7 +521,7 @@ def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/setup.py b/sdk/mixedreality/azure-mgmt-mixedreality/setup.py index 4f475665555d..bd1df92970a2 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/setup.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/setup.py @@ -78,7 +78,7 @@ 'azure.mgmt', ]), install_requires=[ - 'msrest>=0.5.0', + 'msrest>=0.6.21', 'azure-common~=1.1', 'azure-mgmt-core>=1.2.0,<2.0.0', ], diff --git a/shared_requirements.txt b/shared_requirements.txt index 9136cc99878f..8e27a5f82f1b 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -262,3 +262,4 @@ opentelemetry-sdk<2.0.0,>=1.0.0 #override azure-purview-scanning azure-core<2.0.0,>=1.8.2 msrest>=0.6.21 #override azure-purview-catalog azure-core<2.0.0,>=1.8.2 msrest>=0.6.21 #override azure-mgmt-peering msrest>=0.6.21 +#override azure-mgmt-mixedreality msrest>=0.6.21