diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md b/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md index 7ac12d338c01..1252453de711 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md +++ b/sdk/mixedreality/azure-mgmt-mixedreality/CHANGELOG.md @@ -1,5 +1,78 @@ # Release History +## 1.0.0b1 (2020-12-14) + +This is beta preview version. + +This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming). + +**General breaking changes** + +- Credential system has been completly revamped: + + - `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/ + - `credentials` parameter has been renamed `credential` + +- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of + supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) +- You can't import a `version` module anymore, use `__version__` instead +- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`. +- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed). +- Most of the operation kwarg have changed. Some of the most noticeable: + + - `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user + - For a complete set of + supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) + +**General new features** + +- Type annotations support using `typing`. SDKs are mypy ready. +- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client. +- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview. + +## 0.2.0 (2020-05-25) + +**Features** + + - Added operation SpatialAnchorsAccountsOperations.list_keys + - Added operation SpatialAnchorsAccountsOperations.get + - Added operation SpatialAnchorsAccountsOperations.regenerate_keys + - Added operation SpatialAnchorsAccountsOperations.delete + - Added operation group MixedRealityClientOperationsMixin + - Added operation group RemoteRenderingAccountsOperations + +**Breaking changes** + + - Operation SpatialAnchorsAccountsOperations.create has a new signature + - Operation SpatialAnchorsAccountsOperations.update has a new signature + - Removed operation SpatialAnchorsAccountsOperations.get_keys + +**General Breaking Changes** + +This version uses a next-generation code generator that *might* +introduce breaking changes. In summary, some modules were incorrectly +visible/importable and have been renamed. This fixed several issues +caused by usage of classes that were not supposed to be used in the +first place. + + - MixedRealityClient cannot be imported from + `azure.mgmt.mixedreality.mixed_reality_client` anymore (import from + `azure.mgmt.mixedreality` works like before) + - MixedRealityClientConfiguration import has been moved from + `azure.mgmt.mixedreality.mixedreality_client` + to `azure.mgmt.mixedreality` + - A model `MyClass` from a "models" sub-module cannot be imported + anymore using `azure.mgmt.mixedreality.models.my_class` (import from + `azure.mgmt.mixedreality.models` works like before) + - An operation class `MyClassOperations` from an `operations` + sub-module cannot be imported anymore using + `azure.mgmt.mixedreality.operations.my_class_operations` (import from + `azure.mgmt.mixedreality.operations` works like before) + +Last but not least, HTTP connection pooling is now enabled by default. +You should always use a client as a context manager, or call close(), or +use no more than one client per process. + ## 0.1.0 (2019-02-05) - Initial Release diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/README.md b/sdk/mixedreality/azure-mgmt-mixedreality/README.md index ebf4a6ff9157..fa0665c799ff 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/README.md +++ b/sdk/mixedreality/azure-mgmt-mixedreality/README.md @@ -16,9 +16,15 @@ For a more complete set of Azure libraries, see the ## Usage -For code examples, see [Mixed Reality -Management](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [Mixed Reality Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + ## Provide Feedback diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/__init__.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/__init__.py index 33a6cc06425b..91382c743576 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/__init__.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/__init__.py @@ -1,18 +1,19 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from .mixed_reality_client import MixedRealityClient -from .version import VERSION - -__all__ = ['MixedRealityClient'] +from ._mixed_reality_client import MixedRealityClient +from ._version import VERSION __version__ = VERSION +__all__ = ['MixedRealityClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_configuration.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_configuration.py new file mode 100644 index 000000000000..7bb1ebd2b551 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class MixedRealityClientConfiguration(Configuration): + """Configuration for MixedRealityClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MixedRealityClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-mixedreality/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/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 new file mode 100644 index 000000000000..d5680b34be3a --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_mixed_reality_client.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import MixedRealityClientConfiguration +from .operations import Operations +from .operations import MixedRealityClientOperationsMixin +from .operations import SpatialAnchorsAccountsOperations +from .operations import RemoteRenderingAccountsOperations +from . import models + + +class MixedRealityClient(MixedRealityClientOperationsMixin): + """Mixed Reality Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.mixedreality.operations.Operations + :ivar spatial_anchors_accounts: SpatialAnchorsAccountsOperations operations + :vartype spatial_anchors_accounts: azure.mgmt.mixedreality.operations.SpatialAnchorsAccountsOperations + :ivar remote_rendering_accounts: RemoteRenderingAccountsOperations operations + :vartype remote_rendering_accounts: azure.mgmt.mixedreality.operations.RemoteRenderingAccountsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = MixedRealityClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.spatial_anchors_accounts = SpatialAnchorsAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.remote_rendering_accounts = RemoteRenderingAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MixedRealityClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/version.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_version.py similarity index 84% rename from sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/version.py rename to sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_version.py index e0ec669828cb..515f51c112dd 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/version.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/_version.py @@ -1,13 +1,10 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" 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/aio/__init__.py similarity index 61% rename from sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/mixed_reality_client_enums.py rename to sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/__init__.py index ec9c0d08dad7..e254a9f5f572 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/aio/__init__.py @@ -1,24 +1,10 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class NameAvailability(str, Enum): - - true = "true" - false = "false" - - -class NameUnavailableReason(str, Enum): - - invalid = "Invalid" - already_exists = "AlreadyExists" +from ._mixed_reality_client import MixedRealityClient +__all__ = ['MixedRealityClient'] 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 new file mode 100644 index 000000000000..7db18cbeb100 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class MixedRealityClientConfiguration(Configuration): + """Configuration for MixedRealityClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MixedRealityClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-mixedreality/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/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 new file mode 100644 index 000000000000..67a2d75e177c --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/_mixed_reality_client.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import MixedRealityClientConfiguration +from .operations import Operations +from .operations import MixedRealityClientOperationsMixin +from .operations import SpatialAnchorsAccountsOperations +from .operations import RemoteRenderingAccountsOperations +from .. import models + + +class MixedRealityClient(MixedRealityClientOperationsMixin): + """Mixed Reality Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.mixedreality.aio.operations.Operations + :ivar spatial_anchors_accounts: SpatialAnchorsAccountsOperations operations + :vartype spatial_anchors_accounts: azure.mgmt.mixedreality.aio.operations.SpatialAnchorsAccountsOperations + :ivar remote_rendering_accounts: RemoteRenderingAccountsOperations operations + :vartype remote_rendering_accounts: azure.mgmt.mixedreality.aio.operations.RemoteRenderingAccountsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = MixedRealityClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.spatial_anchors_accounts = SpatialAnchorsAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.remote_rendering_accounts = RemoteRenderingAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MixedRealityClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/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 new file mode 100644 index 000000000000..93f9fc77519e --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._mixed_reality_client_operations import MixedRealityClientOperationsMixin +from ._spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations +from ._remote_rendering_accounts_operations import RemoteRenderingAccountsOperations + +__all__ = [ + 'Operations', + 'MixedRealityClientOperationsMixin', + 'SpatialAnchorsAccountsOperations', + 'RemoteRenderingAccountsOperations', +] diff --git a/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 new file mode 100644 index 000000000000..7e6e327f4fc9 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_mixed_reality_client_operations.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MixedRealityClientOperationsMixin: + + async def check_name_availability_local( + self, + location: str, + check_name_availability: "_models.CheckNameAvailabilityRequest", + **kwargs + ) -> "_models.CheckNameAvailabilityResponse": + """Check Name Availability for local uniqueness. + + :param location: The location in which uniqueness will be verified. + :type location: str + :param check_name_availability: Check Name Availability Request. + :type check_name_availability: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResponse, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability_local.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_name_availability, 'CheckNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability_local.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability'} # type: ignore diff --git a/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 new file mode 100644 index 000000000000..bf247590bb4d --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.mixedreality.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.OperationPage"]: + """Exposing Available Operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationPage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.OperationPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.MixedReality/operations'} # type: ignore diff --git a/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 new file mode 100644 index 000000000000..7ad58b4565e2 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_remote_rendering_accounts_operations.py @@ -0,0 +1,559 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RemoteRenderingAccountsOperations: + """RemoteRenderingAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.mixedreality.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.RemoteRenderingAccountPage"]: + """List Remote Rendering Accounts by Subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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('RemoteRenderingAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.RemoteRenderingAccountPage"]: + """List Resources by Resource Group. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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('RemoteRenderingAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + """Delete a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.RemoteRenderingAccount": + """Retrieve a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemoteRenderingAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + remote_rendering_account: "_models.RemoteRenderingAccount", + **kwargs + ) -> "_models.RemoteRenderingAccount": + """Updating a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param remote_rendering_account: Remote Rendering Account parameter. + :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemoteRenderingAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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(remote_rendering_account, 'RemoteRenderingAccount') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + remote_rendering_account: "_models.RemoteRenderingAccount", + **kwargs + ) -> "_models.RemoteRenderingAccount": + """Creating or Updating a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param remote_rendering_account: Remote Rendering Account parameter. + :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemoteRenderingAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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(remote_rendering_account, 'RemoteRenderingAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.AccountKeys": + """List Both of the 2 Keys of a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys'} # type: ignore + + async def regenerate_keys( + self, + resource_group_name: str, + account_name: str, + regenerate: "_models.AccountKeyRegenerateRequest", + **kwargs + ) -> "_models.AccountKeys": + """Regenerate specified Key of a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param regenerate: Required information for key regeneration. + :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/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 new file mode 100644 index 000000000000..bc673555b606 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/aio/operations/_spatial_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 SpatialAnchorsAccountsOperations: + """SpatialAnchorsAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.mixedreality.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.SpatialAnchorsAccountPage"]: + """List Spatial Anchors Accounts by Subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.SpatialAnchorsAccountPage"]: + """List Resources by Resource Group. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + """Delete a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.SpatialAnchorsAccount": + """Retrieve a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SpatialAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + spatial_anchors_account: "_models.SpatialAnchorsAccount", + **kwargs + ) -> "_models.SpatialAnchorsAccount": + """Updating a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param spatial_anchors_account: Spatial Anchors Account parameter. + :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SpatialAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + spatial_anchors_account: "_models.SpatialAnchorsAccount", + **kwargs + ) -> "_models.SpatialAnchorsAccount": + """Creating or Updating a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param spatial_anchors_account: Spatial Anchors Account parameter. + :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SpatialAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "_models.AccountKeys": + """List Both of the 2 Keys of a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys'} # type: ignore + + async def regenerate_keys( + self, + resource_group_name: str, + account_name: str, + regenerate: "_models.AccountKeyRegenerateRequest", + **kwargs + ) -> "_models.AccountKeys": + """Regenerate specified Key of a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param regenerate: Required information for key regeneration. + :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(regenerate, 'AccountKeyRegenerateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/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 deleted file mode 100644 index 596e34b0a66f..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/mixed_reality_client.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from msrest.pipeline import ClientRawResponse -import uuid -from .operations.operations import Operations -from .operations.spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations -from . import models - - -class MixedRealityClientConfiguration(AzureConfiguration): - """Configuration for MixedRealityClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Azure subscription ID. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(MixedRealityClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-mixedreality/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class MixedRealityClient(SDKClient): - """Mixed Reality Client - - :ivar config: Configuration for client. - :vartype config: MixedRealityClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.mixedreality.operations.Operations - :ivar spatial_anchors_accounts: SpatialAnchorsAccounts operations - :vartype spatial_anchors_accounts: azure.mgmt.mixedreality.operations.SpatialAnchorsAccountsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Azure subscription ID. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = MixedRealityClientConfiguration(credentials, subscription_id, base_url) - super(MixedRealityClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-02-28-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.spatial_anchors_accounts = SpatialAnchorsAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - - def check_name_availability_local( - self, location, name, type, custom_headers=None, raw=False, **operation_config): - """Check Name Availability for global uniqueness. - - :param location: The location in which uniqueness will be verified. - :type location: str - :param name: Resource Name To Verify - :type name: str - :param type: Fully qualified resource type which includes provider - namespace - :type type: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CheckNameAvailabilityResponse or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityResponse - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - check_name_availability = models.CheckNameAvailabilityRequest(name=name, type=type) - - # Construct URL - url = self.check_name_availability_local.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(check_name_availability, 'CheckNameAvailabilityRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability_local.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability'} 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 2f6f1ed0fa1c..2738523d4d0f 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 @@ -1,62 +1,76 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: - from .check_name_availability_request_py3 import CheckNameAvailabilityRequest - from .check_name_availability_response_py3 import CheckNameAvailabilityResponse - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .spatial_anchors_account_py3 import SpatialAnchorsAccount - from .spatial_anchors_account_keys_py3 import SpatialAnchorsAccountKeys - from .spatial_anchors_account_key_regenerate_request_py3 import SpatialAnchorsAccountKeyRegenerateRequest - from .proxy_resource_py3 import ProxyResource - from .azure_entity_resource_py3 import AzureEntityResource - from .resource_py3 import Resource - from .tracked_resource_py3 import TrackedResource + from ._models_py3 import AccountKeyRegenerateRequest + 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 Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationPage + from ._models_py3 import RemoteRenderingAccount + from ._models_py3 import RemoteRenderingAccountIdentity + from ._models_py3 import RemoteRenderingAccountPage + from ._models_py3 import Resource + from ._models_py3 import SpatialAnchorsAccount + from ._models_py3 import SpatialAnchorsAccountPage + from ._models_py3 import TrackedResource except (SyntaxError, ImportError): - from .check_name_availability_request import CheckNameAvailabilityRequest - from .check_name_availability_response import CheckNameAvailabilityResponse - from .error_response import ErrorResponse, ErrorResponseException - from .operation_display import OperationDisplay - from .operation import Operation - from .spatial_anchors_account import SpatialAnchorsAccount - from .spatial_anchors_account_keys import SpatialAnchorsAccountKeys - from .spatial_anchors_account_key_regenerate_request import SpatialAnchorsAccountKeyRegenerateRequest - from .proxy_resource import ProxyResource - from .azure_entity_resource import AzureEntityResource - from .resource import Resource - from .tracked_resource import TrackedResource -from .operation_paged import OperationPaged -from .spatial_anchors_account_paged import SpatialAnchorsAccountPaged -from .mixed_reality_client_enums import ( + 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 Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationPage # 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 SpatialAnchorsAccount # type: ignore + from ._models import SpatialAnchorsAccountPage # type: ignore + from ._models import TrackedResource # type: ignore + +from ._mixed_reality_client_enums import ( NameAvailability, NameUnavailableReason, + Serial, ) __all__ = [ + 'AccountKeyRegenerateRequest', + 'AccountKeys', 'CheckNameAvailabilityRequest', 'CheckNameAvailabilityResponse', - 'ErrorResponse', 'ErrorResponseException', - 'OperationDisplay', + 'CloudErrorAutoGenerated', + 'CloudErrorBody', + 'CloudErrorBodyAutoGenerated', + 'Identity', 'Operation', - 'SpatialAnchorsAccount', - 'SpatialAnchorsAccountKeys', - 'SpatialAnchorsAccountKeyRegenerateRequest', - 'ProxyResource', - 'AzureEntityResource', + 'OperationDisplay', + 'OperationPage', + 'RemoteRenderingAccount', + 'RemoteRenderingAccountIdentity', + 'RemoteRenderingAccountPage', 'Resource', + 'SpatialAnchorsAccount', + 'SpatialAnchorsAccountPage', 'TrackedResource', - 'OperationPaged', - 'SpatialAnchorsAccountPaged', 'NameAvailability', 'NameUnavailableReason', + 'Serial', ] 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 new file mode 100644 index 000000000000..a33dae69c509 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_mixed_reality_client_enums.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class NameAvailability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether or not the name is available. + """ + + TRUE = "true" + FALSE = "false" + +class NameUnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """reason of name unavailable. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class Serial(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): + """serial of key to be regenerated + """ + + PRIMARY = 1 #: The Primary Key. + SECONDARY = 2 #: The Secondary Key. 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 new file mode 100644 index 000000000000..7bb0eaa77f5b --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models.py @@ -0,0 +1,605 @@ +# 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 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: + "1". + :type serial: str or ~azure.mgmt.mixedreality.models.Serial + """ + + _attribute_map = { + 'serial': {'key': 'serial', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountKeyRegenerateRequest, self).__init__(**kwargs) + self.serial = kwargs.get('serial', "1") + + +class AccountKeys(msrest.serialization.Model): + """Developer Keys of account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_key: value of primary key. + :vartype primary_key: str + :ivar secondary_key: value of secondary key. + :vartype secondary_key: str + """ + + _validation = { + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountKeys, self).__init__(**kwargs) + self.primary_key = None + self.secondary_key = None + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """Check Name Availability Request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource Name To Verify. + :type name: str + :param type: Required. Fully qualified resource type which includes provider namespace. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + + +class CheckNameAvailabilityResponse(msrest.serialization.Model): + """Check Name Availability Response. + + All required parameters must be populated in order to send to Azure. + + :param name_available: Required. if name Available. Possible values include: "true", "false". + :type name_available: str or ~azure.mgmt.mixedreality.models.NameAvailability + :param reason: Resource Name To Verify. Possible values include: "Invalid", "AlreadyExists". + :type reason: str or ~azure.mgmt.mixedreality.models.NameUnavailableReason + :param message: detail message. + :type message: str + """ + + _validation = { + 'name_available': {'required': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResponse, self).__init__(**kwargs) + self.name_available = kwargs['name_available'] + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class 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. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for displaying in a + user interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.mixedreality.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class 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 + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', 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 Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class RemoteRenderingAccount(TrackedResource): + """RemoteRenderingAccount Response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.mixedreality.models.Identity + :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}, + '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'}, + '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.account_id = None + self.account_domain = None + + +class RemoteRenderingAccountIdentity(Identity): + """RemoteRenderingAccountIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(RemoteRenderingAccountIdentity, self).__init__(**kwargs) + + +class RemoteRenderingAccountPage(msrest.serialization.Model): + """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. + + :param value: List of resources supported by the Resource Provider. + :type value: list[~azure.mgmt.mixedreality.models.RemoteRenderingAccount] + :param next_link: URL to get the next set of resource list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RemoteRenderingAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RemoteRenderingAccountPage, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SpatialAnchorsAccount(TrackedResource): + """SpatialAnchorsAccount Response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :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}, + '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'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'account_domain': {'key': 'properties.accountDomain', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SpatialAnchorsAccount, self).__init__(**kwargs) + self.account_id = None + self.account_domain = None + + +class SpatialAnchorsAccountPage(msrest.serialization.Model): + """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. + + :param value: List of resources supported by the Resource Provider. + :type value: list[~azure.mgmt.mixedreality.models.SpatialAnchorsAccount] + :param next_link: URL to get the next set of resource list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SpatialAnchorsAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SpatialAnchorsAccountPage, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) 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 new file mode 100644 index 000000000000..8d27e6a7db66 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/_models_py3.py @@ -0,0 +1,657 @@ +# 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 Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._mixed_reality_client_enums import * + + +class AccountKeyRegenerateRequest(msrest.serialization.Model): + """Request for account key regeneration. + + :param serial: serial of key to be regenerated. Possible values include: 1, 2. Default value: + "1". + :type serial: str or ~azure.mgmt.mixedreality.models.Serial + """ + + _attribute_map = { + 'serial': {'key': 'serial', 'type': 'int'}, + } + + def __init__( + self, + *, + serial: Optional[Union[int, "Serial"]] = "1", + **kwargs + ): + super(AccountKeyRegenerateRequest, self).__init__(**kwargs) + self.serial = serial + + +class AccountKeys(msrest.serialization.Model): + """Developer Keys of account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_key: value of primary key. + :vartype primary_key: str + :ivar secondary_key: value of secondary key. + :vartype secondary_key: str + """ + + _validation = { + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountKeys, self).__init__(**kwargs) + self.primary_key = None + self.secondary_key = None + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """Check Name Availability Request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource Name To Verify. + :type name: str + :param type: Required. Fully qualified resource type which includes provider namespace. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: str, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResponse(msrest.serialization.Model): + """Check Name Availability Response. + + All required parameters must be populated in order to send to Azure. + + :param name_available: Required. if name Available. Possible values include: "true", "false". + :type name_available: str or ~azure.mgmt.mixedreality.models.NameAvailability + :param reason: Resource Name To Verify. Possible values include: "Invalid", "AlreadyExists". + :type reason: str or ~azure.mgmt.mixedreality.models.NameUnavailableReason + :param message: detail message. + :type message: str + """ + + _validation = { + 'name_available': {'required': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Union[str, "NameAvailability"], + reason: Optional[Union[str, "NameUnavailableReason"]] = None, + message: Optional[str] = None, + **kwargs + ): + super(CheckNameAvailabilityResponse, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class 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. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for displaying in a + user interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.mixedreality.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class 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 + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +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 Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class RemoteRenderingAccount(TrackedResource): + """RemoteRenderingAccount Response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.mixedreality.models.Identity + :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}, + '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'}, + '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, + **kwargs + ): + super(RemoteRenderingAccount, self).__init__(tags=tags, location=location, **kwargs) + self.identity = identity + self.account_id = None + self.account_domain = None + + +class RemoteRenderingAccountIdentity(Identity): + """RemoteRenderingAccountIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(RemoteRenderingAccountIdentity, self).__init__(**kwargs) + + +class RemoteRenderingAccountPage(msrest.serialization.Model): + """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. + + :param value: List of resources supported by the Resource Provider. + :type value: list[~azure.mgmt.mixedreality.models.RemoteRenderingAccount] + :param next_link: URL to get the next set of resource list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RemoteRenderingAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["RemoteRenderingAccount"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RemoteRenderingAccountPage, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SpatialAnchorsAccount(TrackedResource): + """SpatialAnchorsAccount Response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :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}, + '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'}, + '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, + **kwargs + ): + super(SpatialAnchorsAccount, self).__init__(tags=tags, location=location, **kwargs) + self.account_id = None + self.account_domain = None + + +class SpatialAnchorsAccountPage(msrest.serialization.Model): + """Result of the request to get resource collection. It contains a list of resources and a URL link to get the next set of results. + + :param value: List of resources supported by the Resource Provider. + :type value: list[~azure.mgmt.mixedreality.models.SpatialAnchorsAccount] + :param next_link: URL to get the next set of resource list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SpatialAnchorsAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SpatialAnchorsAccount"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SpatialAnchorsAccountPage, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/azure_entity_resource.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/azure_entity_resource.py deleted file mode 100644 index 3bffaab8d35b..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/azure_entity_resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/azure_entity_resource_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/azure_entity_resource_py3.py deleted file mode 100644 index d3f80d87498a..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/azure_entity_resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_request.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_request.py deleted file mode 100644 index e1aa259520cb..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_request.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailabilityRequest(Model): - """Check Name Availability Request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Resource Name To Verify - :type name: str - :param type: Required. Fully qualified resource type which includes - provider namespace - :type type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_request_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_request_py3.py deleted file mode 100644 index dac0f4c44698..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_request_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailabilityRequest(Model): - """Check Name Availability Request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Resource Name To Verify - :type name: str - :param type: Required. Fully qualified resource type which includes - provider namespace - :type type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, name: str, type: str, **kwargs) -> None: - super(CheckNameAvailabilityRequest, self).__init__(**kwargs) - self.name = name - self.type = type diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_response.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_response.py deleted file mode 100644 index a59f17979408..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_response.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailabilityResponse(Model): - """Check Name Availability Response. - - 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 reason: Resource Name To Verify. Possible values include: - 'Invalid', 'AlreadyExists' - :type reason: str or ~azure.mgmt.mixedreality.models.NameUnavailableReason - :param message: detail message - :type message: str - """ - - _validation = { - 'name_available': {'required': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResponse, self).__init__(**kwargs) - self.name_available = kwargs.get('name_available', None) - self.reason = kwargs.get('reason', None) - self.message = kwargs.get('message', None) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_response_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_response_py3.py deleted file mode 100644 index 5f4a2d747e2b..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/check_name_availability_response_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailabilityResponse(Model): - """Check Name Availability Response. - - 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 reason: Resource Name To Verify. Possible values include: - 'Invalid', 'AlreadyExists' - :type reason: str or ~azure.mgmt.mixedreality.models.NameUnavailableReason - :param message: detail message - :type message: str - """ - - _validation = { - 'name_available': {'required': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, name_available, reason=None, message: str=None, **kwargs) -> None: - super(CheckNameAvailabilityResponse, self).__init__(**kwargs) - self.name_available = name_available - self.reason = reason - self.message = message diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/error_response.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/error_response.py deleted file mode 100644 index 2b634c9e8d3f..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/error_response.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Response on Error. - - All required parameters must be populated in order to send to Azure. - - :param message: Required. Describes the error in detail and provides - debugging information - :type message: str - :param code: Required. String that can be used to programmatically - identify the error. - :type code: str - :param target: The target of the particular error - :type target: str - :param details: An array of JSON objects that MUST contain name/value - pairs for code and message, and MAY contain a name/value pair for target, - as described above.The contents of this section are service-defined but - must adhere to the aforementioned schema. - :type details: str - """ - - _validation = { - 'message': {'required': True}, - 'code': {'required': True}, - } - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.message = kwargs.get('message', None) - self.code = kwargs.get('code', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/error_response_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/error_response_py3.py deleted file mode 100644 index 1ef7fa39db89..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/error_response_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Response on Error. - - All required parameters must be populated in order to send to Azure. - - :param message: Required. Describes the error in detail and provides - debugging information - :type message: str - :param code: Required. String that can be used to programmatically - identify the error. - :type code: str - :param target: The target of the particular error - :type target: str - :param details: An array of JSON objects that MUST contain name/value - pairs for code and message, and MAY contain a name/value pair for target, - as described above.The contents of this section are service-defined but - must adhere to the aforementioned schema. - :type details: str - """ - - _validation = { - 'message': {'required': True}, - 'code': {'required': True}, - } - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, *, message: str, code: str, target: str=None, details: str=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.message = message - self.code = code - self.target = target - self.details = details - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation.py deleted file mode 100644 index 2b9435bd2d7a..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(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 - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_display.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_display.py deleted file mode 100644 index 29348349a9fe..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_display.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(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.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_display_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_display_py3.py deleted file mode 100644 index f65eae9bd2e5..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_display_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(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) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_paged.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_paged.py deleted file mode 100644 index dee538fcd455..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_py3.py deleted file mode 100644 index c53c28916c17..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/operation_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(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 - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/proxy_resource.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/proxy_resource.py deleted file mode 100644 index 0de8fb6bd420..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/proxy_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ProxyResource, self).__init__(**kwargs) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/proxy_resource_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/proxy_resource_py3.py deleted file mode 100644 index 2e8391f912d6..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/proxy_resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/resource.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/resource.py deleted file mode 100644 index 9333a2ac49ef..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/resource.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/resource_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/resource_py3.py deleted file mode 100644 index 370e6c506581..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/resource_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account.py deleted file mode 100644 index 89d874459fb0..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource import TrackedResource - - -class SpatialAnchorsAccount(TrackedResource): - """SpatialAnchorsAccount Response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar account_id: unique id of certain Spatial Anchors Account data - contract. - :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}, - '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'}, - 'account_id': {'key': 'properties.accountId', 'type': 'str'}, - 'account_domain': {'key': 'properties.accountDomain', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SpatialAnchorsAccount, self).__init__(**kwargs) - self.account_id = None - self.account_domain = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_key_regenerate_request.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_key_regenerate_request.py deleted file mode 100644 index 1a92b80bdbcf..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_key_regenerate_request.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SpatialAnchorsAccountKeyRegenerateRequest(Model): - """Spatial Anchors Account Regenerate Key. - - :param serial: serial of key to be regenerated. Default value: 1 . - :type serial: int - """ - - _attribute_map = { - 'serial': {'key': 'serial', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(SpatialAnchorsAccountKeyRegenerateRequest, self).__init__(**kwargs) - self.serial = kwargs.get('serial', 1) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_key_regenerate_request_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_key_regenerate_request_py3.py deleted file mode 100644 index dea9cfd09e20..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_key_regenerate_request_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SpatialAnchorsAccountKeyRegenerateRequest(Model): - """Spatial Anchors Account Regenerate Key. - - :param serial: serial of key to be regenerated. Default value: 1 . - :type serial: int - """ - - _attribute_map = { - 'serial': {'key': 'serial', 'type': 'int'}, - } - - def __init__(self, *, serial: int=1, **kwargs) -> None: - super(SpatialAnchorsAccountKeyRegenerateRequest, self).__init__(**kwargs) - self.serial = serial diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_keys.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_keys.py deleted file mode 100644 index 26bbc99148aa..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_keys.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SpatialAnchorsAccountKeys(Model): - """Spatial Anchors Account Keys. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar primary_key: value of primary key. - :vartype primary_key: str - :ivar secondary_key: value of secondary key. - :vartype secondary_key: str - """ - - _validation = { - 'primary_key': {'readonly': True}, - 'secondary_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SpatialAnchorsAccountKeys, self).__init__(**kwargs) - self.primary_key = None - self.secondary_key = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_keys_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_keys_py3.py deleted file mode 100644 index 8ac66b434626..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_keys_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SpatialAnchorsAccountKeys(Model): - """Spatial Anchors Account Keys. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar primary_key: value of primary key. - :vartype primary_key: str - :ivar secondary_key: value of secondary key. - :vartype secondary_key: str - """ - - _validation = { - 'primary_key': {'readonly': True}, - 'secondary_key': {'readonly': True}, - } - - _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SpatialAnchorsAccountKeys, self).__init__(**kwargs) - self.primary_key = None - self.secondary_key = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_paged.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_paged.py deleted file mode 100644 index 4cabf7994f92..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class SpatialAnchorsAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`SpatialAnchorsAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SpatialAnchorsAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(SpatialAnchorsAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_py3.py deleted file mode 100644 index 8d590b1ad68a..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/spatial_anchors_account_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource_py3 import TrackedResource - - -class SpatialAnchorsAccount(TrackedResource): - """SpatialAnchorsAccount Response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar account_id: unique id of certain Spatial Anchors Account data - contract. - :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}, - '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'}, - 'account_id': {'key': 'properties.accountId', 'type': 'str'}, - 'account_domain': {'key': 'properties.accountDomain', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(SpatialAnchorsAccount, self).__init__(tags=tags, location=location, **kwargs) - self.account_id = None - self.account_domain = None diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/tracked_resource.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/tracked_resource.py deleted file mode 100644 index 27ab94c7a8dd..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/tracked_resource.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. - - 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. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/tracked_resource_py3.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/tracked_resource_py3.py deleted file mode 100644 index b28cc1859448..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/models/tracked_resource_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. - - 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. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location 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 9e026b5e32a6..93f9fc77519e 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 @@ -1,18 +1,19 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations +from ._operations import Operations +from ._mixed_reality_client_operations import MixedRealityClientOperationsMixin +from ._spatial_anchors_accounts_operations import SpatialAnchorsAccountsOperations +from ._remote_rendering_accounts_operations import RemoteRenderingAccountsOperations __all__ = [ 'Operations', + 'MixedRealityClientOperationsMixin', 'SpatialAnchorsAccountsOperations', + 'RemoteRenderingAccountsOperations', ] diff --git a/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 new file mode 100644 index 000000000000..02a5456f2f44 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_mixed_reality_client_operations.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MixedRealityClientOperationsMixin(object): + + def check_name_availability_local( + self, + location, # type: str + check_name_availability, # type: "_models.CheckNameAvailabilityRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.CheckNameAvailabilityResponse" + """Check Name Availability for local uniqueness. + + :param location: The location in which uniqueness will be verified. + :type location: str + :param check_name_availability: Check Name Availability Request. + :type check_name_availability: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResponse, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.CheckNameAvailabilityResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability_local.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_name_availability, 'CheckNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability_local.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability'} # type: ignore diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_operations.py new file mode 100644 index 000000000000..5dfefa22f1ac --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.mixedreality.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationPage"] + """Exposing Available Operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationPage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.OperationPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.MixedReality/operations'} # type: ignore diff --git a/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 new file mode 100644 index 000000000000..f4a0c34d8d2a --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_remote_rendering_accounts_operations.py @@ -0,0 +1,571 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RemoteRenderingAccountsOperations(object): + """RemoteRenderingAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.mixedreality.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RemoteRenderingAccountPage"] + """List Remote Rendering Accounts by Subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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('RemoteRenderingAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RemoteRenderingAccountPage"] + """List Resources by Resource Group. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RemoteRenderingAccountPage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.RemoteRenderingAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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('RemoteRenderingAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RemoteRenderingAccount" + """Retrieve a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemoteRenderingAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + remote_rendering_account, # type: "_models.RemoteRenderingAccount" + **kwargs # type: Any + ): + # type: (...) -> "_models.RemoteRenderingAccount" + """Updating a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param remote_rendering_account: Remote Rendering Account parameter. + :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemoteRenderingAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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(remote_rendering_account, 'RemoteRenderingAccount') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + remote_rendering_account, # type: "_models.RemoteRenderingAccount" + **kwargs # type: Any + ): + # type: (...) -> "_models.RemoteRenderingAccount" + """Creating or Updating a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param remote_rendering_account: Remote Rendering Account parameter. + :type remote_rendering_account: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemoteRenderingAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.RemoteRenderingAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemoteRenderingAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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(remote_rendering_account, 'RemoteRenderingAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RemoteRenderingAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AccountKeys" + """List Both of the 2 Keys of a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/listKeys'} # type: ignore + + def regenerate_keys( + self, + resource_group_name, # type: str + account_name, # type: str + regenerate, # type: "_models.AccountKeyRegenerateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.AccountKeys" + """Regenerate specified Key of a Remote Rendering Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param regenerate: Required information for key regeneration. + :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-04-06-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) + error = self._deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/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 new file mode 100644 index 000000000000..c05986cbfdd5 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/_spatial_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 SpatialAnchorsAccountsOperations(object): + """SpatialAnchorsAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.mixedreality.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SpatialAnchorsAccountPage"] + """List Spatial Anchors Accounts by Subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SpatialAnchorsAccountPage"] + """List Resources by Resource Group. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SpatialAnchorsAccountPage or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPage] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccountPage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SpatialAnchorsAccountPage', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SpatialAnchorsAccount" + """Retrieve a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SpatialAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + spatial_anchors_account, # type: "_models.SpatialAnchorsAccount" + **kwargs # type: Any + ): + # type: (...) -> "_models.SpatialAnchorsAccount" + """Updating a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param spatial_anchors_account: Spatial Anchors Account parameter. + :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SpatialAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + spatial_anchors_account, # type: "_models.SpatialAnchorsAccount" + **kwargs # type: Any + ): + # type: (...) -> "_models.SpatialAnchorsAccount" + """Creating or Updating a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param spatial_anchors_account: Spatial Anchors Account parameter. + :type spatial_anchors_account: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SpatialAnchorsAccount, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SpatialAnchorsAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SpatialAnchorsAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AccountKeys" + """List Both of the 2 Keys of a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/listKeys'} # type: ignore + + def regenerate_keys( + self, + resource_group_name, # type: str + account_name, # type: str + regenerate, # type: "_models.AccountKeyRegenerateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.AccountKeys" + """Regenerate specified Key of a Spatial Anchors Account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Name of an Mixed Reality Account. + :type account_name: str + :param regenerate: Required information for key regeneration. + :type regenerate: ~azure.mgmt.mixedreality.models.AccountKeyRegenerateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountKeys, or the result of cls(response) + :rtype: ~azure.mgmt.mixedreality.models.AccountKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(regenerate, 'AccountKeyRegenerateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccountKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys'} # type: ignore diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/operations.py b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/operations.py deleted file mode 100644 index 50c1145c401a..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/operations.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class Operations(object): - """Operations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-02-28-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-02-28-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Exposing Available Operations. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Operation - :rtype: - ~azure.mgmt.mixedreality.models.OperationPaged[~azure.mgmt.mixedreality.models.Operation] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.MixedReality/operations'} 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 deleted file mode 100644 index 942be4085044..000000000000 --- a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/operations/spatial_anchors_accounts_operations.py +++ /dev/null @@ -1,559 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class SpatialAnchorsAccountsOperations(object): - """SpatialAnchorsAccountsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-02-28-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-02-28-preview" - - self.config = config - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """List Spatial Anchors Accounts by Subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SpatialAnchorsAccount - :rtype: - ~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccount] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.SpatialAnchorsAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SpatialAnchorsAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """List Resources by Resource Group. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SpatialAnchorsAccount - :rtype: - ~azure.mgmt.mixedreality.models.SpatialAnchorsAccountPaged[~azure.mgmt.mixedreality.models.SpatialAnchorsAccount] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.SpatialAnchorsAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SpatialAnchorsAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'} - - def delete( - self, resource_group_name, spatial_anchors_account_name, custom_headers=None, raw=False, **operation_config): - """Delete a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param spatial_anchors_account_name: Name of an Mixed Reality Spatial - Anchors Account. - :type spatial_anchors_account_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - 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\._\(\)]+$'), - 'spatialAnchorsAccountName': self._serialize.url("spatial_anchors_account_name", spatial_anchors_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'} - - def get( - self, resource_group_name, spatial_anchors_account_name, custom_headers=None, raw=False, **operation_config): - """Retrieve a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param spatial_anchors_account_name: Name of an Mixed Reality Spatial - Anchors Account. - :type spatial_anchors_account_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SpatialAnchorsAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - 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\._\(\)]+$'), - 'spatialAnchorsAccountName': self._serialize.url("spatial_anchors_account_name", spatial_anchors_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SpatialAnchorsAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'} - - def update( - self, resource_group_name, spatial_anchors_account_name, location, tags=None, custom_headers=None, raw=False, **operation_config): - """Updating a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param spatial_anchors_account_name: Name of an Mixed Reality Spatial - Anchors Account. - :type spatial_anchors_account_name: str - :param location: The geo-location where the resource lives - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SpatialAnchorsAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - spatial_anchors_account = models.SpatialAnchorsAccount(tags=tags, location=location) - - # Construct URL - url = self.update.metadata['url'] - 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\._\(\)]+$'), - 'spatialAnchorsAccountName': self._serialize.url("spatial_anchors_account_name", spatial_anchors_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SpatialAnchorsAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'} - - def create( - self, resource_group_name, spatial_anchors_account_name, location, tags=None, custom_headers=None, raw=False, **operation_config): - """Creating or Updating a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param spatial_anchors_account_name: Name of an Mixed Reality Spatial - Anchors Account. - :type spatial_anchors_account_name: str - :param location: The geo-location where the resource lives - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SpatialAnchorsAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccount or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - spatial_anchors_account = models.SpatialAnchorsAccount(tags=tags, location=location) - - # Construct URL - url = self.create.metadata['url'] - 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\._\(\)]+$'), - 'spatialAnchorsAccountName': self._serialize.url("spatial_anchors_account_name", spatial_anchors_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(spatial_anchors_account, 'SpatialAnchorsAccount') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SpatialAnchorsAccount', response) - if response.status_code == 201: - deserialized = self._deserialize('SpatialAnchorsAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'} - - def get_keys( - self, resource_group_name, spatial_anchors_account_name, custom_headers=None, raw=False, **operation_config): - """Get Both of the 2 Keys of a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param spatial_anchors_account_name: Name of an Mixed Reality Spatial - Anchors Account. - :type spatial_anchors_account_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SpatialAnchorsAccountKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccountKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_keys.metadata['url'] - 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\._\(\)]+$'), - 'spatialAnchorsAccountName': self._serialize.url("spatial_anchors_account_name", spatial_anchors_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SpatialAnchorsAccountKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys'} - - def regenerate_keys( - self, resource_group_name, spatial_anchors_account_name, serial=1, custom_headers=None, raw=False, **operation_config): - """Regenerate 1 Key of a Spatial Anchors Account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param spatial_anchors_account_name: Name of an Mixed Reality Spatial - Anchors Account. - :type spatial_anchors_account_name: str - :param serial: serial of key to be regenerated - :type serial: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SpatialAnchorsAccountKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.mixedreality.models.SpatialAnchorsAccountKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - spatial_anchors_account_key_regenerate = models.SpatialAnchorsAccountKeyRegenerateRequest(serial=serial) - - # Construct URL - url = self.regenerate_keys.metadata['url'] - 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\._\(\)]+$'), - 'spatialAnchorsAccountName': self._serialize.url("spatial_anchors_account_name", spatial_anchors_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(spatial_anchors_account_key_regenerate, 'SpatialAnchorsAccountKeyRegenerateRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SpatialAnchorsAccountKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys'} diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/py.typed b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/mixedreality/azure-mgmt-mixedreality/azure/mgmt/mixedreality/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/mixedreality/azure-mgmt-mixedreality/setup.py b/sdk/mixedreality/azure-mgmt-mixedreality/setup.py index c01a6af6cc25..4f475665555d 100644 --- a/sdk/mixedreality/azure-mgmt-mixedreality/setup.py +++ b/sdk/mixedreality/azure-mgmt-mixedreality/setup.py @@ -36,7 +36,7 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -79,8 +79,8 @@ ]), install_requires=[ 'msrest>=0.5.0', - 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', ], extras_require={ ":python_version<'3.0'": ['azure-mgmt-nspkg'],