From ef8a928955a110b71c1780f71ca4c9f43c2ab1b2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 28 Dec 2021 06:00:35 +0000 Subject: [PATCH] CodeGen from PR 17154 in Azure/azure-rest-api-specs Merge f90603eee23aeef4424d4d41ad198dfa000ea62e into 1d61c33eee0c0b790d5bdd44b557658f705721cf --- .../azure-mgmt-recoveryservices/_meta.json | 10 +- .../azure/mgmt/recoveryservices/__init__.py | 9 +- .../mgmt/recoveryservices/_configuration.py | 8 +- .../mgmt/recoveryservices/_metadata.json | 33 +- .../azure/mgmt/recoveryservices/_patch.py | 31 + .../_recovery_services_client.py | 110 +- .../azure/mgmt/recoveryservices/_vendor.py | 27 + .../azure/mgmt/recoveryservices/_version.py | 2 +- .../mgmt/recoveryservices/aio/__init__.py | 5 + .../recoveryservices/aio/_configuration.py | 8 +- .../azure/mgmt/recoveryservices/aio/_patch.py | 31 + .../aio/_recovery_services_client.py | 117 +- .../aio/operations/_operations.py | 48 +- .../_private_link_resources_operations.py | 95 +- .../_recovery_services_client_operations.py | 74 +- .../_recovery_services_operations.py | 53 +- .../_registered_identities_operations.py | 38 +- .../_replication_usages_operations.py | 62 +- .../aio/operations/_usages_operations.py | 59 +- .../_vault_certificates_operations.py | 49 +- .../_vault_extended_info_operations.py | 123 +- .../aio/operations/_vaults_operations.py | 285 ++--- .../mgmt/recoveryservices/models/__init__.py | 7 + .../mgmt/recoveryservices/models/_models.py | 1028 +++++++++++----- .../recoveryservices/models/_models_py3.py | 1032 ++++++++++++----- .../models/_recovery_services_client_enums.py | 64 +- .../operations/_operations.py | 77 +- .../_private_link_resources_operations.py | 169 ++- .../_recovery_services_client_operations.py | 154 ++- .../_recovery_services_operations.py | 97 +- .../_registered_identities_operations.py | 74 +- .../_replication_usages_operations.py | 98 +- .../operations/_usages_operations.py | 95 +- .../_vault_certificates_operations.py | 95 +- .../_vault_extended_info_operations.py | 243 ++-- .../operations/_vaults_operations.py | 506 +++++--- 36 files changed, 3355 insertions(+), 1661 deletions(-) create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_patch.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py create mode 100644 sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_patch.py diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json b/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json index 5bdb8f34d062..a8933b89be98 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.1", - "@autorest/modelerfour@4.19.2" + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "7f530e3727f746e26f5b5ece8a5874daf10cc56f", + "commit": "dd439ae0daaaed27205d1d61c759cdabe3eb2c62", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/recoveryservices/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py index 725e4b43f358..c56abeb90c96 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['RecoveryServicesClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() 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 ec9dc244ebca..2f51faa82ea9 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION @@ -40,15 +40,15 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None + super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2021-11-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservices/{}'.format(VERSION)) self._configure(**kwargs) @@ -68,4 +68,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json index 3b046a3a96f7..43cc217d6caa 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2021-03-01", - "total_api_version_list": ["2021-03-01"], + "chosen_version": "2021-11-01-preview", + "total_api_version_list": ["2021-11-01-preview"], "client": { "name": "RecoveryServicesClient", "filename": "_recovery_services_client", "description": "Recovery Services Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "vault_certificates": "VaultCertificatesOperations", @@ -109,12 +108,12 @@ "usages": "UsagesOperations" }, "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", "operations": { "get_operation_status" : { "sync": { - "signature": "def get_operation_status(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n", + "signature": "def get_operation_status(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e \"_models.OperationResource\"\n", "doc": "\"\"\"Gets the operation status for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OperationResource, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.OperationResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -126,7 +125,7 @@ }, "get_operation_result" : { "sync": { - "signature": "def get_operation_result(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n", + "signature": "def get_operation_result(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.Vault\"]\n", "doc": "\"\"\"Gets the operation result for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Vault, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.Vault or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file 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 ff2b62b6031f..0e21c6d00e08 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 @@ -6,31 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from copy import deepcopy from typing import TYPE_CHECKING from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import RecoveryServicesClientConfiguration +from .operations import Operations, PrivateLinkResourcesOperations, RecoveryServicesClientOperationsMixin, RecoveryServicesOperations, RegisteredIdentitiesOperations, ReplicationUsagesOperations, UsagesOperations, VaultCertificatesOperations, VaultExtendedInfoOperations, VaultsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Optional from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import RecoveryServicesClientConfiguration -from .operations import VaultCertificatesOperations -from .operations import RegisteredIdentitiesOperations -from .operations import ReplicationUsagesOperations -from .operations import PrivateLinkResourcesOperations -from .operations import RecoveryServicesOperations -from .operations import VaultsOperations -from .operations import Operations -from .operations import VaultExtendedInfoOperations -from .operations import RecoveryServicesClientOperationsMixin -from .operations import UsagesOperations -from . import models - + from azure.core.rest import HttpRequest, HttpResponse class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): """Recovery Services Client. @@ -38,11 +29,13 @@ class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): :ivar vault_certificates: VaultCertificatesOperations operations :vartype vault_certificates: azure.mgmt.recoveryservices.operations.VaultCertificatesOperations :ivar registered_identities: RegisteredIdentitiesOperations operations - :vartype registered_identities: azure.mgmt.recoveryservices.operations.RegisteredIdentitiesOperations + :vartype registered_identities: + azure.mgmt.recoveryservices.operations.RegisteredIdentitiesOperations :ivar replication_usages: ReplicationUsagesOperations operations :vartype replication_usages: azure.mgmt.recoveryservices.operations.ReplicationUsagesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.recoveryservices.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.recoveryservices.operations.PrivateLinkResourcesOperations :ivar recovery_services: RecoveryServicesOperations operations :vartype recovery_services: azure.mgmt.recoveryservices.operations.RecoveryServicesOperations :ivar vaults: VaultsOperations operations @@ -50,71 +43,72 @@ class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): :ivar operations: Operations operations :vartype operations: azure.mgmt.recoveryservices.operations.Operations :ivar vault_extended_info: VaultExtendedInfoOperations operations - :vartype vault_extended_info: azure.mgmt.recoveryservices.operations.VaultExtendedInfoOperations + :vartype vault_extended_info: + azure.mgmt.recoveryservices.operations.VaultExtendedInfoOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.recoveryservices.operations.UsagesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str - base_url=None, # type: Optional[str] + base_url="https://management.azure.com", # type: str **kwargs # type: Any ): # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = RecoveryServicesClientConfiguration(credential, subscription_id, **kwargs) + self._config = RecoveryServicesClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - - self.vault_certificates = VaultCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.registered_identities = RegisteredIdentitiesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_usages = ReplicationUsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_services = RecoveryServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.vaults = VaultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.vault_extended_info = VaultExtendedInfoOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + self._serialize.client_side_validation = False + self.vault_certificates = VaultCertificatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.registered_identities = RegisteredIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_usages = ReplicationUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_services = RecoveryServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.vault_extended_info = VaultExtendedInfoOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> HttpResponse """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +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 + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) 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 48944bf3938a..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 = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py index 1134d60092da..4cf117717d2c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py @@ -8,3 +8,8 @@ from ._recovery_services_client import RecoveryServicesClient __all__ = ['RecoveryServicesClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() 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 3a503e36d9d2..1f7297b5bbf1 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 @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -37,15 +37,15 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2021-11-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservices/{}'.format(VERSION)) self._configure(**kwargs) @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file 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 5e0a35fddd93..8c39bcc3efc8 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 @@ -6,111 +6,108 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import RecoveryServicesClientConfiguration +from .operations import Operations, PrivateLinkResourcesOperations, RecoveryServicesClientOperationsMixin, RecoveryServicesOperations, RegisteredIdentitiesOperations, ReplicationUsagesOperations, UsagesOperations, VaultCertificatesOperations, VaultExtendedInfoOperations, VaultsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import RecoveryServicesClientConfiguration -from .operations import VaultCertificatesOperations -from .operations import RegisteredIdentitiesOperations -from .operations import ReplicationUsagesOperations -from .operations import PrivateLinkResourcesOperations -from .operations import RecoveryServicesOperations -from .operations import VaultsOperations -from .operations import Operations -from .operations import VaultExtendedInfoOperations -from .operations import RecoveryServicesClientOperationsMixin -from .operations import UsagesOperations -from .. import models - - class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): """Recovery Services Client. :ivar vault_certificates: VaultCertificatesOperations operations - :vartype vault_certificates: azure.mgmt.recoveryservices.aio.operations.VaultCertificatesOperations + :vartype vault_certificates: + azure.mgmt.recoveryservices.aio.operations.VaultCertificatesOperations :ivar registered_identities: RegisteredIdentitiesOperations operations - :vartype registered_identities: azure.mgmt.recoveryservices.aio.operations.RegisteredIdentitiesOperations + :vartype registered_identities: + azure.mgmt.recoveryservices.aio.operations.RegisteredIdentitiesOperations :ivar replication_usages: ReplicationUsagesOperations operations - :vartype replication_usages: azure.mgmt.recoveryservices.aio.operations.ReplicationUsagesOperations + :vartype replication_usages: + azure.mgmt.recoveryservices.aio.operations.ReplicationUsagesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.recoveryservices.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.recoveryservices.aio.operations.PrivateLinkResourcesOperations :ivar recovery_services: RecoveryServicesOperations operations - :vartype recovery_services: azure.mgmt.recoveryservices.aio.operations.RecoveryServicesOperations + :vartype recovery_services: + azure.mgmt.recoveryservices.aio.operations.RecoveryServicesOperations :ivar vaults: VaultsOperations operations :vartype vaults: azure.mgmt.recoveryservices.aio.operations.VaultsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.recoveryservices.aio.operations.Operations :ivar vault_extended_info: VaultExtendedInfoOperations operations - :vartype vault_extended_info: azure.mgmt.recoveryservices.aio.operations.VaultExtendedInfoOperations + :vartype vault_extended_info: + azure.mgmt.recoveryservices.aio.operations.VaultExtendedInfoOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.recoveryservices.aio.operations.UsagesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = RecoveryServicesClientConfiguration(credential, subscription_id, **kwargs) + self._config = RecoveryServicesClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.vault_certificates = VaultCertificatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.registered_identities = RegisteredIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_usages = ReplicationUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_services = RecoveryServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.vault_extended_info = VaultExtendedInfoOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + - self.vault_certificates = VaultCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.registered_identities = RegisteredIdentitiesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_usages = ReplicationUsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_services = RecoveryServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.vaults = VaultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.vault_extended_info = VaultExtendedInfoOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() 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 16f63fd27350..ef756f3e71c3 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 @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -48,8 +54,10 @@ def list( """Returns the list of available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClientDiscoveryResponse or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] + :return: An iterator like instance of either ClientDiscoveryResponse or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientDiscoveryResponse"] @@ -57,30 +65,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ClientDiscoveryResponse', pipeline_response) + deserialized = self._deserialize("ClientDiscoveryResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +103,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) 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 3363b616ff72..da2d32292b3f 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 @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async 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 T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -57,8 +63,10 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResources or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.PrivateLinkResources] + :return: An iterator like instance of either PrivateLinkResources or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.PrivateLinkResources] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResources"] @@ -66,36 +74,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateLinkResources', pipeline_response) + deserialized = self._deserialize("PrivateLinkResources", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -146,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + private_link_resource_name=private_link_resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -181,4 +178,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}'} # 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 b603043fea7d..a8b7b3431828 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 @@ -5,21 +5,26 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async 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 T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class RecoveryServicesClientOperationsMixin: + @distributed_trace_async async def get_operation_status( self, resource_group_name: str, @@ -46,28 +51,18 @@ async def get_operation_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_status.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_operation_status_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_status.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -81,8 +76,11 @@ async def get_operation_status( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}'} # type: ignore + + @distributed_trace_async async def get_operation_result( self, resource_group_name: str, @@ -109,28 +107,18 @@ async def get_operation_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_result.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_operation_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -146,4 +134,6 @@ async def get_operation_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}'} # 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 0978a7d532c9..19cab53af7c9 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 @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._recovery_services_operations import build_check_name_availability_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def check_name_availability( self, resource_group_name: str, @@ -48,8 +53,10 @@ async def check_name_availability( **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """API to check for resource name availability. - A name is available if no other resource exists that has the same SubscriptionId, Resource Name and Type - or if one or more such resources exist, each of these must be GC'd and their time of deletion be more than 24 Hours Ago. + A name is available if no other resource exists that has the same SubscriptionId, Resource Name + and Type + or if one or more such resources exist, each of these must be GC'd and their time of deletion + be more than 24 Hours Ago. API to check for resource name availability. A name is available if no other resource exists that has the same SubscriptionId, Resource Name @@ -74,32 +81,22 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'CheckNameAvailabilityParameters') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CheckNameAvailabilityParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -113,4 +110,6 @@ async def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability'} # 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 846fcadfa908..d2be44a7e3ae 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 @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async 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 T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -66,26 +71,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'identityName': self._serialize.url("identity_name", identity_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + identity_name=identity_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -97,3 +94,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}'} # type: ignore + 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 e16b030a5fd5..73edf0c8a806 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 @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async 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 T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -55,8 +61,10 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationUsageList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ReplicationUsageList] + :return: An iterator like instance of either ReplicationUsageList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ReplicationUsageList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationUsageList"] @@ -64,36 +72,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationUsageList', pipeline_response) + deserialized = self._deserialize("ReplicationUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -111,6 +116,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) 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 24da06a76228..303d3c705160 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 @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async 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 T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_vaults( self, resource_group_name: str, @@ -56,7 +62,8 @@ def list_by_vaults( :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VaultUsageList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.VaultUsageList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.VaultUsageList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultUsageList"] @@ -64,36 +71,33 @@ def list_by_vaults( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_vaults.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list_by_vaults.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VaultUsageList', pipeline_response) + deserialized = self._deserialize("VaultUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -111,6 +115,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) 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 c7e33d926362..9369214af1a4 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 @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async 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 T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create( self, resource_group_name: str, @@ -69,33 +74,23 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(certificate_request, 'CertificateRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + certificate_name=certificate_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(certificate_request, 'CertificateRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -109,4 +104,6 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}'} # 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 fe0a956e1885..e71094adae74 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 @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async 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 T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get( self, resource_group_name: str, @@ -63,27 +68,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -97,8 +92,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -114,7 +112,8 @@ async def create_or_update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -125,32 +124,22 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -164,8 +153,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -181,7 +173,8 @@ async def update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -192,32 +185,22 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -231,4 +214,6 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # 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 e3cda9ae0bc6..94bd46a3cfb9 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 @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat 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_initial, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_id_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_subscription_id( self, **kwargs: Any @@ -59,34 +65,29 @@ def list_by_subscription_id( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_subscription_id.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=self.list_by_subscription_id.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,11 +105,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -129,35 +132,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -175,11 +174,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -203,27 +204,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,8 +228,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -251,32 +244,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'Vault') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'Vault') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,8 +277,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -314,15 +300,18 @@ async def begin_create_or_update( :type vault: ~azure.mgmt.recoveryservices.models.Vault :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Vault or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -334,27 +323,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -366,8 +349,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -391,27 +376,17 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -424,6 +399,7 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + async def _update_initial( self, resource_group_name: str, @@ -436,32 +412,22 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'PatchVault') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'PatchVault') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -477,8 +443,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, resource_group_name: str, @@ -497,15 +466,18 @@ async def begin_update( :type vault: ~azure.mgmt.recoveryservices.models.PatchVault :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Vault or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -517,27 +489,21 @@ async def begin_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -549,4 +515,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py index 5d0519244be4..40e5c849ea88 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py @@ -51,6 +51,7 @@ from ._models_py3 import VaultList from ._models_py3 import VaultProperties from ._models_py3 import VaultPropertiesEncryption + from ._models_py3 import VaultPropertiesMoveDetails from ._models_py3 import VaultUsage from ._models_py3 import VaultUsageList except (SyntaxError, ImportError): @@ -98,16 +99,19 @@ from ._models import VaultList # type: ignore from ._models import VaultProperties # type: ignore from ._models import VaultPropertiesEncryption # type: ignore + from ._models import VaultPropertiesMoveDetails # type: ignore from ._models import VaultUsage # type: ignore from ._models import VaultUsageList # type: ignore from ._recovery_services_client_enums import ( AuthType, + BackupStorageVersion, CreatedByType, InfrastructureEncryptionState, PrivateEndpointConnectionStatus, ProvisioningState, ResourceIdentityType, + ResourceMoveState, SkuName, TriggerType, UsagesUnit, @@ -160,14 +164,17 @@ 'VaultList', 'VaultProperties', 'VaultPropertiesEncryption', + 'VaultPropertiesMoveDetails', 'VaultUsage', 'VaultUsageList', 'AuthType', + 'BackupStorageVersion', 'CreatedByType', 'InfrastructureEncryptionState', 'PrivateEndpointConnectionStatus', 'ProvisioningState', 'ResourceIdentityType', + 'ResourceMoveState', 'SkuName', 'TriggerType', 'UsagesUnit', diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models.py index 943a1bba909f..e78be20cff0c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models.py @@ -12,8 +12,8 @@ class CertificateRequest(msrest.serialization.Model): """Details of the certificate to be uploaded to the vault. - :param properties: Raw certificate data. - :type properties: ~azure.mgmt.recoveryservices.models.RawCertificateData + :ivar properties: Raw certificate data. + :vartype properties: ~azure.mgmt.recoveryservices.models.RawCertificateData """ _attribute_map = { @@ -24,6 +24,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: Raw certificate data. + :paramtype properties: ~azure.mgmt.recoveryservices.models.RawCertificateData + """ super(CertificateRequest, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -31,10 +35,10 @@ def __init__( class CheckNameAvailabilityParameters(msrest.serialization.Model): """Resource Name availability input parameters - Resource type and resource name. - :param type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. - :type type: str - :param name: Resource name for which availability needs to be checked. - :type name: str + :ivar type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + :vartype type: str + :ivar name: Resource name for which availability needs to be checked. + :vartype name: str """ _attribute_map = { @@ -46,6 +50,12 @@ def __init__( self, **kwargs ): + """ + :keyword type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + :paramtype type: str + :keyword name: Resource name for which availability needs to be checked. + :paramtype name: str + """ super(CheckNameAvailabilityParameters, self).__init__(**kwargs) self.type = kwargs.get('type', None) self.name = kwargs.get('name', None) @@ -54,12 +64,12 @@ def __init__( class CheckNameAvailabilityResult(msrest.serialization.Model): """Response for check name availability API. Resource provider will set availability as true | false. - :param name_available: - :type name_available: bool - :param reason: - :type reason: str - :param message: - :type message: str + :ivar name_available: + :vartype name_available: bool + :ivar reason: + :vartype reason: str + :ivar message: + :vartype message: str """ _attribute_map = { @@ -72,6 +82,14 @@ def __init__( self, **kwargs ): + """ + :keyword name_available: + :paramtype name_available: bool + :keyword reason: + :paramtype reason: str + :keyword message: + :paramtype message: str + """ super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = kwargs.get('name_available', None) self.reason = kwargs.get('reason', None) @@ -81,14 +99,14 @@ def __init__( class ClientDiscoveryDisplay(msrest.serialization.Model): """Localized display information of an operation. - :param provider: Name of the provider for display purposes. - :type provider: str - :param resource: ResourceType for which this Operation can be performed. - :type resource: str - :param operation: Operations Name itself. - :type operation: str - :param description: Description of the operation having details of what operation is about. - :type description: str + :ivar provider: Name of the provider for display purposes. + :vartype provider: str + :ivar resource: ResourceType for which this Operation can be performed. + :vartype resource: str + :ivar operation: Operations Name itself. + :vartype operation: str + :ivar description: Description of the operation having details of what operation is about. + :vartype description: str """ _attribute_map = { @@ -102,6 +120,16 @@ def __init__( self, **kwargs ): + """ + :keyword provider: Name of the provider for display purposes. + :paramtype provider: str + :keyword resource: ResourceType for which this Operation can be performed. + :paramtype resource: str + :keyword operation: Operations Name itself. + :paramtype operation: str + :keyword description: Description of the operation having details of what operation is about. + :paramtype description: str + """ super(ClientDiscoveryDisplay, self).__init__(**kwargs) self.provider = kwargs.get('provider', None) self.resource = kwargs.get('resource', None) @@ -112,12 +140,12 @@ def __init__( class ClientDiscoveryForLogSpecification(msrest.serialization.Model): """Class to represent shoebox log specification in json client discovery. - :param name: Name of the log. - :type name: str - :param display_name: Localized display name. - :type display_name: str - :param blob_duration: Blobs created in customer storage account per hour. - :type blob_duration: str + :ivar name: Name of the log. + :vartype name: str + :ivar display_name: Localized display name. + :vartype display_name: str + :ivar blob_duration: Blobs created in customer storage account per hour. + :vartype blob_duration: str """ _attribute_map = { @@ -130,6 +158,14 @@ def __init__( self, **kwargs ): + """ + :keyword name: Name of the log. + :paramtype name: str + :keyword display_name: Localized display name. + :paramtype display_name: str + :keyword blob_duration: Blobs created in customer storage account per hour. + :paramtype blob_duration: str + """ super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display_name = kwargs.get('display_name', None) @@ -139,8 +175,8 @@ def __init__( class ClientDiscoveryForProperties(msrest.serialization.Model): """Class to represent shoebox properties in json client discovery. - :param service_specification: Operation properties. - :type service_specification: + :ivar service_specification: Operation properties. + :vartype service_specification: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForServiceSpecification """ @@ -152,6 +188,11 @@ def __init__( self, **kwargs ): + """ + :keyword service_specification: Operation properties. + :paramtype service_specification: + ~azure.mgmt.recoveryservices.models.ClientDiscoveryForServiceSpecification + """ super(ClientDiscoveryForProperties, self).__init__(**kwargs) self.service_specification = kwargs.get('service_specification', None) @@ -159,8 +200,8 @@ def __init__( class ClientDiscoveryForServiceSpecification(msrest.serialization.Model): """Class to represent shoebox service specification in json client discovery. - :param log_specifications: List of log specifications of this operation. - :type log_specifications: + :ivar log_specifications: List of log specifications of this operation. + :vartype log_specifications: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryForLogSpecification] """ @@ -172,6 +213,11 @@ def __init__( self, **kwargs ): + """ + :keyword log_specifications: List of log specifications of this operation. + :paramtype log_specifications: + list[~azure.mgmt.recoveryservices.models.ClientDiscoveryForLogSpecification] + """ super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) self.log_specifications = kwargs.get('log_specifications', None) @@ -179,10 +225,10 @@ def __init__( class ClientDiscoveryResponse(msrest.serialization.Model): """Operations List response which contains list of available APIs. - :param value: List of available operations. - :type value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] - :param next_link: Link to the next chunk of the response. - :type next_link: str + :ivar value: List of available operations. + :vartype value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] + :ivar next_link: Link to the next chunk of the response. + :vartype next_link: str """ _attribute_map = { @@ -194,6 +240,12 @@ def __init__( self, **kwargs ): + """ + :keyword value: List of available operations. + :paramtype value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] + :keyword next_link: Link to the next chunk of the response. + :paramtype next_link: str + """ super(ClientDiscoveryResponse, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -202,15 +254,15 @@ def __init__( class ClientDiscoveryValueForSingleApi(msrest.serialization.Model): """Available operation details. - :param name: Name of the Operation. - :type name: str - :param display: Contains the localized display information for this particular operation. - :type display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay - :param origin: The intended executor of the operation;governs the display of the operation in + :ivar name: Name of the Operation. + :vartype name: str + :ivar display: Contains the localized display information for this particular operation. + :vartype display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay + :ivar origin: The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX. - :type origin: str - :param properties: ShoeBox properties for the given operation. - :type properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties + :vartype origin: str + :ivar properties: ShoeBox properties for the given operation. + :vartype properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties """ _attribute_map = { @@ -224,6 +276,17 @@ def __init__( self, **kwargs ): + """ + :keyword name: Name of the Operation. + :paramtype name: str + :keyword display: Contains the localized display information for this particular operation. + :paramtype display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay + :keyword origin: The intended executor of the operation;governs the display of the operation in + the RBAC UX and the audit logs UX. + :paramtype origin: str + :keyword properties: ShoeBox properties for the given operation. + :paramtype properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties + """ super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display = kwargs.get('display', None) @@ -234,12 +297,12 @@ def __init__( class CmkKekIdentity(msrest.serialization.Model): """The details of the identity used for CMK. - :param use_system_assigned_identity: Indicate that system assigned identity should be used. + :ivar use_system_assigned_identity: Indicate that system assigned identity should be used. Mutually exclusive with 'userAssignedIdentity' field. - :type use_system_assigned_identity: bool - :param user_assigned_identity: The user assigned identity to be used to grant permissions in + :vartype use_system_assigned_identity: bool + :ivar user_assigned_identity: The user assigned identity to be used to grant permissions in case the type of identity used is UserAssigned. - :type user_assigned_identity: str + :vartype user_assigned_identity: str """ _attribute_map = { @@ -251,6 +314,14 @@ def __init__( self, **kwargs ): + """ + :keyword use_system_assigned_identity: Indicate that system assigned identity should be used. + Mutually exclusive with 'userAssignedIdentity' field. + :paramtype use_system_assigned_identity: bool + :keyword user_assigned_identity: The user assigned identity to be used to grant permissions in + case the type of identity used is UserAssigned. + :paramtype user_assigned_identity: str + """ super(CmkKekIdentity, self).__init__(**kwargs) self.use_system_assigned_identity = kwargs.get('use_system_assigned_identity', None) self.user_assigned_identity = kwargs.get('user_assigned_identity', None) @@ -259,8 +330,8 @@ def __init__( class CmkKeyVaultProperties(msrest.serialization.Model): """The properties of the Key Vault which hosts CMK. - :param key_uri: The key uri of the Customer Managed Key. - :type key_uri: str + :ivar key_uri: The key uri of the Customer Managed Key. + :vartype key_uri: str """ _attribute_map = { @@ -271,6 +342,10 @@ def __init__( self, **kwargs ): + """ + :keyword key_uri: The key uri of the Customer Managed Key. + :paramtype key_uri: str + """ super(CmkKeyVaultProperties, self).__init__(**kwargs) self.key_uri = kwargs.get('key_uri', None) @@ -312,6 +387,8 @@ def __init__( self, **kwargs ): + """ + """ super(Error, self).__init__(**kwargs) self.additional_info = None self.code = None @@ -345,6 +422,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.info = None self.type = None @@ -361,15 +440,15 @@ class IdentityData(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: Required. The type of managed identity used. The type 'SystemAssigned, + :ivar type: Required. The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: "SystemAssigned", "None", "UserAssigned", "SystemAssigned, UserAssigned". - :type type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType - :param user_assigned_identities: The list of user-assigned identities associated with the + :vartype type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType + :ivar user_assigned_identities: The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, ~azure.mgmt.recoveryservices.models.UserIdentity] + :vartype user_assigned_identities: dict[str, ~azure.mgmt.recoveryservices.models.UserIdentity] """ _validation = { @@ -389,6 +468,18 @@ def __init__( self, **kwargs ): + """ + :keyword type: Required. The type of managed identity used. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user-assigned + identities. The type 'None' will remove any identities. Possible values include: + "SystemAssigned", "None", "UserAssigned", "SystemAssigned, UserAssigned". + :paramtype type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType + :keyword user_assigned_identities: The list of user-assigned identities associated with the + resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.recoveryservices.models.UserIdentity] + """ super(IdentityData, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -399,12 +490,12 @@ def __init__( class JobsSummary(msrest.serialization.Model): """Summary of the replication job data for this vault. - :param failed_jobs: Count of failed jobs. - :type failed_jobs: int - :param suspended_jobs: Count of suspended jobs. - :type suspended_jobs: int - :param in_progress_jobs: Count of in-progress jobs. - :type in_progress_jobs: int + :ivar failed_jobs: Count of failed jobs. + :vartype failed_jobs: int + :ivar suspended_jobs: Count of suspended jobs. + :vartype suspended_jobs: int + :ivar in_progress_jobs: Count of in-progress jobs. + :vartype in_progress_jobs: int """ _attribute_map = { @@ -417,6 +508,14 @@ def __init__( self, **kwargs ): + """ + :keyword failed_jobs: Count of failed jobs. + :paramtype failed_jobs: int + :keyword suspended_jobs: Count of suspended jobs. + :paramtype suspended_jobs: int + :keyword in_progress_jobs: Count of in-progress jobs. + :paramtype in_progress_jobs: int + """ super(JobsSummary, self).__init__(**kwargs) self.failed_jobs = kwargs.get('failed_jobs', None) self.suspended_jobs = kwargs.get('suspended_jobs', None) @@ -426,18 +525,18 @@ def __init__( class MonitoringSummary(msrest.serialization.Model): """Summary of the replication monitoring data for this vault. - :param un_healthy_vm_count: Count of unhealthy VMs. - :type un_healthy_vm_count: int - :param un_healthy_provider_count: Count of unhealthy replication providers. - :type un_healthy_provider_count: int - :param events_count: Count of all critical warnings. - :type events_count: int - :param deprecated_provider_count: Count of all deprecated recovery service providers. - :type deprecated_provider_count: int - :param supported_provider_count: Count of all the supported recovery service providers. - :type supported_provider_count: int - :param unsupported_provider_count: Count of all the unsupported recovery service providers. - :type unsupported_provider_count: int + :ivar un_healthy_vm_count: Count of unhealthy VMs. + :vartype un_healthy_vm_count: int + :ivar un_healthy_provider_count: Count of unhealthy replication providers. + :vartype un_healthy_provider_count: int + :ivar events_count: Count of all critical warnings. + :vartype events_count: int + :ivar deprecated_provider_count: Count of all deprecated recovery service providers. + :vartype deprecated_provider_count: int + :ivar supported_provider_count: Count of all the supported recovery service providers. + :vartype supported_provider_count: int + :ivar unsupported_provider_count: Count of all the unsupported recovery service providers. + :vartype unsupported_provider_count: int """ _attribute_map = { @@ -453,6 +552,20 @@ def __init__( self, **kwargs ): + """ + :keyword un_healthy_vm_count: Count of unhealthy VMs. + :paramtype un_healthy_vm_count: int + :keyword un_healthy_provider_count: Count of unhealthy replication providers. + :paramtype un_healthy_provider_count: int + :keyword events_count: Count of all critical warnings. + :paramtype events_count: int + :keyword deprecated_provider_count: Count of all deprecated recovery service providers. + :paramtype deprecated_provider_count: int + :keyword supported_provider_count: Count of all the supported recovery service providers. + :paramtype supported_provider_count: int + :keyword unsupported_provider_count: Count of all the unsupported recovery service providers. + :paramtype unsupported_provider_count: int + """ super(MonitoringSummary, self).__init__(**kwargs) self.un_healthy_vm_count = kwargs.get('un_healthy_vm_count', None) self.un_healthy_provider_count = kwargs.get('un_healthy_provider_count', None) @@ -465,10 +578,10 @@ def __init__( class NameInfo(msrest.serialization.Model): """The name of usage. - :param value: Value of usage. - :type value: str - :param localized_value: Localized value of usage. - :type localized_value: str + :ivar value: Value of usage. + :vartype value: str + :ivar localized_value: Localized value of usage. + :vartype localized_value: str """ _attribute_map = { @@ -480,6 +593,12 @@ def __init__( self, **kwargs ): + """ + :keyword value: Value of usage. + :paramtype value: str + :keyword localized_value: Localized value of usage. + :paramtype localized_value: str + """ super(NameInfo, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.localized_value = kwargs.get('localized_value', None) @@ -488,20 +607,20 @@ def __init__( class OperationResource(msrest.serialization.Model): """Operation Resource. - :param end_time: End time of the operation. - :type end_time: ~datetime.datetime - :param error: Required if status == failed or status == canceled. This is the OData v4 error + :ivar end_time: End time of the operation. + :vartype end_time: ~datetime.datetime + :ivar error: Required if status == failed or status == canceled. This is the OData v4 error format, used by the RPC and will go into the v2.2 Azure REST API guidelines. - :type error: ~azure.mgmt.recoveryservices.models.Error - :param id: It should match what is used to GET the operation result. - :type id: str - :param name: It must match the last segment of the "id" field, and will typically be a GUID / + :vartype error: ~azure.mgmt.recoveryservices.models.Error + :ivar id: It should match what is used to GET the operation result. + :vartype id: str + :ivar name: It must match the last segment of the "id" field, and will typically be a GUID / system generated value. - :type name: str - :param status: The status of the operation. (InProgress/Success/Failed/Cancelled). - :type status: str - :param start_time: Start time of the operation. - :type start_time: ~datetime.datetime + :vartype name: str + :ivar status: The status of the operation. (InProgress/Success/Failed/Cancelled). + :vartype status: str + :ivar start_time: Start time of the operation. + :vartype start_time: ~datetime.datetime """ _attribute_map = { @@ -517,6 +636,22 @@ def __init__( self, **kwargs ): + """ + :keyword end_time: End time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword error: Required if status == failed or status == canceled. This is the OData v4 error + format, used by the RPC and will go into the v2.2 Azure REST API guidelines. + :paramtype error: ~azure.mgmt.recoveryservices.models.Error + :keyword id: It should match what is used to GET the operation result. + :paramtype id: str + :keyword name: It must match the last segment of the "id" field, and will typically be a GUID / + system generated value. + :paramtype name: str + :keyword status: The status of the operation. (InProgress/Success/Failed/Cancelled). + :paramtype status: str + :keyword start_time: Start time of the operation. + :paramtype start_time: ~datetime.datetime + """ super(OperationResource, self).__init__(**kwargs) self.end_time = kwargs.get('end_time', None) self.error = kwargs.get('error', None) @@ -538,8 +673,8 @@ class Resource(msrest.serialization.Model): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str + :ivar etag: Optional ETag. + :vartype etag: str """ _validation = { @@ -559,6 +694,10 @@ def __init__( self, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -578,12 +717,12 @@ class PatchTrackedResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -605,6 +744,14 @@ def __init__( self, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(PatchTrackedResource, self).__init__(**kwargs) self.location = kwargs.get('location', None) self.tags = kwargs.get('tags', None) @@ -622,18 +769,18 @@ class PatchVault(PatchTrackedResource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Properties of the vault. + :vartype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :ivar sku: Identifies the unique system identifier for each Azure resource. + :vartype sku: ~azure.mgmt.recoveryservices.models.Sku + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.recoveryservices.models.IdentityData """ _validation = { @@ -658,6 +805,20 @@ def __init__( self, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: Properties of the vault. + :paramtype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :keyword sku: Identifies the unique system identifier for each Azure resource. + :paramtype sku: ~azure.mgmt.recoveryservices.models.Sku + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.recoveryservices.models.IdentityData + """ super(PatchVault, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.sku = kwargs.get('sku', None) @@ -685,6 +846,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None @@ -722,6 +885,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.provisioning_state = None self.private_endpoint = None @@ -738,25 +903,43 @@ class PrivateEndpointConnectionVaultProperties(msrest.serialization.Model): :vartype id: str :ivar properties: Private Endpoint Connection Response Properties. :vartype properties: ~azure.mgmt.recoveryservices.models.PrivateEndpointConnection + :ivar name: The name of the private Endpoint Connection. + :vartype name: str + :ivar type: The type, which will be of the format, + Microsoft.RecoveryServices/vaults/privateEndpointConnections. + :vartype type: str + :ivar location: The location of the private Endpoint connection. + :vartype location: str """ _validation = { 'id': {'readonly': True}, 'properties': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnection'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__( self, **kwargs ): + """ + """ super(PrivateEndpointConnectionVaultProperties, self).__init__(**kwargs) self.id = None self.properties = None + self.name = None + self.type = None + self.location = None class PrivateLinkResource(msrest.serialization.Model): @@ -801,6 +984,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = None self.name = None @@ -813,10 +998,10 @@ def __init__( class PrivateLinkResources(msrest.serialization.Model): """Class which represent the stamps associated with the vault. - :param value: A collection of private link resources. - :type value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] - :param next_link: Link to the next chunk of the response. - :type next_link: str + :ivar value: A collection of private link resources. + :vartype value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] + :ivar next_link: Link to the next chunk of the response. + :vartype next_link: str """ _attribute_map = { @@ -828,6 +1013,12 @@ def __init__( self, **kwargs ): + """ + :keyword value: A collection of private link resources. + :paramtype value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] + :keyword next_link: Link to the next chunk of the response. + :paramtype next_link: str + """ super(PrivateLinkResources, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -863,6 +1054,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = None self.description = None @@ -872,11 +1065,11 @@ def __init__( class RawCertificateData(msrest.serialization.Model): """Raw certificate data. - :param auth_type: Specifies the authentication type. Possible values include: "Invalid", "ACS", + :ivar auth_type: Specifies the authentication type. Possible values include: "Invalid", "ACS", "AAD", "AccessControlService", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray + :vartype auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray """ _attribute_map = { @@ -888,6 +1081,13 @@ def __init__( self, **kwargs ): + """ + :keyword auth_type: Specifies the authentication type. Possible values include: "Invalid", + "ACS", "AAD", "AccessControlService", "AzureActiveDirectory". + :paramtype auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + """ super(RawCertificateData, self).__init__(**kwargs) self.auth_type = kwargs.get('auth_type', None) self.certificate = kwargs.get('certificate', None) @@ -896,19 +1096,19 @@ def __init__( class ReplicationUsage(msrest.serialization.Model): """Replication usages of a vault. - :param monitoring_summary: Summary of the replication monitoring data for this vault. - :type monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary - :param jobs_summary: Summary of the replication jobs data for this vault. - :type jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary - :param protected_item_count: Number of replication protected items for this vault. - :type protected_item_count: int - :param recovery_plan_count: Number of replication recovery plans for this vault. - :type recovery_plan_count: int - :param registered_servers_count: Number of servers registered to this vault. - :type registered_servers_count: int - :param recovery_services_provider_auth_type: The authentication type of recovery service + :ivar monitoring_summary: Summary of the replication monitoring data for this vault. + :vartype monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary + :ivar jobs_summary: Summary of the replication jobs data for this vault. + :vartype jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary + :ivar protected_item_count: Number of replication protected items for this vault. + :vartype protected_item_count: int + :ivar recovery_plan_count: Number of replication recovery plans for this vault. + :vartype recovery_plan_count: int + :ivar registered_servers_count: Number of servers registered to this vault. + :vartype registered_servers_count: int + :ivar recovery_services_provider_auth_type: The authentication type of recovery service providers in the vault. - :type recovery_services_provider_auth_type: int + :vartype recovery_services_provider_auth_type: int """ _attribute_map = { @@ -924,6 +1124,21 @@ def __init__( self, **kwargs ): + """ + :keyword monitoring_summary: Summary of the replication monitoring data for this vault. + :paramtype monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary + :keyword jobs_summary: Summary of the replication jobs data for this vault. + :paramtype jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary + :keyword protected_item_count: Number of replication protected items for this vault. + :paramtype protected_item_count: int + :keyword recovery_plan_count: Number of replication recovery plans for this vault. + :paramtype recovery_plan_count: int + :keyword registered_servers_count: Number of servers registered to this vault. + :paramtype registered_servers_count: int + :keyword recovery_services_provider_auth_type: The authentication type of recovery service + providers in the vault. + :paramtype recovery_services_provider_auth_type: int + """ super(ReplicationUsage, self).__init__(**kwargs) self.monitoring_summary = kwargs.get('monitoring_summary', None) self.jobs_summary = kwargs.get('jobs_summary', None) @@ -936,8 +1151,8 @@ def __init__( class ReplicationUsageList(msrest.serialization.Model): """Replication usages for vault. - :param value: The list of replication usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] + :ivar value: The list of replication usages for the given vault. + :vartype value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] """ _attribute_map = { @@ -948,6 +1163,10 @@ def __init__( self, **kwargs ): + """ + :keyword value: The list of replication usages for the given vault. + :paramtype value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] + """ super(ReplicationUsageList, self).__init__(**kwargs) self.value = kwargs.get('value', None) @@ -960,25 +1179,25 @@ class ResourceCertificateDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime """ _validation = { @@ -1005,6 +1224,24 @@ def __init__( self, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + """ super(ResourceCertificateDetails, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] self.certificate = kwargs.get('certificate', None) @@ -1022,37 +1259,37 @@ class ResourceCertificateAndAadDetails(ResourceCertificateDetails): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param aad_authority: Required. AAD tenant authority. - :type aad_authority: str - :param aad_tenant_id: Required. AAD tenant Id. - :type aad_tenant_id: str - :param service_principal_client_id: Required. AAD service principal clientId. - :type service_principal_client_id: str - :param service_principal_object_id: Required. AAD service principal ObjectId. - :type service_principal_object_id: str - :param azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. - :type azure_management_endpoint_audience: str - :param service_resource_id: Service Resource Id. - :type service_resource_id: str + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime + :ivar aad_authority: Required. AAD tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Required. AAD tenant Id. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Required. AAD service principal clientId. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Required. AAD service principal ObjectId. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. + :vartype azure_management_endpoint_audience: str + :ivar service_resource_id: Service Resource Id. + :vartype service_resource_id: str """ _validation = { @@ -1086,6 +1323,36 @@ def __init__( self, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + :keyword aad_authority: Required. AAD tenant authority. + :paramtype aad_authority: str + :keyword aad_tenant_id: Required. AAD tenant Id. + :paramtype aad_tenant_id: str + :keyword service_principal_client_id: Required. AAD service principal clientId. + :paramtype service_principal_client_id: str + :keyword service_principal_object_id: Required. AAD service principal ObjectId. + :paramtype service_principal_object_id: str + :keyword azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. + :paramtype azure_management_endpoint_audience: str + :keyword service_resource_id: Service Resource Id. + :paramtype service_resource_id: str + """ super(ResourceCertificateAndAadDetails, self).__init__(**kwargs) self.auth_type = 'AzureActiveDirectory' # type: str self.aad_authority = kwargs['aad_authority'] @@ -1101,31 +1368,31 @@ class ResourceCertificateAndAcsDetails(ResourceCertificateDetails): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param global_acs_namespace: Required. ACS namespace name - tenant for our service. - :type global_acs_namespace: str - :param global_acs_host_name: Required. Acs mgmt host name to connect to. - :type global_acs_host_name: str - :param global_acs_rp_realm: Required. Global ACS namespace RP realm. - :type global_acs_rp_realm: str + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime + :ivar global_acs_namespace: Required. ACS namespace name - tenant for our service. + :vartype global_acs_namespace: str + :ivar global_acs_host_name: Required. Acs mgmt host name to connect to. + :vartype global_acs_host_name: str + :ivar global_acs_rp_realm: Required. Global ACS namespace RP realm. + :vartype global_acs_rp_realm: str """ _validation = { @@ -1154,6 +1421,30 @@ def __init__( self, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + :keyword global_acs_namespace: Required. ACS namespace name - tenant for our service. + :paramtype global_acs_namespace: str + :keyword global_acs_host_name: Required. Acs mgmt host name to connect to. + :paramtype global_acs_host_name: str + :keyword global_acs_rp_realm: Required. Global ACS namespace RP realm. + :paramtype global_acs_rp_realm: str + """ super(ResourceCertificateAndAcsDetails, self).__init__(**kwargs) self.auth_type = 'AccessControlService' # type: str self.global_acs_namespace = kwargs['global_acs_namespace'] @@ -1166,10 +1457,16 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The Sku name. Possible values include: "Standard", "RS0". - :type name: str or ~azure.mgmt.recoveryservices.models.SkuName - :param tier: The Sku tier. - :type tier: str + :ivar name: Required. The Sku name. Possible values include: "Standard", "RS0". + :vartype name: str or ~azure.mgmt.recoveryservices.models.SkuName + :ivar tier: The Sku tier. + :vartype tier: str + :ivar family: The sku family. + :vartype family: str + :ivar size: The sku size. + :vartype size: str + :ivar capacity: The sku capacity. + :vartype capacity: str """ _validation = { @@ -1179,34 +1476,52 @@ class Sku(msrest.serialization.Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'str'}, } def __init__( self, **kwargs ): + """ + :keyword name: Required. The Sku name. Possible values include: "Standard", "RS0". + :paramtype name: str or ~azure.mgmt.recoveryservices.models.SkuName + :keyword tier: The Sku tier. + :paramtype tier: str + :keyword family: The sku family. + :paramtype family: str + :keyword size: The sku size. + :paramtype size: str + :keyword capacity: The sku capacity. + :paramtype capacity: str + """ super(Sku, self).__init__(**kwargs) self.name = kwargs['name'] self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) + self.size = kwargs.get('size', None) + self.capacity = kwargs.get('capacity', None) class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :vartype last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -1222,6 +1537,22 @@ def __init__( self, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = kwargs.get('created_by', None) self.created_by_type = kwargs.get('created_by_type', None) @@ -1245,12 +1576,12 @@ class TrackedResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1273,6 +1604,14 @@ def __init__( self, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TrackedResource, self).__init__(**kwargs) self.location = kwargs['location'] self.tags = kwargs.get('tags', None) @@ -1333,6 +1672,8 @@ def __init__( self, **kwargs ): + """ + """ super(UpgradeDetails, self).__init__(**kwargs) self.operation_id = None self.start_time_utc = None @@ -1370,6 +1711,8 @@ def __init__( self, **kwargs ): + """ + """ super(UserIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -1389,18 +1732,18 @@ class Vault(TrackedResource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.recoveryservices.models.IdentityData + :ivar properties: Properties of the vault. + :vartype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :ivar sku: Identifies the unique system identifier for each Azure resource. + :vartype sku: ~azure.mgmt.recoveryservices.models.Sku :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.recoveryservices.models.SystemData """ @@ -1430,6 +1773,20 @@ def __init__( self, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.recoveryservices.models.IdentityData + :keyword properties: Properties of the vault. + :paramtype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :keyword sku: Identifies the unique system identifier for each Azure resource. + :paramtype sku: ~azure.mgmt.recoveryservices.models.Sku + """ super(Vault, self).__init__(**kwargs) self.identity = kwargs.get('identity', None) self.properties = kwargs.get('properties', None) @@ -1449,8 +1806,8 @@ class VaultCertificateResponse(msrest.serialization.Model): :vartype type: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param properties: Certificate details representing the Vault credentials. - :type properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails + :ivar properties: Certificate details representing the Vault credentials. + :vartype properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails """ _validation = { @@ -1470,6 +1827,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: Certificate details representing the Vault credentials. + :paramtype properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails + """ super(VaultCertificateResponse, self).__init__(**kwargs) self.name = None self.type = None @@ -1489,16 +1850,16 @@ class VaultExtendedInfoResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param integrity_key: Integrity key. - :type integrity_key: str - :param encryption_key: Encryption key. - :type encryption_key: str - :param encryption_key_thumbprint: Encryption key thumbprint. - :type encryption_key_thumbprint: str - :param algorithm: Algorithm for Vault ExtendedInfo. - :type algorithm: str + :ivar etag: Optional ETag. + :vartype etag: str + :ivar integrity_key: Integrity key. + :vartype integrity_key: str + :ivar encryption_key: Encryption key. + :vartype encryption_key: str + :ivar encryption_key_thumbprint: Encryption key thumbprint. + :vartype encryption_key_thumbprint: str + :ivar algorithm: Algorithm for Vault ExtendedInfo. + :vartype algorithm: str """ _validation = { @@ -1522,6 +1883,18 @@ def __init__( self, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword integrity_key: Integrity key. + :paramtype integrity_key: str + :keyword encryption_key: Encryption key. + :paramtype encryption_key: str + :keyword encryption_key_thumbprint: Encryption key thumbprint. + :paramtype encryption_key_thumbprint: str + :keyword algorithm: Algorithm for Vault ExtendedInfo. + :paramtype algorithm: str + """ super(VaultExtendedInfoResource, self).__init__(**kwargs) self.integrity_key = kwargs.get('integrity_key', None) self.encryption_key = kwargs.get('encryption_key', None) @@ -1534,8 +1907,8 @@ class VaultList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: - :type value: list[~azure.mgmt.recoveryservices.models.Vault] + :ivar value: + :vartype value: list[~azure.mgmt.recoveryservices.models.Vault] :ivar next_link: :vartype next_link: str """ @@ -1553,6 +1926,10 @@ def __init__( self, **kwargs ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.recoveryservices.models.Vault] + """ super(VaultList, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = None @@ -1565,8 +1942,8 @@ class VaultProperties(msrest.serialization.Model): :ivar provisioning_state: Provisioning State. :vartype provisioning_state: str - :param upgrade_details: Details for upgrading vault. - :type upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails + :ivar upgrade_details: Details for upgrading vault. + :vartype upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails :ivar private_endpoint_connections: List of private endpoint connection. :vartype private_endpoint_connections: list[~azure.mgmt.recoveryservices.models.PrivateEndpointConnectionVaultProperties] @@ -1578,8 +1955,18 @@ class VaultProperties(msrest.serialization.Model): Possible values include: "None", "Enabled". :vartype private_endpoint_state_for_site_recovery: str or ~azure.mgmt.recoveryservices.models.VaultPrivateEndpointState - :param encryption: Customer Managed Key details of the resource. - :type encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :ivar encryption: Customer Managed Key details of the resource. + :vartype encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :ivar move_details: The details of the latest move operation performed on the Azure Resource. + :vartype move_details: ~azure.mgmt.recoveryservices.models.VaultPropertiesMoveDetails + :ivar move_state: The State of the Resource after the move operation. Possible values include: + "Unknown", "InProgress", "PrepareFailed", "CommitFailed", "PrepareTimedout", "CommitTimedout", + "MoveSucceeded", "Failure", "CriticalFailure", "PartialSuccess". + :vartype move_state: str or ~azure.mgmt.recoveryservices.models.ResourceMoveState + :ivar backup_storage_version: Backup storage version. Possible values include: "V1", "V2", + "Unassigned". + :vartype backup_storage_version: str or + ~azure.mgmt.recoveryservices.models.BackupStorageVersion """ _validation = { @@ -1587,6 +1974,8 @@ class VaultProperties(msrest.serialization.Model): 'private_endpoint_connections': {'readonly': True}, 'private_endpoint_state_for_backup': {'readonly': True}, 'private_endpoint_state_for_site_recovery': {'readonly': True}, + 'move_state': {'readonly': True}, + 'backup_storage_version': {'readonly': True}, } _attribute_map = { @@ -1596,12 +1985,24 @@ class VaultProperties(msrest.serialization.Model): 'private_endpoint_state_for_backup': {'key': 'privateEndpointStateForBackup', 'type': 'str'}, 'private_endpoint_state_for_site_recovery': {'key': 'privateEndpointStateForSiteRecovery', 'type': 'str'}, 'encryption': {'key': 'encryption', 'type': 'VaultPropertiesEncryption'}, + 'move_details': {'key': 'moveDetails', 'type': 'VaultPropertiesMoveDetails'}, + 'move_state': {'key': 'moveState', 'type': 'str'}, + 'backup_storage_version': {'key': 'backupStorageVersion', 'type': 'str'}, } def __init__( self, **kwargs ): + """ + :keyword upgrade_details: Details for upgrading vault. + :paramtype upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails + :keyword encryption: Customer Managed Key details of the resource. + :paramtype encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :keyword move_details: The details of the latest move operation performed on the Azure + Resource. + :paramtype move_details: ~azure.mgmt.recoveryservices.models.VaultPropertiesMoveDetails + """ super(VaultProperties, self).__init__(**kwargs) self.provisioning_state = None self.upgrade_details = kwargs.get('upgrade_details', None) @@ -1609,18 +2010,21 @@ def __init__( self.private_endpoint_state_for_backup = None self.private_endpoint_state_for_site_recovery = None self.encryption = kwargs.get('encryption', None) + self.move_details = kwargs.get('move_details', None) + self.move_state = None + self.backup_storage_version = None class VaultPropertiesEncryption(msrest.serialization.Model): """Customer Managed Key details of the resource. - :param key_vault_properties: The properties of the Key Vault which hosts CMK. - :type key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties - :param kek_identity: The details of the identity used for CMK. - :type kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity - :param infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible + :ivar key_vault_properties: The properties of the Key Vault which hosts CMK. + :vartype key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties + :ivar kek_identity: The details of the identity used for CMK. + :vartype kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity + :ivar infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible values include: "Enabled", "Disabled". - :type infrastructure_encryption: str or + :vartype infrastructure_encryption: str or ~azure.mgmt.recoveryservices.models.InfrastructureEncryptionState """ @@ -1634,28 +2038,85 @@ def __init__( self, **kwargs ): + """ + :keyword key_vault_properties: The properties of the Key Vault which hosts CMK. + :paramtype key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties + :keyword kek_identity: The details of the identity used for CMK. + :paramtype kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity + :keyword infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible + values include: "Enabled", "Disabled". + :paramtype infrastructure_encryption: str or + ~azure.mgmt.recoveryservices.models.InfrastructureEncryptionState + """ super(VaultPropertiesEncryption, self).__init__(**kwargs) self.key_vault_properties = kwargs.get('key_vault_properties', None) self.kek_identity = kwargs.get('kek_identity', None) self.infrastructure_encryption = kwargs.get('infrastructure_encryption', None) +class VaultPropertiesMoveDetails(msrest.serialization.Model): + """The details of the latest move operation performed on the Azure Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar operation_id: OperationId of the Resource Move Operation. + :vartype operation_id: str + :ivar start_time_utc: Start Time of the Resource Move Operation. + :vartype start_time_utc: ~datetime.datetime + :ivar completion_time_utc: End Time of the Resource Move Operation. + :vartype completion_time_utc: ~datetime.datetime + :ivar source_resource_id: Source Resource of the Resource Move Operation. + :vartype source_resource_id: str + :ivar target_resource_id: Target Resource of the Resource Move Operation. + :vartype target_resource_id: str + """ + + _validation = { + 'operation_id': {'readonly': True}, + 'start_time_utc': {'readonly': True}, + 'completion_time_utc': {'readonly': True}, + 'source_resource_id': {'readonly': True}, + 'target_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, + 'completion_time_utc': {'key': 'completionTimeUtc', 'type': 'iso-8601'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(VaultPropertiesMoveDetails, self).__init__(**kwargs) + self.operation_id = None + self.start_time_utc = None + self.completion_time_utc = None + self.source_resource_id = None + self.target_resource_id = None + + class VaultUsage(msrest.serialization.Model): """Usages of a vault. - :param unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", - "Percent", "CountPerSecond", "BytesPerSecond". - :type unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit - :param quota_period: Quota period of usage. - :type quota_period: str - :param next_reset_time: Next reset time of usage. - :type next_reset_time: ~datetime.datetime - :param current_value: Current value of usage. - :type current_value: long - :param limit: Limit of usage. - :type limit: long - :param name: Name of usage. - :type name: ~azure.mgmt.recoveryservices.models.NameInfo + :ivar unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond". + :vartype unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit + :ivar quota_period: Quota period of usage. + :vartype quota_period: str + :ivar next_reset_time: Next reset time of usage. + :vartype next_reset_time: ~datetime.datetime + :ivar current_value: Current value of usage. + :vartype current_value: long + :ivar limit: Limit of usage. + :vartype limit: long + :ivar name: Name of usage. + :vartype name: ~azure.mgmt.recoveryservices.models.NameInfo """ _attribute_map = { @@ -1671,6 +2132,21 @@ def __init__( self, **kwargs ): + """ + :keyword unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", + "Percent", "CountPerSecond", "BytesPerSecond". + :paramtype unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit + :keyword quota_period: Quota period of usage. + :paramtype quota_period: str + :keyword next_reset_time: Next reset time of usage. + :paramtype next_reset_time: ~datetime.datetime + :keyword current_value: Current value of usage. + :paramtype current_value: long + :keyword limit: Limit of usage. + :paramtype limit: long + :keyword name: Name of usage. + :paramtype name: ~azure.mgmt.recoveryservices.models.NameInfo + """ super(VaultUsage, self).__init__(**kwargs) self.unit = kwargs.get('unit', None) self.quota_period = kwargs.get('quota_period', None) @@ -1683,8 +2159,8 @@ def __init__( class VaultUsageList(msrest.serialization.Model): """Usage for vault. - :param value: The list of usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.VaultUsage] + :ivar value: The list of usages for the given vault. + :vartype value: list[~azure.mgmt.recoveryservices.models.VaultUsage] """ _attribute_map = { @@ -1695,5 +2171,9 @@ def __init__( self, **kwargs ): + """ + :keyword value: The list of usages for the given vault. + :paramtype value: list[~azure.mgmt.recoveryservices.models.VaultUsage] + """ super(VaultUsageList, self).__init__(**kwargs) self.value = kwargs.get('value', None) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py index 51c474475d05..69a1fa778ffb 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py @@ -17,8 +17,8 @@ class CertificateRequest(msrest.serialization.Model): """Details of the certificate to be uploaded to the vault. - :param properties: Raw certificate data. - :type properties: ~azure.mgmt.recoveryservices.models.RawCertificateData + :ivar properties: Raw certificate data. + :vartype properties: ~azure.mgmt.recoveryservices.models.RawCertificateData """ _attribute_map = { @@ -31,6 +31,10 @@ def __init__( properties: Optional["RawCertificateData"] = None, **kwargs ): + """ + :keyword properties: Raw certificate data. + :paramtype properties: ~azure.mgmt.recoveryservices.models.RawCertificateData + """ super(CertificateRequest, self).__init__(**kwargs) self.properties = properties @@ -38,10 +42,10 @@ def __init__( class CheckNameAvailabilityParameters(msrest.serialization.Model): """Resource Name availability input parameters - Resource type and resource name. - :param type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. - :type type: str - :param name: Resource name for which availability needs to be checked. - :type name: str + :ivar type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + :vartype type: str + :ivar name: Resource name for which availability needs to be checked. + :vartype name: str """ _attribute_map = { @@ -56,6 +60,12 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + :paramtype type: str + :keyword name: Resource name for which availability needs to be checked. + :paramtype name: str + """ super(CheckNameAvailabilityParameters, self).__init__(**kwargs) self.type = type self.name = name @@ -64,12 +74,12 @@ def __init__( class CheckNameAvailabilityResult(msrest.serialization.Model): """Response for check name availability API. Resource provider will set availability as true | false. - :param name_available: - :type name_available: bool - :param reason: - :type reason: str - :param message: - :type message: str + :ivar name_available: + :vartype name_available: bool + :ivar reason: + :vartype reason: str + :ivar message: + :vartype message: str """ _attribute_map = { @@ -86,6 +96,14 @@ def __init__( message: Optional[str] = None, **kwargs ): + """ + :keyword name_available: + :paramtype name_available: bool + :keyword reason: + :paramtype reason: str + :keyword message: + :paramtype message: str + """ super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = name_available self.reason = reason @@ -95,14 +113,14 @@ def __init__( class ClientDiscoveryDisplay(msrest.serialization.Model): """Localized display information of an operation. - :param provider: Name of the provider for display purposes. - :type provider: str - :param resource: ResourceType for which this Operation can be performed. - :type resource: str - :param operation: Operations Name itself. - :type operation: str - :param description: Description of the operation having details of what operation is about. - :type description: str + :ivar provider: Name of the provider for display purposes. + :vartype provider: str + :ivar resource: ResourceType for which this Operation can be performed. + :vartype resource: str + :ivar operation: Operations Name itself. + :vartype operation: str + :ivar description: Description of the operation having details of what operation is about. + :vartype description: str """ _attribute_map = { @@ -121,6 +139,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Name of the provider for display purposes. + :paramtype provider: str + :keyword resource: ResourceType for which this Operation can be performed. + :paramtype resource: str + :keyword operation: Operations Name itself. + :paramtype operation: str + :keyword description: Description of the operation having details of what operation is about. + :paramtype description: str + """ super(ClientDiscoveryDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -131,12 +159,12 @@ def __init__( class ClientDiscoveryForLogSpecification(msrest.serialization.Model): """Class to represent shoebox log specification in json client discovery. - :param name: Name of the log. - :type name: str - :param display_name: Localized display name. - :type display_name: str - :param blob_duration: Blobs created in customer storage account per hour. - :type blob_duration: str + :ivar name: Name of the log. + :vartype name: str + :ivar display_name: Localized display name. + :vartype display_name: str + :ivar blob_duration: Blobs created in customer storage account per hour. + :vartype blob_duration: str """ _attribute_map = { @@ -153,6 +181,14 @@ def __init__( blob_duration: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the log. + :paramtype name: str + :keyword display_name: Localized display name. + :paramtype display_name: str + :keyword blob_duration: Blobs created in customer storage account per hour. + :paramtype blob_duration: str + """ super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -162,8 +198,8 @@ def __init__( class ClientDiscoveryForProperties(msrest.serialization.Model): """Class to represent shoebox properties in json client discovery. - :param service_specification: Operation properties. - :type service_specification: + :ivar service_specification: Operation properties. + :vartype service_specification: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForServiceSpecification """ @@ -177,6 +213,11 @@ def __init__( service_specification: Optional["ClientDiscoveryForServiceSpecification"] = None, **kwargs ): + """ + :keyword service_specification: Operation properties. + :paramtype service_specification: + ~azure.mgmt.recoveryservices.models.ClientDiscoveryForServiceSpecification + """ super(ClientDiscoveryForProperties, self).__init__(**kwargs) self.service_specification = service_specification @@ -184,8 +225,8 @@ def __init__( class ClientDiscoveryForServiceSpecification(msrest.serialization.Model): """Class to represent shoebox service specification in json client discovery. - :param log_specifications: List of log specifications of this operation. - :type log_specifications: + :ivar log_specifications: List of log specifications of this operation. + :vartype log_specifications: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryForLogSpecification] """ @@ -199,6 +240,11 @@ def __init__( log_specifications: Optional[List["ClientDiscoveryForLogSpecification"]] = None, **kwargs ): + """ + :keyword log_specifications: List of log specifications of this operation. + :paramtype log_specifications: + list[~azure.mgmt.recoveryservices.models.ClientDiscoveryForLogSpecification] + """ super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) self.log_specifications = log_specifications @@ -206,10 +252,10 @@ def __init__( class ClientDiscoveryResponse(msrest.serialization.Model): """Operations List response which contains list of available APIs. - :param value: List of available operations. - :type value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] - :param next_link: Link to the next chunk of the response. - :type next_link: str + :ivar value: List of available operations. + :vartype value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] + :ivar next_link: Link to the next chunk of the response. + :vartype next_link: str """ _attribute_map = { @@ -224,6 +270,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of available operations. + :paramtype value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] + :keyword next_link: Link to the next chunk of the response. + :paramtype next_link: str + """ super(ClientDiscoveryResponse, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -232,15 +284,15 @@ def __init__( class ClientDiscoveryValueForSingleApi(msrest.serialization.Model): """Available operation details. - :param name: Name of the Operation. - :type name: str - :param display: Contains the localized display information for this particular operation. - :type display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay - :param origin: The intended executor of the operation;governs the display of the operation in + :ivar name: Name of the Operation. + :vartype name: str + :ivar display: Contains the localized display information for this particular operation. + :vartype display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay + :ivar origin: The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX. - :type origin: str - :param properties: ShoeBox properties for the given operation. - :type properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties + :vartype origin: str + :ivar properties: ShoeBox properties for the given operation. + :vartype properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties """ _attribute_map = { @@ -259,6 +311,17 @@ def __init__( properties: Optional["ClientDiscoveryForProperties"] = None, **kwargs ): + """ + :keyword name: Name of the Operation. + :paramtype name: str + :keyword display: Contains the localized display information for this particular operation. + :paramtype display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay + :keyword origin: The intended executor of the operation;governs the display of the operation in + the RBAC UX and the audit logs UX. + :paramtype origin: str + :keyword properties: ShoeBox properties for the given operation. + :paramtype properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties + """ super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) self.name = name self.display = display @@ -269,12 +332,12 @@ def __init__( class CmkKekIdentity(msrest.serialization.Model): """The details of the identity used for CMK. - :param use_system_assigned_identity: Indicate that system assigned identity should be used. + :ivar use_system_assigned_identity: Indicate that system assigned identity should be used. Mutually exclusive with 'userAssignedIdentity' field. - :type use_system_assigned_identity: bool - :param user_assigned_identity: The user assigned identity to be used to grant permissions in + :vartype use_system_assigned_identity: bool + :ivar user_assigned_identity: The user assigned identity to be used to grant permissions in case the type of identity used is UserAssigned. - :type user_assigned_identity: str + :vartype user_assigned_identity: str """ _attribute_map = { @@ -289,6 +352,14 @@ def __init__( user_assigned_identity: Optional[str] = None, **kwargs ): + """ + :keyword use_system_assigned_identity: Indicate that system assigned identity should be used. + Mutually exclusive with 'userAssignedIdentity' field. + :paramtype use_system_assigned_identity: bool + :keyword user_assigned_identity: The user assigned identity to be used to grant permissions in + case the type of identity used is UserAssigned. + :paramtype user_assigned_identity: str + """ super(CmkKekIdentity, self).__init__(**kwargs) self.use_system_assigned_identity = use_system_assigned_identity self.user_assigned_identity = user_assigned_identity @@ -297,8 +368,8 @@ def __init__( class CmkKeyVaultProperties(msrest.serialization.Model): """The properties of the Key Vault which hosts CMK. - :param key_uri: The key uri of the Customer Managed Key. - :type key_uri: str + :ivar key_uri: The key uri of the Customer Managed Key. + :vartype key_uri: str """ _attribute_map = { @@ -311,6 +382,10 @@ def __init__( key_uri: Optional[str] = None, **kwargs ): + """ + :keyword key_uri: The key uri of the Customer Managed Key. + :paramtype key_uri: str + """ super(CmkKeyVaultProperties, self).__init__(**kwargs) self.key_uri = key_uri @@ -352,6 +427,8 @@ def __init__( self, **kwargs ): + """ + """ super(Error, self).__init__(**kwargs) self.additional_info = None self.code = None @@ -385,6 +462,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.info = None self.type = None @@ -401,15 +480,15 @@ class IdentityData(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: Required. The type of managed identity used. The type 'SystemAssigned, + :ivar type: Required. The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: "SystemAssigned", "None", "UserAssigned", "SystemAssigned, UserAssigned". - :type type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType - :param user_assigned_identities: The list of user-assigned identities associated with the + :vartype type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType + :ivar user_assigned_identities: The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, ~azure.mgmt.recoveryservices.models.UserIdentity] + :vartype user_assigned_identities: dict[str, ~azure.mgmt.recoveryservices.models.UserIdentity] """ _validation = { @@ -432,6 +511,18 @@ def __init__( user_assigned_identities: Optional[Dict[str, "UserIdentity"]] = None, **kwargs ): + """ + :keyword type: Required. The type of managed identity used. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user-assigned + identities. The type 'None' will remove any identities. Possible values include: + "SystemAssigned", "None", "UserAssigned", "SystemAssigned, UserAssigned". + :paramtype type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType + :keyword user_assigned_identities: The list of user-assigned identities associated with the + resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.recoveryservices.models.UserIdentity] + """ super(IdentityData, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -442,12 +533,12 @@ def __init__( class JobsSummary(msrest.serialization.Model): """Summary of the replication job data for this vault. - :param failed_jobs: Count of failed jobs. - :type failed_jobs: int - :param suspended_jobs: Count of suspended jobs. - :type suspended_jobs: int - :param in_progress_jobs: Count of in-progress jobs. - :type in_progress_jobs: int + :ivar failed_jobs: Count of failed jobs. + :vartype failed_jobs: int + :ivar suspended_jobs: Count of suspended jobs. + :vartype suspended_jobs: int + :ivar in_progress_jobs: Count of in-progress jobs. + :vartype in_progress_jobs: int """ _attribute_map = { @@ -464,6 +555,14 @@ def __init__( in_progress_jobs: Optional[int] = None, **kwargs ): + """ + :keyword failed_jobs: Count of failed jobs. + :paramtype failed_jobs: int + :keyword suspended_jobs: Count of suspended jobs. + :paramtype suspended_jobs: int + :keyword in_progress_jobs: Count of in-progress jobs. + :paramtype in_progress_jobs: int + """ super(JobsSummary, self).__init__(**kwargs) self.failed_jobs = failed_jobs self.suspended_jobs = suspended_jobs @@ -473,18 +572,18 @@ def __init__( class MonitoringSummary(msrest.serialization.Model): """Summary of the replication monitoring data for this vault. - :param un_healthy_vm_count: Count of unhealthy VMs. - :type un_healthy_vm_count: int - :param un_healthy_provider_count: Count of unhealthy replication providers. - :type un_healthy_provider_count: int - :param events_count: Count of all critical warnings. - :type events_count: int - :param deprecated_provider_count: Count of all deprecated recovery service providers. - :type deprecated_provider_count: int - :param supported_provider_count: Count of all the supported recovery service providers. - :type supported_provider_count: int - :param unsupported_provider_count: Count of all the unsupported recovery service providers. - :type unsupported_provider_count: int + :ivar un_healthy_vm_count: Count of unhealthy VMs. + :vartype un_healthy_vm_count: int + :ivar un_healthy_provider_count: Count of unhealthy replication providers. + :vartype un_healthy_provider_count: int + :ivar events_count: Count of all critical warnings. + :vartype events_count: int + :ivar deprecated_provider_count: Count of all deprecated recovery service providers. + :vartype deprecated_provider_count: int + :ivar supported_provider_count: Count of all the supported recovery service providers. + :vartype supported_provider_count: int + :ivar unsupported_provider_count: Count of all the unsupported recovery service providers. + :vartype unsupported_provider_count: int """ _attribute_map = { @@ -507,6 +606,20 @@ def __init__( unsupported_provider_count: Optional[int] = None, **kwargs ): + """ + :keyword un_healthy_vm_count: Count of unhealthy VMs. + :paramtype un_healthy_vm_count: int + :keyword un_healthy_provider_count: Count of unhealthy replication providers. + :paramtype un_healthy_provider_count: int + :keyword events_count: Count of all critical warnings. + :paramtype events_count: int + :keyword deprecated_provider_count: Count of all deprecated recovery service providers. + :paramtype deprecated_provider_count: int + :keyword supported_provider_count: Count of all the supported recovery service providers. + :paramtype supported_provider_count: int + :keyword unsupported_provider_count: Count of all the unsupported recovery service providers. + :paramtype unsupported_provider_count: int + """ super(MonitoringSummary, self).__init__(**kwargs) self.un_healthy_vm_count = un_healthy_vm_count self.un_healthy_provider_count = un_healthy_provider_count @@ -519,10 +632,10 @@ def __init__( class NameInfo(msrest.serialization.Model): """The name of usage. - :param value: Value of usage. - :type value: str - :param localized_value: Localized value of usage. - :type localized_value: str + :ivar value: Value of usage. + :vartype value: str + :ivar localized_value: Localized value of usage. + :vartype localized_value: str """ _attribute_map = { @@ -537,6 +650,12 @@ def __init__( localized_value: Optional[str] = None, **kwargs ): + """ + :keyword value: Value of usage. + :paramtype value: str + :keyword localized_value: Localized value of usage. + :paramtype localized_value: str + """ super(NameInfo, self).__init__(**kwargs) self.value = value self.localized_value = localized_value @@ -545,20 +664,20 @@ def __init__( class OperationResource(msrest.serialization.Model): """Operation Resource. - :param end_time: End time of the operation. - :type end_time: ~datetime.datetime - :param error: Required if status == failed or status == canceled. This is the OData v4 error + :ivar end_time: End time of the operation. + :vartype end_time: ~datetime.datetime + :ivar error: Required if status == failed or status == canceled. This is the OData v4 error format, used by the RPC and will go into the v2.2 Azure REST API guidelines. - :type error: ~azure.mgmt.recoveryservices.models.Error - :param id: It should match what is used to GET the operation result. - :type id: str - :param name: It must match the last segment of the "id" field, and will typically be a GUID / + :vartype error: ~azure.mgmt.recoveryservices.models.Error + :ivar id: It should match what is used to GET the operation result. + :vartype id: str + :ivar name: It must match the last segment of the "id" field, and will typically be a GUID / system generated value. - :type name: str - :param status: The status of the operation. (InProgress/Success/Failed/Cancelled). - :type status: str - :param start_time: Start time of the operation. - :type start_time: ~datetime.datetime + :vartype name: str + :ivar status: The status of the operation. (InProgress/Success/Failed/Cancelled). + :vartype status: str + :ivar start_time: Start time of the operation. + :vartype start_time: ~datetime.datetime """ _attribute_map = { @@ -581,6 +700,22 @@ def __init__( start_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword end_time: End time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword error: Required if status == failed or status == canceled. This is the OData v4 error + format, used by the RPC and will go into the v2.2 Azure REST API guidelines. + :paramtype error: ~azure.mgmt.recoveryservices.models.Error + :keyword id: It should match what is used to GET the operation result. + :paramtype id: str + :keyword name: It must match the last segment of the "id" field, and will typically be a GUID / + system generated value. + :paramtype name: str + :keyword status: The status of the operation. (InProgress/Success/Failed/Cancelled). + :paramtype status: str + :keyword start_time: Start time of the operation. + :paramtype start_time: ~datetime.datetime + """ super(OperationResource, self).__init__(**kwargs) self.end_time = end_time self.error = error @@ -602,8 +737,8 @@ class Resource(msrest.serialization.Model): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str + :ivar etag: Optional ETag. + :vartype etag: str """ _validation = { @@ -625,6 +760,10 @@ def __init__( etag: Optional[str] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -644,12 +783,12 @@ class PatchTrackedResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -675,6 +814,14 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(PatchTrackedResource, self).__init__(etag=etag, **kwargs) self.location = location self.tags = tags @@ -692,18 +839,18 @@ class PatchVault(PatchTrackedResource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Properties of the vault. + :vartype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :ivar sku: Identifies the unique system identifier for each Azure resource. + :vartype sku: ~azure.mgmt.recoveryservices.models.Sku + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.recoveryservices.models.IdentityData """ _validation = { @@ -735,6 +882,20 @@ def __init__( identity: Optional["IdentityData"] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: Properties of the vault. + :paramtype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :keyword sku: Identifies the unique system identifier for each Azure resource. + :paramtype sku: ~azure.mgmt.recoveryservices.models.Sku + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.recoveryservices.models.IdentityData + """ super(PatchVault, self).__init__(etag=etag, location=location, tags=tags, **kwargs) self.properties = properties self.sku = sku @@ -762,6 +923,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None @@ -799,6 +962,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.provisioning_state = None self.private_endpoint = None @@ -815,25 +980,43 @@ class PrivateEndpointConnectionVaultProperties(msrest.serialization.Model): :vartype id: str :ivar properties: Private Endpoint Connection Response Properties. :vartype properties: ~azure.mgmt.recoveryservices.models.PrivateEndpointConnection + :ivar name: The name of the private Endpoint Connection. + :vartype name: str + :ivar type: The type, which will be of the format, + Microsoft.RecoveryServices/vaults/privateEndpointConnections. + :vartype type: str + :ivar location: The location of the private Endpoint connection. + :vartype location: str """ _validation = { 'id': {'readonly': True}, 'properties': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnection'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__( self, **kwargs ): + """ + """ super(PrivateEndpointConnectionVaultProperties, self).__init__(**kwargs) self.id = None self.properties = None + self.name = None + self.type = None + self.location = None class PrivateLinkResource(msrest.serialization.Model): @@ -878,6 +1061,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = None self.name = None @@ -890,10 +1075,10 @@ def __init__( class PrivateLinkResources(msrest.serialization.Model): """Class which represent the stamps associated with the vault. - :param value: A collection of private link resources. - :type value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] - :param next_link: Link to the next chunk of the response. - :type next_link: str + :ivar value: A collection of private link resources. + :vartype value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] + :ivar next_link: Link to the next chunk of the response. + :vartype next_link: str """ _attribute_map = { @@ -908,6 +1093,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: A collection of private link resources. + :paramtype value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] + :keyword next_link: Link to the next chunk of the response. + :paramtype next_link: str + """ super(PrivateLinkResources, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -943,6 +1134,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = None self.description = None @@ -952,11 +1145,11 @@ def __init__( class RawCertificateData(msrest.serialization.Model): """Raw certificate data. - :param auth_type: Specifies the authentication type. Possible values include: "Invalid", "ACS", + :ivar auth_type: Specifies the authentication type. Possible values include: "Invalid", "ACS", "AAD", "AccessControlService", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray + :vartype auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray """ _attribute_map = { @@ -971,6 +1164,13 @@ def __init__( certificate: Optional[bytearray] = None, **kwargs ): + """ + :keyword auth_type: Specifies the authentication type. Possible values include: "Invalid", + "ACS", "AAD", "AccessControlService", "AzureActiveDirectory". + :paramtype auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + """ super(RawCertificateData, self).__init__(**kwargs) self.auth_type = auth_type self.certificate = certificate @@ -979,19 +1179,19 @@ def __init__( class ReplicationUsage(msrest.serialization.Model): """Replication usages of a vault. - :param monitoring_summary: Summary of the replication monitoring data for this vault. - :type monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary - :param jobs_summary: Summary of the replication jobs data for this vault. - :type jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary - :param protected_item_count: Number of replication protected items for this vault. - :type protected_item_count: int - :param recovery_plan_count: Number of replication recovery plans for this vault. - :type recovery_plan_count: int - :param registered_servers_count: Number of servers registered to this vault. - :type registered_servers_count: int - :param recovery_services_provider_auth_type: The authentication type of recovery service + :ivar monitoring_summary: Summary of the replication monitoring data for this vault. + :vartype monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary + :ivar jobs_summary: Summary of the replication jobs data for this vault. + :vartype jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary + :ivar protected_item_count: Number of replication protected items for this vault. + :vartype protected_item_count: int + :ivar recovery_plan_count: Number of replication recovery plans for this vault. + :vartype recovery_plan_count: int + :ivar registered_servers_count: Number of servers registered to this vault. + :vartype registered_servers_count: int + :ivar recovery_services_provider_auth_type: The authentication type of recovery service providers in the vault. - :type recovery_services_provider_auth_type: int + :vartype recovery_services_provider_auth_type: int """ _attribute_map = { @@ -1014,6 +1214,21 @@ def __init__( recovery_services_provider_auth_type: Optional[int] = None, **kwargs ): + """ + :keyword monitoring_summary: Summary of the replication monitoring data for this vault. + :paramtype monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary + :keyword jobs_summary: Summary of the replication jobs data for this vault. + :paramtype jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary + :keyword protected_item_count: Number of replication protected items for this vault. + :paramtype protected_item_count: int + :keyword recovery_plan_count: Number of replication recovery plans for this vault. + :paramtype recovery_plan_count: int + :keyword registered_servers_count: Number of servers registered to this vault. + :paramtype registered_servers_count: int + :keyword recovery_services_provider_auth_type: The authentication type of recovery service + providers in the vault. + :paramtype recovery_services_provider_auth_type: int + """ super(ReplicationUsage, self).__init__(**kwargs) self.monitoring_summary = monitoring_summary self.jobs_summary = jobs_summary @@ -1026,8 +1241,8 @@ def __init__( class ReplicationUsageList(msrest.serialization.Model): """Replication usages for vault. - :param value: The list of replication usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] + :ivar value: The list of replication usages for the given vault. + :vartype value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] """ _attribute_map = { @@ -1040,6 +1255,10 @@ def __init__( value: Optional[List["ReplicationUsage"]] = None, **kwargs ): + """ + :keyword value: The list of replication usages for the given vault. + :paramtype value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] + """ super(ReplicationUsageList, self).__init__(**kwargs) self.value = value @@ -1052,25 +1271,25 @@ class ResourceCertificateDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime """ _validation = { @@ -1106,6 +1325,24 @@ def __init__( valid_to: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + """ super(ResourceCertificateDetails, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] self.certificate = certificate @@ -1123,37 +1360,37 @@ class ResourceCertificateAndAadDetails(ResourceCertificateDetails): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param aad_authority: Required. AAD tenant authority. - :type aad_authority: str - :param aad_tenant_id: Required. AAD tenant Id. - :type aad_tenant_id: str - :param service_principal_client_id: Required. AAD service principal clientId. - :type service_principal_client_id: str - :param service_principal_object_id: Required. AAD service principal ObjectId. - :type service_principal_object_id: str - :param azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. - :type azure_management_endpoint_audience: str - :param service_resource_id: Service Resource Id. - :type service_resource_id: str + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime + :ivar aad_authority: Required. AAD tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Required. AAD tenant Id. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Required. AAD service principal clientId. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Required. AAD service principal ObjectId. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. + :vartype azure_management_endpoint_audience: str + :ivar service_resource_id: Service Resource Id. + :vartype service_resource_id: str """ _validation = { @@ -1202,6 +1439,36 @@ def __init__( service_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + :keyword aad_authority: Required. AAD tenant authority. + :paramtype aad_authority: str + :keyword aad_tenant_id: Required. AAD tenant Id. + :paramtype aad_tenant_id: str + :keyword service_principal_client_id: Required. AAD service principal clientId. + :paramtype service_principal_client_id: str + :keyword service_principal_object_id: Required. AAD service principal ObjectId. + :paramtype service_principal_object_id: str + :keyword azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. + :paramtype azure_management_endpoint_audience: str + :keyword service_resource_id: Service Resource Id. + :paramtype service_resource_id: str + """ super(ResourceCertificateAndAadDetails, self).__init__(certificate=certificate, friendly_name=friendly_name, issuer=issuer, resource_id=resource_id, subject=subject, thumbprint=thumbprint, valid_from=valid_from, valid_to=valid_to, **kwargs) self.auth_type = 'AzureActiveDirectory' # type: str self.aad_authority = aad_authority @@ -1217,31 +1484,31 @@ class ResourceCertificateAndAcsDetails(ResourceCertificateDetails): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param global_acs_namespace: Required. ACS namespace name - tenant for our service. - :type global_acs_namespace: str - :param global_acs_host_name: Required. Acs mgmt host name to connect to. - :type global_acs_host_name: str - :param global_acs_rp_realm: Required. Global ACS namespace RP realm. - :type global_acs_rp_realm: str + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime + :ivar global_acs_namespace: Required. ACS namespace name - tenant for our service. + :vartype global_acs_namespace: str + :ivar global_acs_host_name: Required. Acs mgmt host name to connect to. + :vartype global_acs_host_name: str + :ivar global_acs_rp_realm: Required. Global ACS namespace RP realm. + :vartype global_acs_rp_realm: str """ _validation = { @@ -1282,6 +1549,30 @@ def __init__( valid_to: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + :keyword global_acs_namespace: Required. ACS namespace name - tenant for our service. + :paramtype global_acs_namespace: str + :keyword global_acs_host_name: Required. Acs mgmt host name to connect to. + :paramtype global_acs_host_name: str + :keyword global_acs_rp_realm: Required. Global ACS namespace RP realm. + :paramtype global_acs_rp_realm: str + """ super(ResourceCertificateAndAcsDetails, self).__init__(certificate=certificate, friendly_name=friendly_name, issuer=issuer, resource_id=resource_id, subject=subject, thumbprint=thumbprint, valid_from=valid_from, valid_to=valid_to, **kwargs) self.auth_type = 'AccessControlService' # type: str self.global_acs_namespace = global_acs_namespace @@ -1294,10 +1585,16 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The Sku name. Possible values include: "Standard", "RS0". - :type name: str or ~azure.mgmt.recoveryservices.models.SkuName - :param tier: The Sku tier. - :type tier: str + :ivar name: Required. The Sku name. Possible values include: "Standard", "RS0". + :vartype name: str or ~azure.mgmt.recoveryservices.models.SkuName + :ivar tier: The Sku tier. + :vartype tier: str + :ivar family: The sku family. + :vartype family: str + :ivar size: The sku size. + :vartype size: str + :ivar capacity: The sku capacity. + :vartype capacity: str """ _validation = { @@ -1307,6 +1604,9 @@ class Sku(msrest.serialization.Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'str'}, } def __init__( @@ -1314,30 +1614,48 @@ def __init__( *, name: Union[str, "SkuName"], tier: Optional[str] = None, + family: Optional[str] = None, + size: Optional[str] = None, + capacity: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The Sku name. Possible values include: "Standard", "RS0". + :paramtype name: str or ~azure.mgmt.recoveryservices.models.SkuName + :keyword tier: The Sku tier. + :paramtype tier: str + :keyword family: The sku family. + :paramtype family: str + :keyword size: The sku size. + :paramtype size: str + :keyword capacity: The sku capacity. + :paramtype capacity: str + """ super(Sku, self).__init__(**kwargs) self.name = name self.tier = tier + self.family = family + self.size = size + self.capacity = capacity class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :vartype last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -1360,6 +1678,22 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -1383,12 +1717,12 @@ class TrackedResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1415,6 +1749,14 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TrackedResource, self).__init__(etag=etag, **kwargs) self.location = location self.tags = tags @@ -1475,6 +1817,8 @@ def __init__( self, **kwargs ): + """ + """ super(UpgradeDetails, self).__init__(**kwargs) self.operation_id = None self.start_time_utc = None @@ -1512,6 +1856,8 @@ def __init__( self, **kwargs ): + """ + """ super(UserIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -1531,18 +1877,18 @@ class Vault(TrackedResource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.recoveryservices.models.IdentityData + :ivar properties: Properties of the vault. + :vartype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :ivar sku: Identifies the unique system identifier for each Azure resource. + :vartype sku: ~azure.mgmt.recoveryservices.models.Sku :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.recoveryservices.models.SystemData """ @@ -1579,6 +1925,20 @@ def __init__( sku: Optional["Sku"] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.recoveryservices.models.IdentityData + :keyword properties: Properties of the vault. + :paramtype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :keyword sku: Identifies the unique system identifier for each Azure resource. + :paramtype sku: ~azure.mgmt.recoveryservices.models.Sku + """ super(Vault, self).__init__(etag=etag, location=location, tags=tags, **kwargs) self.identity = identity self.properties = properties @@ -1598,8 +1958,8 @@ class VaultCertificateResponse(msrest.serialization.Model): :vartype type: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param properties: Certificate details representing the Vault credentials. - :type properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails + :ivar properties: Certificate details representing the Vault credentials. + :vartype properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails """ _validation = { @@ -1621,6 +1981,10 @@ def __init__( properties: Optional["ResourceCertificateDetails"] = None, **kwargs ): + """ + :keyword properties: Certificate details representing the Vault credentials. + :paramtype properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails + """ super(VaultCertificateResponse, self).__init__(**kwargs) self.name = None self.type = None @@ -1640,16 +2004,16 @@ class VaultExtendedInfoResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param integrity_key: Integrity key. - :type integrity_key: str - :param encryption_key: Encryption key. - :type encryption_key: str - :param encryption_key_thumbprint: Encryption key thumbprint. - :type encryption_key_thumbprint: str - :param algorithm: Algorithm for Vault ExtendedInfo. - :type algorithm: str + :ivar etag: Optional ETag. + :vartype etag: str + :ivar integrity_key: Integrity key. + :vartype integrity_key: str + :ivar encryption_key: Encryption key. + :vartype encryption_key: str + :ivar encryption_key_thumbprint: Encryption key thumbprint. + :vartype encryption_key_thumbprint: str + :ivar algorithm: Algorithm for Vault ExtendedInfo. + :vartype algorithm: str """ _validation = { @@ -1679,6 +2043,18 @@ def __init__( algorithm: Optional[str] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword integrity_key: Integrity key. + :paramtype integrity_key: str + :keyword encryption_key: Encryption key. + :paramtype encryption_key: str + :keyword encryption_key_thumbprint: Encryption key thumbprint. + :paramtype encryption_key_thumbprint: str + :keyword algorithm: Algorithm for Vault ExtendedInfo. + :paramtype algorithm: str + """ super(VaultExtendedInfoResource, self).__init__(etag=etag, **kwargs) self.integrity_key = integrity_key self.encryption_key = encryption_key @@ -1691,8 +2067,8 @@ class VaultList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: - :type value: list[~azure.mgmt.recoveryservices.models.Vault] + :ivar value: + :vartype value: list[~azure.mgmt.recoveryservices.models.Vault] :ivar next_link: :vartype next_link: str """ @@ -1712,6 +2088,10 @@ def __init__( value: Optional[List["Vault"]] = None, **kwargs ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.recoveryservices.models.Vault] + """ super(VaultList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1724,8 +2104,8 @@ class VaultProperties(msrest.serialization.Model): :ivar provisioning_state: Provisioning State. :vartype provisioning_state: str - :param upgrade_details: Details for upgrading vault. - :type upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails + :ivar upgrade_details: Details for upgrading vault. + :vartype upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails :ivar private_endpoint_connections: List of private endpoint connection. :vartype private_endpoint_connections: list[~azure.mgmt.recoveryservices.models.PrivateEndpointConnectionVaultProperties] @@ -1737,8 +2117,18 @@ class VaultProperties(msrest.serialization.Model): Possible values include: "None", "Enabled". :vartype private_endpoint_state_for_site_recovery: str or ~azure.mgmt.recoveryservices.models.VaultPrivateEndpointState - :param encryption: Customer Managed Key details of the resource. - :type encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :ivar encryption: Customer Managed Key details of the resource. + :vartype encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :ivar move_details: The details of the latest move operation performed on the Azure Resource. + :vartype move_details: ~azure.mgmt.recoveryservices.models.VaultPropertiesMoveDetails + :ivar move_state: The State of the Resource after the move operation. Possible values include: + "Unknown", "InProgress", "PrepareFailed", "CommitFailed", "PrepareTimedout", "CommitTimedout", + "MoveSucceeded", "Failure", "CriticalFailure", "PartialSuccess". + :vartype move_state: str or ~azure.mgmt.recoveryservices.models.ResourceMoveState + :ivar backup_storage_version: Backup storage version. Possible values include: "V1", "V2", + "Unassigned". + :vartype backup_storage_version: str or + ~azure.mgmt.recoveryservices.models.BackupStorageVersion """ _validation = { @@ -1746,6 +2136,8 @@ class VaultProperties(msrest.serialization.Model): 'private_endpoint_connections': {'readonly': True}, 'private_endpoint_state_for_backup': {'readonly': True}, 'private_endpoint_state_for_site_recovery': {'readonly': True}, + 'move_state': {'readonly': True}, + 'backup_storage_version': {'readonly': True}, } _attribute_map = { @@ -1755,6 +2147,9 @@ class VaultProperties(msrest.serialization.Model): 'private_endpoint_state_for_backup': {'key': 'privateEndpointStateForBackup', 'type': 'str'}, 'private_endpoint_state_for_site_recovery': {'key': 'privateEndpointStateForSiteRecovery', 'type': 'str'}, 'encryption': {'key': 'encryption', 'type': 'VaultPropertiesEncryption'}, + 'move_details': {'key': 'moveDetails', 'type': 'VaultPropertiesMoveDetails'}, + 'move_state': {'key': 'moveState', 'type': 'str'}, + 'backup_storage_version': {'key': 'backupStorageVersion', 'type': 'str'}, } def __init__( @@ -1762,8 +2157,18 @@ def __init__( *, upgrade_details: Optional["UpgradeDetails"] = None, encryption: Optional["VaultPropertiesEncryption"] = None, + move_details: Optional["VaultPropertiesMoveDetails"] = None, **kwargs ): + """ + :keyword upgrade_details: Details for upgrading vault. + :paramtype upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails + :keyword encryption: Customer Managed Key details of the resource. + :paramtype encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :keyword move_details: The details of the latest move operation performed on the Azure + Resource. + :paramtype move_details: ~azure.mgmt.recoveryservices.models.VaultPropertiesMoveDetails + """ super(VaultProperties, self).__init__(**kwargs) self.provisioning_state = None self.upgrade_details = upgrade_details @@ -1771,18 +2176,21 @@ def __init__( self.private_endpoint_state_for_backup = None self.private_endpoint_state_for_site_recovery = None self.encryption = encryption + self.move_details = move_details + self.move_state = None + self.backup_storage_version = None class VaultPropertiesEncryption(msrest.serialization.Model): """Customer Managed Key details of the resource. - :param key_vault_properties: The properties of the Key Vault which hosts CMK. - :type key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties - :param kek_identity: The details of the identity used for CMK. - :type kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity - :param infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible + :ivar key_vault_properties: The properties of the Key Vault which hosts CMK. + :vartype key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties + :ivar kek_identity: The details of the identity used for CMK. + :vartype kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity + :ivar infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible values include: "Enabled", "Disabled". - :type infrastructure_encryption: str or + :vartype infrastructure_encryption: str or ~azure.mgmt.recoveryservices.models.InfrastructureEncryptionState """ @@ -1800,28 +2208,85 @@ def __init__( infrastructure_encryption: Optional[Union[str, "InfrastructureEncryptionState"]] = None, **kwargs ): + """ + :keyword key_vault_properties: The properties of the Key Vault which hosts CMK. + :paramtype key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties + :keyword kek_identity: The details of the identity used for CMK. + :paramtype kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity + :keyword infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible + values include: "Enabled", "Disabled". + :paramtype infrastructure_encryption: str or + ~azure.mgmt.recoveryservices.models.InfrastructureEncryptionState + """ super(VaultPropertiesEncryption, self).__init__(**kwargs) self.key_vault_properties = key_vault_properties self.kek_identity = kek_identity self.infrastructure_encryption = infrastructure_encryption +class VaultPropertiesMoveDetails(msrest.serialization.Model): + """The details of the latest move operation performed on the Azure Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar operation_id: OperationId of the Resource Move Operation. + :vartype operation_id: str + :ivar start_time_utc: Start Time of the Resource Move Operation. + :vartype start_time_utc: ~datetime.datetime + :ivar completion_time_utc: End Time of the Resource Move Operation. + :vartype completion_time_utc: ~datetime.datetime + :ivar source_resource_id: Source Resource of the Resource Move Operation. + :vartype source_resource_id: str + :ivar target_resource_id: Target Resource of the Resource Move Operation. + :vartype target_resource_id: str + """ + + _validation = { + 'operation_id': {'readonly': True}, + 'start_time_utc': {'readonly': True}, + 'completion_time_utc': {'readonly': True}, + 'source_resource_id': {'readonly': True}, + 'target_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, + 'completion_time_utc': {'key': 'completionTimeUtc', 'type': 'iso-8601'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(VaultPropertiesMoveDetails, self).__init__(**kwargs) + self.operation_id = None + self.start_time_utc = None + self.completion_time_utc = None + self.source_resource_id = None + self.target_resource_id = None + + class VaultUsage(msrest.serialization.Model): """Usages of a vault. - :param unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", - "Percent", "CountPerSecond", "BytesPerSecond". - :type unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit - :param quota_period: Quota period of usage. - :type quota_period: str - :param next_reset_time: Next reset time of usage. - :type next_reset_time: ~datetime.datetime - :param current_value: Current value of usage. - :type current_value: long - :param limit: Limit of usage. - :type limit: long - :param name: Name of usage. - :type name: ~azure.mgmt.recoveryservices.models.NameInfo + :ivar unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond". + :vartype unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit + :ivar quota_period: Quota period of usage. + :vartype quota_period: str + :ivar next_reset_time: Next reset time of usage. + :vartype next_reset_time: ~datetime.datetime + :ivar current_value: Current value of usage. + :vartype current_value: long + :ivar limit: Limit of usage. + :vartype limit: long + :ivar name: Name of usage. + :vartype name: ~azure.mgmt.recoveryservices.models.NameInfo """ _attribute_map = { @@ -1844,6 +2309,21 @@ def __init__( name: Optional["NameInfo"] = None, **kwargs ): + """ + :keyword unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", + "Percent", "CountPerSecond", "BytesPerSecond". + :paramtype unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit + :keyword quota_period: Quota period of usage. + :paramtype quota_period: str + :keyword next_reset_time: Next reset time of usage. + :paramtype next_reset_time: ~datetime.datetime + :keyword current_value: Current value of usage. + :paramtype current_value: long + :keyword limit: Limit of usage. + :paramtype limit: long + :keyword name: Name of usage. + :paramtype name: ~azure.mgmt.recoveryservices.models.NameInfo + """ super(VaultUsage, self).__init__(**kwargs) self.unit = unit self.quota_period = quota_period @@ -1856,8 +2336,8 @@ def __init__( class VaultUsageList(msrest.serialization.Model): """Usage for vault. - :param value: The list of usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.VaultUsage] + :ivar value: The list of usages for the given vault. + :vartype value: list[~azure.mgmt.recoveryservices.models.VaultUsage] """ _attribute_map = { @@ -1870,5 +2350,9 @@ def __init__( value: Optional[List["VaultUsage"]] = None, **kwargs ): + """ + :keyword value: The list of usages for the given vault. + :paramtype value: list[~azure.mgmt.recoveryservices.models.VaultUsage] + """ super(VaultUsageList, self).__init__(**kwargs) self.value = value diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py index 3d8cf64858d6..a6b2243410f1 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AuthType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies the authentication type. """ @@ -36,7 +21,15 @@ class AuthType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ACCESS_CONTROL_SERVICE = "AccessControlService" AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BackupStorageVersion(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Backup storage version + """ + + V1 = "V1" + V2 = "V2" + UNASSIGNED = "Unassigned" + +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -45,14 +38,14 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class InfrastructureEncryptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class InfrastructureEncryptionState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enabling/Disabling the Double Encryption state """ ENABLED = "Enabled" DISABLED = "Disabled" -class PrivateEndpointConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the status. """ @@ -61,7 +54,7 @@ class PrivateEndpointConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, s REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets provisioning state of the private endpoint connection. """ @@ -70,7 +63,7 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FAILED = "Failed" PENDING = "Pending" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. @@ -81,21 +74,36 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceMoveState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The State of the Resource after the move operation + """ + + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + PREPARE_FAILED = "PrepareFailed" + COMMIT_FAILED = "CommitFailed" + PREPARE_TIMEDOUT = "PrepareTimedout" + COMMIT_TIMEDOUT = "CommitTimedout" + MOVE_SUCCEEDED = "MoveSucceeded" + FAILURE = "Failure" + CRITICAL_FAILURE = "CriticalFailure" + PARTIAL_SUCCESS = "PartialSuccess" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The Sku name. """ STANDARD = "Standard" RS0 = "RS0" -class TriggerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The way the vault upgrade was triggered. """ USER_TRIGGERED = "UserTriggered" FORCED_UPGRADE = "ForcedUpgrade" -class UsagesUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UsagesUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Unit of the usage. """ @@ -106,14 +114,14 @@ class UsagesUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COUNT_PER_SECOND = "CountPerSecond" BYTES_PER_SECOND = "BytesPerSecond" -class VaultPrivateEndpointState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class VaultPrivateEndpointState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Private endpoint state for backup. """ NONE = "None" ENABLED = "Enabled" -class VaultUpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class VaultUpgradeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Status of the vault upgrade operation. """ 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 18b502e794c5..b2c8f3f49d9d 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 @@ -5,24 +5,58 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.RecoveryServices/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class Operations(object): """Operations operations. @@ -45,6 +79,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs # type: Any @@ -53,8 +88,10 @@ def list( """Returns the list of available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClientDiscoveryResponse or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] + :return: An iterator like instance of either ClientDiscoveryResponse or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientDiscoveryResponse"] @@ -62,30 +99,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ClientDiscoveryResponse', pipeline_response) + deserialized = self._deserialize("ClientDiscoveryResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +137,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) 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 f5e0df8c83c0..a0ad3e9ec0d9 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 @@ -5,24 +5,106 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + private_link_resource_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "privateLinkResourceName": _SERIALIZER.url("private_link_resource_name", private_link_resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -45,6 +127,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name, # type: str @@ -62,7 +145,8 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResources or the result of cls(response) + :return: An iterator like instance of either PrivateLinkResources or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.PrivateLinkResources] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -71,36 +155,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateLinkResources', pipeline_response) + deserialized = self._deserialize("PrivateLinkResources", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,11 +199,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources'} # type: ignore + @distributed_trace def get( self, resource_group_name, # type: str @@ -152,28 +235,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + private_link_resource_name=private_link_resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,4 +260,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}'} # 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 c0239cfaa7aa..bbb9345690d8 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 @@ -5,25 +5,110 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_get_operation_status_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + operation_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_operation_result_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + operation_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class RecoveryServicesClientOperationsMixin(object): + @distributed_trace def get_operation_status( self, resource_group_name, # type: str @@ -51,28 +136,18 @@ def get_operation_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_status.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_operation_status_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_status.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -86,8 +161,11 @@ def get_operation_status( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}'} # type: ignore + + @distributed_trace def get_operation_result( self, resource_group_name, # type: str @@ -115,28 +193,18 @@ def get_operation_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_result.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_operation_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -152,4 +220,6 @@ def get_operation_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}'} # 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 a3654fbec496..cbc00c7e05c0 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 @@ -5,23 +5,71 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_check_name_availability_request( + subscription_id, # type: str + resource_group_name, # type: str + location, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class RecoveryServicesOperations(object): """RecoveryServicesOperations operations. @@ -44,6 +92,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def check_name_availability( self, resource_group_name, # type: str @@ -53,8 +102,10 @@ def check_name_availability( ): # type: (...) -> "_models.CheckNameAvailabilityResult" """API to check for resource name availability. - A name is available if no other resource exists that has the same SubscriptionId, Resource Name and Type - or if one or more such resources exist, each of these must be GC'd and their time of deletion be more than 24 Hours Ago. + A name is available if no other resource exists that has the same SubscriptionId, Resource Name + and Type + or if one or more such resources exist, each of these must be GC'd and their time of deletion + be more than 24 Hours Ago. API to check for resource name availability. A name is available if no other resource exists that has the same SubscriptionId, Resource Name @@ -79,32 +130,22 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'CheckNameAvailabilityParameters') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CheckNameAvailabilityParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -118,4 +159,6 @@ def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability'} # 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 55f19f9d9eba..e83239cdc59a 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 @@ -5,23 +5,63 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + identity_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "identityName": _SERIALIZER.url("identity_name", identity_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + +# fmt: on class RegisteredIdentitiesOperations(object): """RegisteredIdentitiesOperations operations. @@ -44,6 +84,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def delete( self, resource_group_name, # type: str @@ -71,26 +112,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'identityName': self._serialize.url("identity_name", identity_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + identity_name=identity_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -102,3 +135,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}'} # type: ignore + 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 5a84fb7c3be7..c0684d08469f 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 @@ -5,24 +5,68 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/replicationUsages') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class ReplicationUsagesOperations(object): """ReplicationUsagesOperations operations. @@ -45,6 +89,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name, # type: str @@ -60,7 +105,8 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationUsageList or the result of cls(response) + :return: An iterator like instance of either ReplicationUsageList or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.ReplicationUsageList] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -69,36 +115,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationUsageList', pipeline_response) + deserialized = self._deserialize("ReplicationUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,6 +159,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) 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 28005deeed8f..4858f6e0b745 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 @@ -5,24 +5,68 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_vaults_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/usages') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -45,6 +89,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_vaults( self, resource_group_name, # type: str @@ -69,36 +114,33 @@ def list_by_vaults( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_vaults.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list_by_vaults.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VaultUsageList', pipeline_response) + deserialized = self._deserialize("VaultUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,6 +158,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) 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 0951d6c98503..473e450fbbab 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 @@ -5,23 +5,73 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_create_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + certificate_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class VaultCertificatesOperations(object): """VaultCertificatesOperations operations. @@ -44,6 +94,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create( self, resource_group_name, # type: str @@ -74,33 +125,23 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(certificate_request, 'CertificateRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + certificate_name=certificate_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(certificate_request, 'CertificateRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -114,4 +155,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}'} # 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 90b8efbeef70..e56bb9338591 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 @@ -5,23 +5,147 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class VaultExtendedInfoOperations(object): """VaultExtendedInfoOperations operations. @@ -44,6 +168,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, resource_group_name, # type: str @@ -68,27 +193,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -102,8 +217,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace def create_or_update( self, resource_group_name, # type: str @@ -120,7 +238,8 @@ def create_or_update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -131,32 +250,22 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,8 +279,11 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace def update( self, resource_group_name, # type: str @@ -188,7 +300,8 @@ def update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -199,32 +312,22 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -238,4 +341,6 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # 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 3f4945c53fb7..f54c98c1d1f1 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 @@ -5,26 +5,252 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_subscription_id_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id, # type: str + resource_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class VaultsOperations(object): """VaultsOperations operations. @@ -47,6 +273,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_subscription_id( self, **kwargs # type: Any @@ -64,34 +291,29 @@ def list_by_subscription_id( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_subscription_id.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=self.list_by_subscription_id.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,11 +331,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name, # type: str @@ -135,35 +359,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -181,11 +401,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace def get( self, resource_group_name, # type: str @@ -210,27 +432,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,8 +456,10 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + def _create_or_update_initial( self, resource_group_name, # type: str @@ -259,32 +473,22 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'Vault') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'Vault') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -302,8 +506,11 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, resource_group_name, # type: str @@ -323,15 +530,18 @@ def begin_create_or_update( :type vault: ~azure.mgmt.recoveryservices.models.Vault :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either Vault or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -343,27 +553,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,8 +579,10 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + @distributed_trace def delete( self, resource_group_name, # type: str @@ -401,27 +607,17 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -434,6 +630,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + def _update_initial( self, resource_group_name, # type: str @@ -447,32 +644,22 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'PatchVault') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'PatchVault') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -488,8 +675,11 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace def begin_update( self, resource_group_name, # type: str @@ -509,15 +699,18 @@ def begin_update( :type vault: ~azure.mgmt.recoveryservices.models.PatchVault :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either Vault or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -529,27 +722,21 @@ def begin_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -561,4 +748,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore