From 6e38768eaa4b473f57cfba6e7b151a2b71f32272 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 4 Nov 2024 06:00:38 +0000 Subject: [PATCH] CodeGen from PR 30681 in Azure/azure-rest-api-specs Merge a9592c53fdb13c0bf9a0ddb6c1cc96476b7be9f8 into cc6315290ff14f03f0c18904a109f82afac4a899 --- .../azure-mgmt-recoveryservices/_meta.json | 8 +- .../mgmt/recoveryservices/_configuration.py | 4 +- .../_recovery_services_client.py | 5 +- .../mgmt/recoveryservices/_serialization.py | 4 +- .../azure/mgmt/recoveryservices/_vendor.py | 10 - .../azure/mgmt/recoveryservices/_version.py | 2 +- .../recoveryservices/aio/_configuration.py | 4 +- .../aio/_recovery_services_client.py | 5 +- .../mgmt/recoveryservices/aio/_vendor.py | 2 - .../aio/operations/_operations.py | 16 +- .../_private_link_resources_operations.py | 21 +- .../_recovery_services_client_operations.py | 22 +- .../_recovery_services_operations.py | 22 +- .../_registered_identities_operations.py | 15 +- .../_replication_usages_operations.py | 16 +- .../aio/operations/_usages_operations.py | 16 +- .../_vault_certificates_operations.py | 17 +- .../_vault_extended_info_operations.py | 27 +- .../aio/operations/_vaults_operations.py | 96 +++--- .../operations/_operations.py | 17 +- .../_private_link_resources_operations.py | 24 +- .../_recovery_services_client_operations.py | 27 +- .../_recovery_services_operations.py | 25 +- .../_registered_identities_operations.py | 16 +- .../_replication_usages_operations.py | 17 +- .../operations/_usages_operations.py | 17 +- .../_vault_certificates_operations.py | 18 +- .../_vault_extended_info_operations.py | 32 +- .../operations/_vaults_operations.py | 107 ++++--- .../generated_samples/capabilities.py | 4 +- .../check_name_availability_available.py | 4 +- .../check_name_availability_not_available.py | 4 +- .../delete_registered_identities.py | 2 +- .../generated_samples/delete_vault.py | 2 +- .../generated_samples/get_operation_result.py | 2 +- .../generated_samples/get_operation_status.py | 2 +- .../get_private_link_resources.py | 2 +- .../generated_samples/get_vault.py | 2 +- .../get_vault_extended_info.py | 2 +- .../list_by_subscription_ids.py | 2 +- .../generated_samples/list_operations.py | 2 +- .../list_private_link_resources.py | 2 +- .../list_replication_usages.py | 2 +- .../generated_samples/list_resources.py | 2 +- .../generated_samples/list_usages.py | 2 +- .../generated_samples/patch_vault.py | 4 +- .../generated_samples/patch_vault_with_cmk.py | 4 +- .../patch_vault_with_cmk2.py | 4 +- .../patch_vault_with_cmk3.py | 4 +- .../patch_vault_with_monitoring_settings.py | 4 +- .../patch_vault_with_redundancy_settings.py | 4 +- ...patch_vault_with_user_assigned_identity.py | 4 +- .../generated_samples/put_vault.py | 4 +- .../generated_samples/put_vault_cred.py | 4 +- .../put_vault_resource_guard_enabled.py | 4 +- .../generated_samples/put_vault_with_cmk.py | 4 +- .../put_vault_with_monitoring_settings.py | 4 +- .../put_vault_with_redundancy_settings.py | 4 +- .../put_vault_with_user_assigned_identity.py | 4 +- .../generated_tests/conftest.py | 35 +++ .../generated_tests/test_recovery_services.py | 45 +++ .../test_recovery_services_async.py | 46 +++ .../test_recovery_services_operations.py | 29 ++ ...test_recovery_services_operations_async.py | 30 ++ ...vices_private_link_resources_operations.py | 44 +++ ...private_link_resources_operations_async.py | 45 +++ ...y_services_recovery_services_operations.py | 44 +++ ...ices_recovery_services_operations_async.py | 45 +++ ...rvices_registered_identities_operations.py | 32 ++ ..._registered_identities_operations_async.py | 33 ++ ..._services_replication_usages_operations.py | 31 ++ ...ces_replication_usages_operations_async.py | 32 ++ ...est_recovery_services_usages_operations.py | 31 ++ ...covery_services_usages_operations_async.py | 32 ++ ..._services_vault_certificates_operations.py | 33 ++ ...ces_vault_certificates_operations_async.py | 34 +++ ...services_vault_extended_info_operations.py | 75 +++++ ...es_vault_extended_info_operations_async.py | 76 +++++ ...est_recovery_services_vaults_operations.py | 274 +++++++++++++++++ ...covery_services_vaults_operations_async.py | 285 ++++++++++++++++++ .../azure-mgmt-recoveryservices/setup.py | 1 + 81 files changed, 1681 insertions(+), 357 deletions(-) create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/conftest.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations_async.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations_async.py diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json b/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json index f86654cb90f9..88d8a18125a0 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json @@ -1,11 +1,11 @@ { - "commit": "c4e661cdf92c8f579574008d0cd11874cc303da0", + "commit": "e05e26f3444236d6821e55a87aebb6889f45f9e1", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.7", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.13.7", + "@autorest/python@6.19.0", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/recoveryservices/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py index e63699055bbe..10d287457558 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py @@ -28,13 +28,13 @@ class RecoveryServicesClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + api_version: str = kwargs.pop("api_version", "2024-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py index 414bb7ce5a2c..2b4d7d184144 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py @@ -8,6 +8,7 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING +from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -67,7 +68,7 @@ class RecoveryServicesClient( :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -155,7 +156,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: def close(self) -> None: self._client.close() - def __enter__(self) -> "RecoveryServicesClient": + def __enter__(self) -> Self: self._client.__enter__() return self diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_serialization.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_serialization.py index 2f781d740827..8139854b97bb 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_serialization.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_serialization.py @@ -144,6 +144,8 @@ def _json_attemp(data): # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -1441,7 +1443,7 @@ def _deserialize(self, target_obj, data): elif isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) - if data is None: + if data is None or data is CoreNull: return data try: attributes = response._attribute_map # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py index cd2d51d3365b..80d905d1ec3f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py @@ -8,8 +8,6 @@ from abc import ABC from typing import TYPE_CHECKING -from azure.core.pipeline.transport import HttpRequest - from ._configuration import RecoveryServicesClientConfiguration if TYPE_CHECKING: @@ -19,14 +17,6 @@ from ._serialization import Deserializer, Serializer -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - class RecoveryServicesClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py index 2a3d642d309d..983cca4f75b2 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py @@ -28,13 +28,13 @@ class RecoveryServicesClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + api_version: str = kwargs.pop("api_version", "2024-10-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py index b1b833027939..3adad9fec25e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py @@ -8,6 +8,7 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING +from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -70,7 +71,7 @@ class RecoveryServicesClient( :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-10-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -160,7 +161,7 @@ def _send_request( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "RecoveryServicesClient": + async def __aenter__(self) -> Self: await self._client.__aenter__() return self diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_vendor.py index 27f589f38245..5df74568b532 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_vendor.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_vendor.py @@ -8,8 +8,6 @@ from abc import ABC from typing import TYPE_CHECKING -from azure.core.pipeline.transport import HttpRequest - from ._configuration import RecoveryServicesClientConfiguration if TYPE_CHECKING: diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py index 567c8058c7c5..21140b40b67f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,17 +20,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._operations import build_list_request -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ClientDiscoveryValueForS api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClientDiscoveryResponse] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -85,7 +87,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -101,7 +102,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py index 8c7b2d82174e..5cebfd13537c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,18 +20,19 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_get_request, build_list_request -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +80,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResources] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -97,7 +99,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -113,7 +114,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -161,7 +161,7 @@ async def get( :rtype: ~azure.mgmt.recoveryservices.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,7 +184,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -198,7 +197,7 @@ async def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("PrivateLinkResource", pipeline_response) + deserialized = self._deserialize("PrivateLinkResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py index f2cdb980c8e8..dc39f48c0f2a 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,25 +18,28 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._recovery_services_client_operations import ( build_get_operation_result_request, build_get_operation_status_request, ) from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class RecoveryServicesClientOperationsMixin(RecoveryServicesClientMixinABC): + @distributed_trace_async async def get_operation_status( self, resource_group_name: str, vault_name: str, operation_id: str, **kwargs: Any @@ -53,7 +57,7 @@ async def get_operation_status( :rtype: ~azure.mgmt.recoveryservices.models.OperationResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -76,7 +80,6 @@ async def get_operation_status( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -90,7 +93,7 @@ async def get_operation_status( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("OperationResource", pipeline_response) + deserialized = self._deserialize("OperationResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -114,7 +117,7 @@ async def get_operation_result( :rtype: ~azure.mgmt.recoveryservices.models.Vault or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +140,6 @@ async def get_operation_result( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -153,7 +155,7 @@ async def get_operation_result( deserialized = None if response.status_code == 200: - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py index c98b9122c88d..a40a71391c0a 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,20 +19,21 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._recovery_services_operations import ( build_capabilities_request, build_check_name_availability_request, ) -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -161,7 +163,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.recoveryservices.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +197,6 @@ async def check_name_availability( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -209,7 +210,7 @@ async def check_name_availability( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response) + deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -280,7 +281,7 @@ async def capabilities( :rtype: ~azure.mgmt.recoveryservices.models.CapabilitiesResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +314,6 @@ async def capabilities( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -327,7 +327,7 @@ async def capabilities( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("CapabilitiesResponse", pipeline_response) + deserialized = self._deserialize("CapabilitiesResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py index 4519dc1da3b2..c97a03f70975 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,17 +18,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._registered_identities_operations import build_delete_request -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +70,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -91,7 +93,6 @@ async def delete( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py index 7cdbcf491580..6a16fa67d24d 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,17 +20,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._replication_usages_operations import build_list_request -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +77,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ReplicationUsageList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -94,7 +96,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -110,7 +111,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py index b19b29651e3b..a4aaa5a9e0b1 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,17 +20,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._usages_operations import build_list_by_vaults_request -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +76,7 @@ def list_by_vaults( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VaultUsageList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -93,7 +95,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -109,7 +110,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py index 4fddac51a83c..3e9b07247beb 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,17 +19,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._vault_certificates_operations import build_create_request -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -137,7 +139,7 @@ async def create( :rtype: ~azure.mgmt.recoveryservices.models.VaultCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +174,6 @@ async def create( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -186,7 +187,7 @@ async def create( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultCertificateResponse", pipeline_response) + deserialized = self._deserialize("VaultCertificateResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py index 8c1bbc01741c..f4f25a6efd4b 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,21 +19,22 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request from ...operations._vault_extended_info_operations import ( build_create_or_update_request, build_get_request, build_update_request, ) -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +71,7 @@ async def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -91,7 +93,6 @@ async def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -105,7 +106,7 @@ async def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response) + deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -190,7 +191,7 @@ async def create_or_update( :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +225,6 @@ async def create_or_update( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -238,7 +238,7 @@ async def create_or_update( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response) + deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -323,7 +323,7 @@ async def update( :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -357,7 +357,6 @@ async def update( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -371,7 +370,7 @@ async def update( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response) + deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py index 4f8db333cc35..4eaad27dedb0 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -17,12 +18,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -30,7 +32,6 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._vaults_operations import ( build_create_or_update_request, build_delete_request, @@ -39,8 +40,11 @@ build_list_by_subscription_id_request, build_update_request, ) -from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +82,7 @@ def list_by_subscription_id(self, **kwargs: Any) -> AsyncIterable["_models.Vault api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VaultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -95,7 +99,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -111,7 +114,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -157,7 +159,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VaultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +177,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -191,7 +192,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -233,7 +233,7 @@ async def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.recoveryservices.models.Vault :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -255,7 +255,6 @@ async def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -269,7 +268,7 @@ async def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -283,8 +282,8 @@ async def _create_or_update_initial( vault: Union[_models.Vault, IO[bytes]], x_ms_authorization_auxiliary: Optional[str] = None, **kwargs: Any - ) -> _models.Vault: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +296,7 @@ async def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Vault] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -319,10 +318,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -330,14 +329,14 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass 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("Vault", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -451,10 +450,11 @@ async def begin_create_or_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -476,10 +476,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, vault_name: str, **kwargs: Any - ) -> None: - error_map = { + async def _delete_initial(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +489,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -501,10 +499,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -512,6 +510,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -520,8 +522,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -545,7 +551,7 @@ async def begin_delete(self, resource_group_name: str, vault_name: str, **kwargs lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( # type: ignore + raw_result = await self._delete_initial( resource_group_name=resource_group_name, vault_name=vault_name, api_version=api_version, @@ -554,6 +560,7 @@ async def begin_delete(self, resource_group_name: str, vault_name: str, **kwargs params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements @@ -582,8 +589,8 @@ async def _update_initial( vault: Union[_models.PatchVault, IO[bytes]], x_ms_authorization_auxiliary: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.Vault]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +603,7 @@ async def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.Vault]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -618,10 +625,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -629,12 +636,14 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -748,10 +757,11 @@ async def begin_update( params=_params, **kwargs ) + await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py index a293107f6247..60d96f3ec56e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py @@ -6,7 +6,8 @@ # 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, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -19,16 +20,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +43,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ClientDiscoveryValueForSingle api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClientDiscoveryResponse] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -106,7 +109,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -122,7 +124,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py index f0d62f2309b6..944361850201 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # 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, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -19,16 +20,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +43,7 @@ def build_list_request(resource_group_name: str, vault_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +144,7 @@ def list(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> Iter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResources] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +163,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -176,7 +178,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -224,7 +225,7 @@ def get( :rtype: ~azure.mgmt.recoveryservices.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +248,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -261,7 +261,7 @@ def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("PrivateLinkResource", pipeline_response) + deserialized = self._deserialize("PrivateLinkResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py index 59924b3d903e..59eba71cfcb6 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,16 +18,19 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +from .._vendor import RecoveryServicesClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +44,7 @@ def build_get_operation_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +78,7 @@ def build_get_operation_result_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,6 +107,7 @@ def build_get_operation_result_request( class RecoveryServicesClientOperationsMixin(RecoveryServicesClientMixinABC): + @distributed_trace def get_operation_status( self, resource_group_name: str, vault_name: str, operation_id: str, **kwargs: Any @@ -120,7 +125,7 @@ def get_operation_status( :rtype: ~azure.mgmt.recoveryservices.models.OperationResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,6 @@ def get_operation_status( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -157,7 +161,7 @@ def get_operation_status( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("OperationResource", pipeline_response) + deserialized = self._deserialize("OperationResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -181,7 +185,7 @@ def get_operation_result( :rtype: ~azure.mgmt.recoveryservices.models.Vault or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +208,6 @@ def get_operation_result( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -220,7 +223,7 @@ def get_operation_result( deserialized = None if response.status_code == 200: - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py index a86f08ad0f74..56cd12b4661f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,16 +19,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +44,7 @@ def build_check_name_availability_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -75,7 +78,7 @@ def build_capabilities_request(location: str, subscription_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -227,7 +230,7 @@ def check_name_availability( :rtype: ~azure.mgmt.recoveryservices.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +264,6 @@ def check_name_availability( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -275,7 +277,7 @@ def check_name_availability( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response) + deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -346,7 +348,7 @@ def capabilities( :rtype: ~azure.mgmt.recoveryservices.models.CapabilitiesResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +381,6 @@ def capabilities( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -393,7 +394,7 @@ def capabilities( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("CapabilitiesResponse", pipeline_response) + deserialized = self._deserialize("CapabilitiesResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py index 40e40196bff2..11b5f8dc82ed 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py @@ -6,7 +6,8 @@ # 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, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -17,16 +18,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +42,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -98,7 +101,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -121,7 +124,6 @@ def delete( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py index bc8043d645a3..e86f4d63bb6e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py @@ -6,7 +6,8 @@ # 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, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -19,16 +20,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +43,7 @@ def build_list_request(resource_group_name: str, vault_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +108,7 @@ def list(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> Iter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ReplicationUsageList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -124,7 +127,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -140,7 +142,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py index a042e06e158c..128ce1707a91 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py @@ -6,7 +6,8 @@ # 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, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -19,16 +20,18 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +45,7 @@ def build_list_by_vaults_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +112,7 @@ def list_by_vaults( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VaultUsageList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -128,7 +131,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -144,7 +146,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py index 5648257f09ee..048308930a7c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,16 +19,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +44,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -176,7 +179,7 @@ def create( :rtype: ~azure.mgmt.recoveryservices.models.VaultCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +214,6 @@ def create( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -225,7 +227,7 @@ def create( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultCertificateResponse", pipeline_response) + deserialized = self._deserialize("VaultCertificateResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py index 6e5813bb57fe..35f26e7cb73b 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,16 +19,18 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +42,7 @@ def build_get_request(resource_group_name: str, vault_name: str, subscription_id _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +75,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -106,7 +109,7 @@ def build_update_request(resource_group_name: str, vault_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -168,7 +171,7 @@ def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +193,6 @@ def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> _mode headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -204,7 +206,7 @@ def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> _mode map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response) + deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -289,7 +291,7 @@ def create_or_update( :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +325,6 @@ def create_or_update( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -337,7 +338,7 @@ def create_or_update( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response) + deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -422,7 +423,7 @@ def update( :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +457,6 @@ def update( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -470,7 +470,7 @@ def update( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response) + deserialized = self._deserialize("VaultExtendedInfoResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py index 8624f41eac90..721cc56b6cd0 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -16,13 +17,14 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat @@ -30,8 +32,11 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import RecoveryServicesClientMixinABC, _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_list_by_subscription_id_request(subscription_id: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +72,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def build_get_request(resource_group_name: str, vault_name: str, subscription_id _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +140,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -173,7 +178,7 @@ def build_delete_request(resource_group_name: str, vault_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +216,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -278,7 +283,7 @@ def list_by_subscription_id(self, **kwargs: Any) -> Iterable["_models.Vault"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VaultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +300,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -311,7 +315,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -357,7 +360,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VaultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -375,7 +378,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -391,7 +393,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -433,7 +434,7 @@ def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.recoveryservices.models.Vault :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -455,7 +456,6 @@ def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> _mode headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -469,7 +469,7 @@ def get(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> _mode map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -483,8 +483,8 @@ def _create_or_update_initial( vault: Union[_models.Vault, IO[bytes]], x_ms_authorization_auxiliary: Optional[str] = None, **kwargs: Any - ) -> _models.Vault: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ def _create_or_update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Vault] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -519,10 +519,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -530,14 +530,14 @@ def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass 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("Vault", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -651,10 +651,11 @@ def begin_create_or_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -676,10 +677,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, vault_name: str, **kwargs: Any - ) -> None: - error_map = { + def _delete_initial(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +690,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -701,10 +700,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -712,6 +711,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -720,8 +723,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code == 202: response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, vault_name: str, **kwargs: Any) -> LROPoller[None]: @@ -745,7 +752,7 @@ def begin_delete(self, resource_group_name: str, vault_name: str, **kwargs: Any) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( # type: ignore + raw_result = self._delete_initial( resource_group_name=resource_group_name, vault_name=vault_name, api_version=api_version, @@ -754,6 +761,7 @@ def begin_delete(self, resource_group_name: str, vault_name: str, **kwargs: Any) params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements @@ -782,8 +790,8 @@ def _update_initial( vault: Union[_models.PatchVault, IO[bytes]], x_ms_authorization_auxiliary: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.Vault]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -796,7 +804,7 @@ def _update_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.Vault]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -818,10 +826,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -829,12 +837,14 @@ def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -948,10 +958,11 @@ def begin_update( params=_params, **kwargs ) + raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Vault", pipeline_response) + deserialized = self._deserialize("Vault", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/capabilities.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/capabilities.py index 443806d8e904..065662c4d33e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/capabilities.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/capabilities.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -42,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Capabilities.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/Capabilities.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_available.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_available.py index 4ed868a2438a..5c2ba5f2669c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_available.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_available.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/CheckNameAvailability_Available.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/CheckNameAvailability_Available.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_not_available.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_not_available.py index 060386521fe5..39a112d85e1f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_not_available.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/check_name_availability_not_available.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/CheckNameAvailability_NotAvailable.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/CheckNameAvailability_NotAvailable.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_registered_identities.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_registered_identities.py index 13d4404c0fee..336d17fa891e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_registered_identities.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_registered_identities.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteRegisteredIdentities.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/DeleteRegisteredIdentities.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_vault.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_vault.py index 481ffe343dba..23f122bae6f4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_vault.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/delete_vault.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/DeleteVault.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/DeleteVault.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_result.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_result.py index 5ab4d89678cb..1fa6f8e9bd11 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_result.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_result.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetOperationResult.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GetOperationResult.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_status.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_status.py index de188629abaa..271c509a3133 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_status.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_operation_status.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetOperationStatus.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GetOperationStatus.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_private_link_resources.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_private_link_resources.py index f850d9a45bce..386e66541632 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_private_link_resources.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_private_link_resources.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GetPrivateLinkResources.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GetPrivateLinkResources.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault.py index 38e6c3e040a3..8ca4b0291be5 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVault.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GETVault.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault_extended_info.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault_extended_info.py index 90ee3bbc5a9e..716006a13598 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault_extended_info.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/get_vault_extended_info.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/GETVaultExtendedInfo.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GETVaultExtendedInfo.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_by_subscription_ids.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_by_subscription_ids.py index b9a5eda1201c..7cccb8f7c777 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_by_subscription_ids.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_by_subscription_ids.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListBySubscriptionIds.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListBySubscriptionIds.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_operations.py index b0575b33788a..0e707353982b 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_operations.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListOperations.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListOperations.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_private_link_resources.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_private_link_resources.py index e1bdddb17a86..e3b7194cafc7 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_private_link_resources.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_private_link_resources.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListPrivateLinkResources.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListPrivateLinkResources.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_replication_usages.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_replication_usages.py index 9fe3ce664d1b..432c85b3bda0 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_replication_usages.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_replication_usages.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListReplicationUsages.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListReplicationUsages.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_resources.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_resources.py index 141e0410aed0..9e7ce56dc8e0 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_resources.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_resources.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListResources.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListResources.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_usages.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_usages.py index ff81cdda811b..997da34e20ac 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_usages.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/list_usages.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListUsages.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListUsages.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault.py index d3b0bc53d2c1..dbf75f0373c4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk.py index da80887515f2..674f4223f8a5 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -59,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithCMK.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithCMK.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk2.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk2.py index 966fb790700b..37fec3c49443 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk2.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk2.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -44,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PatchVault_WithCMK2.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PatchVault_WithCMK2.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk3.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk3.py index af8f0dead229..de071ced3cab 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk3.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_cmk3.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -55,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithCMK3.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithCMK3.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_monitoring_settings.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_monitoring_settings.py index d610e6de958b..af7659d32a0e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_monitoring_settings.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_monitoring_settings.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -55,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithMonitoringSettings.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithMonitoringSettings.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_redundancy_settings.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_redundancy_settings.py index e6babab616c1..e836c47ff220 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_redundancy_settings.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_redundancy_settings.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -44,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithRedundancySettings.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithRedundancySettings.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_user_assigned_identity.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_user_assigned_identity.py index 60133c32c5ec..b5c94cd94371 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_user_assigned_identity.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/patch_vault_with_user_assigned_identity.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -48,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PATCHVault_WithUserAssignedIdentity.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithUserAssignedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault.py index 8cd198ef7c1f..5ca49923bf46 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -45,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_cred.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_cred.py index 543bd13e35ea..a36f793d50c3 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_cred.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_cred.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -46,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVaultCred.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVaultCred.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_resource_guard_enabled.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_resource_guard_enabled.py index e2cec1d300da..697dde5d12fc 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_resource_guard_enabled.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_resource_guard_enabled.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -64,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_ResourceGuardEnabled.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_ResourceGuardEnabled.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_cmk.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_cmk.py index abbba993e19f..c192428e121d 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_cmk.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_cmk.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -61,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithCMK.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithCMK.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_monitoring_settings.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_monitoring_settings.py index 9c4856499835..11154efebe44 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_monitoring_settings.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_monitoring_settings.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -58,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithMonitoringSettings.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithMonitoringSettings.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_redundancy_settings.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_redundancy_settings.py index ea28f32b57c2..92bd961e4715 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_redundancy_settings.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_redundancy_settings.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -51,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithRedundancySettings.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithRedundancySettings.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_user_assigned_identity.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_user_assigned_identity.py index d6367d21acac..81e1410fbb57 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_user_assigned_identity.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_samples/put_vault_with_user_assigned_identity.py @@ -6,8 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.recoveryservices import RecoveryServicesClient @@ -50,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithUserAssignedIdentity.json +# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithUserAssignedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/conftest.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/conftest.py new file mode 100644 index 000000000000..d33b55f15533 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# 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 os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# aovid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + recoveryservices_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + recoveryservices_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + recoveryservices_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + recoveryservices_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=recoveryservices_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=recoveryservices_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=recoveryservices_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=recoveryservices_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services.py new file mode 100644 index 000000000000..c756aa4cfeae --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services.py @@ -0,0 +1,45 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServices(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get_operation_status(self, resource_group): + response = self.client.get_operation_status( + resource_group_name=resource_group.name, + vault_name="str", + operation_id="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get_operation_result(self, resource_group): + response = self.client.get_operation_result( + resource_group_name=resource_group.name, + vault_name="str", + operation_id="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_async.py new file mode 100644 index 000000000000..17b10434d28e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_async.py @@ -0,0 +1,46 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get_operation_status(self, resource_group): + response = await self.client.get_operation_status( + resource_group_name=resource_group.name, + vault_name="str", + operation_id="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get_operation_result(self, resource_group): + response = await self.client.get_operation_result( + resource_group_name=resource_group.name, + vault_name="str", + operation_id="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations.py new file mode 100644 index 000000000000..007591260c32 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations.py @@ -0,0 +1,29 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.operations.list( + api_version="2024-10-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations_async.py new file mode 100644 index 000000000000..7d8a619d710f --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_operations_async.py @@ -0,0 +1,30 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list(self, resource_group): + response = self.client.operations.list( + api_version="2024-10-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations.py new file mode 100644 index 000000000000..bcd7e0d38bc1 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations.py @@ -0,0 +1,44 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesPrivateLinkResourcesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.private_link_resources.list( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.private_link_resources.get( + resource_group_name=resource_group.name, + vault_name="str", + private_link_resource_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations_async.py new file mode 100644 index 000000000000..cbbed2ed12cb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_private_link_resources_operations_async.py @@ -0,0 +1,45 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesPrivateLinkResourcesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list(self, resource_group): + response = self.client.private_link_resources.list( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get(self, resource_group): + response = await self.client.private_link_resources.get( + resource_group_name=resource_group.name, + vault_name="str", + private_link_resource_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations.py new file mode 100644 index 000000000000..ce27dea0cd06 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations.py @@ -0,0 +1,44 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesRecoveryServicesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_check_name_availability(self, resource_group): + response = self.client.recovery_services.check_name_availability( + resource_group_name=resource_group.name, + location="str", + input={"name": "str", "type": "str"}, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_capabilities(self, resource_group): + response = self.client.recovery_services.capabilities( + location="str", + input={"type": "str", "properties": {"dnsZones": [{"subResource": "str"}]}}, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations_async.py new file mode 100644 index 000000000000..36b490ae6b50 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_recovery_services_operations_async.py @@ -0,0 +1,45 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesRecoveryServicesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_check_name_availability(self, resource_group): + response = await self.client.recovery_services.check_name_availability( + resource_group_name=resource_group.name, + location="str", + input={"name": "str", "type": "str"}, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_capabilities(self, resource_group): + response = await self.client.recovery_services.capabilities( + location="str", + input={"type": "str", "properties": {"dnsZones": [{"subResource": "str"}]}}, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations.py new file mode 100644 index 000000000000..39285f4e29bb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations.py @@ -0,0 +1,32 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesRegisteredIdentitiesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_delete(self, resource_group): + response = self.client.registered_identities.delete( + resource_group_name=resource_group.name, + vault_name="str", + identity_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations_async.py new file mode 100644 index 000000000000..d7d747c2a25b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_registered_identities_operations_async.py @@ -0,0 +1,33 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesRegisteredIdentitiesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_delete(self, resource_group): + response = await self.client.registered_identities.delete( + resource_group_name=resource_group.name, + vault_name="str", + identity_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations.py new file mode 100644 index 000000000000..6470d0356fd2 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations.py @@ -0,0 +1,31 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesReplicationUsagesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.replication_usages.list( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations_async.py new file mode 100644 index 000000000000..8c518c0f4ba0 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_replication_usages_operations_async.py @@ -0,0 +1,32 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesReplicationUsagesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list(self, resource_group): + response = self.client.replication_usages.list( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations.py new file mode 100644 index 000000000000..5e3841c8a9f4 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations.py @@ -0,0 +1,31 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesUsagesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_by_vaults(self, resource_group): + response = self.client.usages.list_by_vaults( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations_async.py new file mode 100644 index 000000000000..3ce92798d3e3 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_usages_operations_async.py @@ -0,0 +1,32 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesUsagesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_by_vaults(self, resource_group): + response = self.client.usages.list_by_vaults( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations.py new file mode 100644 index 000000000000..9782aeaf02ae --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations.py @@ -0,0 +1,33 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesVaultCertificatesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_create(self, resource_group): + response = self.client.vault_certificates.create( + resource_group_name=resource_group.name, + vault_name="str", + certificate_name="str", + certificate_request={"properties": {"authType": "str", "certificate": bytes("bytes", encoding="utf-8")}}, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations_async.py new file mode 100644 index 000000000000..0a57332c286b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_certificates_operations_async.py @@ -0,0 +1,34 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesVaultCertificatesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_create(self, resource_group): + response = await self.client.vault_certificates.create( + resource_group_name=resource_group.name, + vault_name="str", + certificate_name="str", + certificate_request={"properties": {"authType": "str", "certificate": bytes("bytes", encoding="utf-8")}}, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations.py new file mode 100644 index 000000000000..dc3008a33688 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations.py @@ -0,0 +1,75 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesVaultExtendedInfoOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.vault_extended_info.get( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_create_or_update(self, resource_group): + response = self.client.vault_extended_info.create_or_update( + resource_group_name=resource_group.name, + vault_name="str", + resource_extended_info_details={ + "algorithm": "str", + "encryptionKey": "str", + "encryptionKeyThumbprint": "str", + "etag": "str", + "id": "str", + "integrityKey": "str", + "name": "str", + "type": "str", + }, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_update(self, resource_group): + response = self.client.vault_extended_info.update( + resource_group_name=resource_group.name, + vault_name="str", + resource_extended_info_details={ + "algorithm": "str", + "encryptionKey": "str", + "encryptionKeyThumbprint": "str", + "etag": "str", + "id": "str", + "integrityKey": "str", + "name": "str", + "type": "str", + }, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations_async.py new file mode 100644 index 000000000000..2f5d67dfd5c9 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vault_extended_info_operations_async.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesVaultExtendedInfoOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get(self, resource_group): + response = await self.client.vault_extended_info.get( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_create_or_update(self, resource_group): + response = await self.client.vault_extended_info.create_or_update( + resource_group_name=resource_group.name, + vault_name="str", + resource_extended_info_details={ + "algorithm": "str", + "encryptionKey": "str", + "encryptionKeyThumbprint": "str", + "etag": "str", + "id": "str", + "integrityKey": "str", + "name": "str", + "type": "str", + }, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_update(self, resource_group): + response = await self.client.vault_extended_info.update( + resource_group_name=resource_group.name, + vault_name="str", + resource_extended_info_details={ + "algorithm": "str", + "encryptionKey": "str", + "encryptionKeyThumbprint": "str", + "etag": "str", + "id": "str", + "integrityKey": "str", + "name": "str", + "type": "str", + }, + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations.py new file mode 100644 index 000000000000..bd8dfc854a9c --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations.py @@ -0,0 +1,274 @@ +# 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 pytest +from azure.mgmt.recoveryservices import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesVaultsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_by_subscription_id(self, resource_group): + response = self.client.vaults.list_by_subscription_id( + api_version="2024-10-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_by_resource_group(self, resource_group): + response = self.client.vaults.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2024-10-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.vaults.get( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.vaults.begin_create_or_update( + resource_group_name=resource_group.name, + vault_name="str", + vault={ + "location": "str", + "etag": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "backupStorageVersion": "str", + "bcdrSecurityLevel": "str", + "encryption": { + "infrastructureEncryption": "str", + "kekIdentity": {"useSystemAssignedIdentity": bool, "userAssignedIdentity": "str"}, + "keyVaultProperties": {"keyUri": "str"}, + }, + "monitoringSettings": { + "azureMonitorAlertSettings": { + "alertsForAllFailoverIssues": "str", + "alertsForAllJobFailures": "str", + "alertsForAllReplicationIssues": "str", + }, + "classicAlertSettings": { + "alertsForCriticalOperations": "str", + "emailNotificationsForSiteRecovery": "str", + }, + }, + "moveDetails": { + "completionTimeUtc": "2020-02-20 00:00:00", + "operationId": "str", + "sourceResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "targetResourceId": "str", + }, + "moveState": "str", + "privateEndpointConnections": [ + { + "id": "str", + "location": "str", + "name": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "actionsRequired": "str", + "description": "str", + "status": "str", + }, + "provisioningState": "str", + }, + "type": "str", + } + ], + "privateEndpointStateForBackup": "str", + "privateEndpointStateForSiteRecovery": "str", + "provisioningState": "str", + "publicNetworkAccess": "str", + "redundancySettings": {"crossRegionRestore": "str", "standardTierStorageRedundancy": "str"}, + "resourceGuardOperationRequests": ["str"], + "restoreSettings": {"crossSubscriptionRestoreSettings": {"crossSubscriptionRestoreState": "str"}}, + "secureScore": "str", + "securitySettings": { + "immutabilitySettings": {"state": "str"}, + "multiUserAuthorization": "str", + "softDeleteSettings": { + "enhancedSecurityState": "str", + "softDeleteRetentionPeriodInDays": 0, + "softDeleteState": "str", + }, + }, + "upgradeDetails": { + "endTimeUtc": "2020-02-20 00:00:00", + "lastUpdatedTimeUtc": "2020-02-20 00:00:00", + "message": "str", + "operationId": "str", + "previousResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "status": "str", + "triggerType": "str", + "upgradedResourceId": "str", + }, + }, + "sku": {"name": "str", "capacity": "str", "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + api_version="2024-10-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_delete(self, resource_group): + response = self.client.vaults.begin_delete( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_update(self, resource_group): + response = self.client.vaults.begin_update( + resource_group_name=resource_group.name, + vault_name="str", + vault={ + "etag": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "location": "str", + "name": "str", + "properties": { + "backupStorageVersion": "str", + "bcdrSecurityLevel": "str", + "encryption": { + "infrastructureEncryption": "str", + "kekIdentity": {"useSystemAssignedIdentity": bool, "userAssignedIdentity": "str"}, + "keyVaultProperties": {"keyUri": "str"}, + }, + "monitoringSettings": { + "azureMonitorAlertSettings": { + "alertsForAllFailoverIssues": "str", + "alertsForAllJobFailures": "str", + "alertsForAllReplicationIssues": "str", + }, + "classicAlertSettings": { + "alertsForCriticalOperations": "str", + "emailNotificationsForSiteRecovery": "str", + }, + }, + "moveDetails": { + "completionTimeUtc": "2020-02-20 00:00:00", + "operationId": "str", + "sourceResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "targetResourceId": "str", + }, + "moveState": "str", + "privateEndpointConnections": [ + { + "id": "str", + "location": "str", + "name": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "actionsRequired": "str", + "description": "str", + "status": "str", + }, + "provisioningState": "str", + }, + "type": "str", + } + ], + "privateEndpointStateForBackup": "str", + "privateEndpointStateForSiteRecovery": "str", + "provisioningState": "str", + "publicNetworkAccess": "str", + "redundancySettings": {"crossRegionRestore": "str", "standardTierStorageRedundancy": "str"}, + "resourceGuardOperationRequests": ["str"], + "restoreSettings": {"crossSubscriptionRestoreSettings": {"crossSubscriptionRestoreState": "str"}}, + "secureScore": "str", + "securitySettings": { + "immutabilitySettings": {"state": "str"}, + "multiUserAuthorization": "str", + "softDeleteSettings": { + "enhancedSecurityState": "str", + "softDeleteRetentionPeriodInDays": 0, + "softDeleteState": "str", + }, + }, + "upgradeDetails": { + "endTimeUtc": "2020-02-20 00:00:00", + "lastUpdatedTimeUtc": "2020-02-20 00:00:00", + "message": "str", + "operationId": "str", + "previousResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "status": "str", + "triggerType": "str", + "upgradedResourceId": "str", + }, + }, + "sku": {"name": "str", "capacity": "str", "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + "type": "str", + }, + api_version="2024-10-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations_async.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations_async.py new file mode 100644 index 000000000000..1dc85bda3467 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/generated_tests/test_recovery_services_vaults_operations_async.py @@ -0,0 +1,285 @@ +# 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 pytest +from azure.mgmt.recoveryservices.aio import RecoveryServicesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRecoveryServicesVaultsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(RecoveryServicesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_by_subscription_id(self, resource_group): + response = self.client.vaults.list_by_subscription_id( + api_version="2024-10-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list_by_resource_group(self, resource_group): + response = self.client.vaults.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2024-10-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get(self, resource_group): + response = await self.client.vaults.get( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.vaults.begin_create_or_update( + resource_group_name=resource_group.name, + vault_name="str", + vault={ + "location": "str", + "etag": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "backupStorageVersion": "str", + "bcdrSecurityLevel": "str", + "encryption": { + "infrastructureEncryption": "str", + "kekIdentity": {"useSystemAssignedIdentity": bool, "userAssignedIdentity": "str"}, + "keyVaultProperties": {"keyUri": "str"}, + }, + "monitoringSettings": { + "azureMonitorAlertSettings": { + "alertsForAllFailoverIssues": "str", + "alertsForAllJobFailures": "str", + "alertsForAllReplicationIssues": "str", + }, + "classicAlertSettings": { + "alertsForCriticalOperations": "str", + "emailNotificationsForSiteRecovery": "str", + }, + }, + "moveDetails": { + "completionTimeUtc": "2020-02-20 00:00:00", + "operationId": "str", + "sourceResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "targetResourceId": "str", + }, + "moveState": "str", + "privateEndpointConnections": [ + { + "id": "str", + "location": "str", + "name": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "actionsRequired": "str", + "description": "str", + "status": "str", + }, + "provisioningState": "str", + }, + "type": "str", + } + ], + "privateEndpointStateForBackup": "str", + "privateEndpointStateForSiteRecovery": "str", + "provisioningState": "str", + "publicNetworkAccess": "str", + "redundancySettings": {"crossRegionRestore": "str", "standardTierStorageRedundancy": "str"}, + "resourceGuardOperationRequests": ["str"], + "restoreSettings": { + "crossSubscriptionRestoreSettings": {"crossSubscriptionRestoreState": "str"} + }, + "secureScore": "str", + "securitySettings": { + "immutabilitySettings": {"state": "str"}, + "multiUserAuthorization": "str", + "softDeleteSettings": { + "enhancedSecurityState": "str", + "softDeleteRetentionPeriodInDays": 0, + "softDeleteState": "str", + }, + }, + "upgradeDetails": { + "endTimeUtc": "2020-02-20 00:00:00", + "lastUpdatedTimeUtc": "2020-02-20 00:00:00", + "message": "str", + "operationId": "str", + "previousResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "status": "str", + "triggerType": "str", + "upgradedResourceId": "str", + }, + }, + "sku": {"name": "str", "capacity": "str", "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + api_version="2024-10-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_delete(self, resource_group): + response = await ( + await self.client.vaults.begin_delete( + resource_group_name=resource_group.name, + vault_name="str", + api_version="2024-10-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_update(self, resource_group): + response = await ( + await self.client.vaults.begin_update( + resource_group_name=resource_group.name, + vault_name="str", + vault={ + "etag": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "location": "str", + "name": "str", + "properties": { + "backupStorageVersion": "str", + "bcdrSecurityLevel": "str", + "encryption": { + "infrastructureEncryption": "str", + "kekIdentity": {"useSystemAssignedIdentity": bool, "userAssignedIdentity": "str"}, + "keyVaultProperties": {"keyUri": "str"}, + }, + "monitoringSettings": { + "azureMonitorAlertSettings": { + "alertsForAllFailoverIssues": "str", + "alertsForAllJobFailures": "str", + "alertsForAllReplicationIssues": "str", + }, + "classicAlertSettings": { + "alertsForCriticalOperations": "str", + "emailNotificationsForSiteRecovery": "str", + }, + }, + "moveDetails": { + "completionTimeUtc": "2020-02-20 00:00:00", + "operationId": "str", + "sourceResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "targetResourceId": "str", + }, + "moveState": "str", + "privateEndpointConnections": [ + { + "id": "str", + "location": "str", + "name": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "actionsRequired": "str", + "description": "str", + "status": "str", + }, + "provisioningState": "str", + }, + "type": "str", + } + ], + "privateEndpointStateForBackup": "str", + "privateEndpointStateForSiteRecovery": "str", + "provisioningState": "str", + "publicNetworkAccess": "str", + "redundancySettings": {"crossRegionRestore": "str", "standardTierStorageRedundancy": "str"}, + "resourceGuardOperationRequests": ["str"], + "restoreSettings": { + "crossSubscriptionRestoreSettings": {"crossSubscriptionRestoreState": "str"} + }, + "secureScore": "str", + "securitySettings": { + "immutabilitySettings": {"state": "str"}, + "multiUserAuthorization": "str", + "softDeleteSettings": { + "enhancedSecurityState": "str", + "softDeleteRetentionPeriodInDays": 0, + "softDeleteState": "str", + }, + }, + "upgradeDetails": { + "endTimeUtc": "2020-02-20 00:00:00", + "lastUpdatedTimeUtc": "2020-02-20 00:00:00", + "message": "str", + "operationId": "str", + "previousResourceId": "str", + "startTimeUtc": "2020-02-20 00:00:00", + "status": "str", + "triggerType": "str", + "upgradedResourceId": "str", + }, + }, + "sku": {"name": "str", "capacity": "str", "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + "type": "str", + }, + api_version="2024-10-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/setup.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/setup.py index 387e8eb0575c..4dbaa2bad673 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/setup.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/setup.py @@ -75,6 +75,7 @@ }, install_requires=[ "isodate>=0.6.1", + "typing-extensions>=4.6.0", "azure-common>=1.1", "azure-mgmt-core>=1.3.2", ],